@eluvio/elv-client-js 3.2.0 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  * @author Feross Aboukhadijeh <http://feross.org>
6
6
  * @license MIT
7
7
  */
8
- var r=n(75),a=n(76),i=n(51);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return d(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|l(e,n),a=(t=o(t,r)).write(e,n);a!==r&&(t=t.slice(0,a));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|f(e.length);return 0===(t=o(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?o(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function A(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function d(t,e){if(A(e),t=o(t,e<0?0:0|f(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|f(e.length);t=o(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function l(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function h(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,n);case"utf8":case"utf-8":return Q(this,e,n);case"ascii":return M(this,e,n);case"latin1":case"binary":return _(this,e,n);case"base64":return B(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,a){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:b(t,e,n,r,a);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,r,a){var i,s=1,o=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,o/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(a){var A=-1;for(i=n;i<o;i++)if(c(t,i)===c(e,-1===A?0:i-A)){if(-1===A&&(A=i),i-A+1===u)return A*s}else-1!==A&&(i-=i-A),A=-1}else for(n+u>o&&(n=o-u),i=n;i>=0;i--){for(var d=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){d=!1;break}if(d)return i}return-1}function m(t,e,n,r){n=Number(n)||0;var a=t.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var o=parseInt(e.substr(2*s,2),16);if(isNaN(o))return s;t[n+s]=o}return s}function I(t,e,n,r){return P(j(e,t.length-n),t,n,r)}function C(t,e,n,r){return P(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function v(t,e,n,r){return C(t,e,n,r)}function w(t,e,n,r){return P(F(e),t,n,r)}function E(t,e,n,r){return P(function(t,e){for(var n,r,a,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(e,t.length-n),t,n,r)}function B(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Q(t,e,n){n=Math.min(t.length,n);for(var r=[],a=e;a<n;){var i,s,o,u,c=t[a],A=null,d=c>239?4:c>223?3:c>191?2:1;if(a+d<=n)switch(d){case 1:c<128&&(A=c);break;case 2:128==(192&(i=t[a+1]))&&(u=(31&c)<<6|63&i)>127&&(A=u);break;case 3:i=t[a+1],s=t[a+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(A=u);break;case 4:i=t[a+1],s=t[a+2],o=t[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(A=u)}null===A?(A=65533,d=1):A>65535&&(A-=65536,r.push(A>>>10&1023|55296),A=56320|1023&A),r.push(A),a+=d}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},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(t,e,n){return function(t,e,n,r){return A(e),e<=0?o(t,e):void 0!==n?"string"==typeof r?o(t,e).fill(n,r):o(t,e).fill(n):o(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return d(null,t)},u.allocUnsafeSlow=function(t){return d(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,a=0,i=Math.min(n,r);a<i;++a)if(t[a]!==e[a]){n=t[a],r=e[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,a),a+=s.length}return r},u.byteLength=l,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Q(this,0,t):h.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,a){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||n>t.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=n)return 0;if(r>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),o=Math.min(i,s),c=this.slice(r,a),A=t.slice(e,n),d=0;d<o;++d)if(c[d]!==A[d]){i=c[d],s=A[d];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return I(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return v(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function M(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(127&t[a]);return r}function _(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(t[a]);return r}function x(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=e;i<n;++i)a+=U(t[i]);return a}function k(t,e,n){for(var r=t.slice(e,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function S(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,a,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(t.length-n,2);a<i;++a)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(t.length-n,4);a<i;++a)t[n+a]=e>>>8*(r?a:3-a)&255}function T(t,e,n,r,a,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(t,e,n,r,i){return i||T(t,0,n,4),a.write(t,e,n,r,23,4),n+4}function H(t,e,n,r,i){return i||T(t,0,n,8),a.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var a=e-t;n=new u(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t+--e],a=1;e>0&&(a*=256);)r+=this[t+--e]*a;return r},u.prototype.readUInt8=function(t,e){return e||S(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||S(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||S(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=e,a=1,i=this[t+--r];r>0&&(a*=256);)i+=this[t+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||S(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||S(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||S(t,4,this.length),a.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||S(t,4,this.length),a.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||S(t,8,this.length),a.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||S(t,8,this.length),a.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[e]=255&t;++i<n&&(a*=256);)this[e+i]=t/a&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);D(this,t,e,n,a-1,-a)}var i=0,s=1,o=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);D(this,t,e,n,a-1,-a)}var i=n-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return O(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return O(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return H(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return H(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var a,i=r-n;if(this===t&&n<e&&e<r)for(a=i-1;a>=0;--a)t[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=u.isBuffer(t)?t:j(new u(t,r).toString()),o=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%o]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var n;e=e||1/0;for(var r=t.length,a=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=t.length);++a)e[a+n]=t[a];return a}}).call(this,n(5))},function(t,e,n){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,r){"use strict";function a(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function s(t,e,n){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"===e(t)?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;try{o=n(293).Buffer}catch(t){}function u(t,e,n){for(var r=0,i=Math.min(t.length,n),s=0,o=e;o<i;o++){var u,c=t.charCodeAt(o)-48;r<<=4,r|=u=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,s|=u}return a(!(240&s),"Invalid character in "+t),r}function c(t,e,n,r){for(var i=0,s=0,o=Math.min(t.length,n),u=e;u<o;u++){var c=t.charCodeAt(u)-48;i*=r,s=c>=49?c-49+10:c>=17?c-17+10:c,a(c>=0&&s<r,"Invalid character"),i+=s}return i}function A(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,n,r){if("number"==typeof t)return this._initNumber(t,n,r);if("object"===e(t))return this._initArray(t,n,r);"hex"===n&&(n=16),a(n===(0|n)&&n>=2&&n<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===n?this._parseHex(t,i):this._parseBase(t,n,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),n,r)},s.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(a(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},s.prototype._initArray=function(t,e,n){if(a("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,s,o=0;if("be"===n)for(r=t.length-1,i=0;r>=0;r-=3)s=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===n)for(r=0,i=0;r<t.length;r+=3)s=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this._strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,a,i=0;for(n=t.length-6,r=0;n>=e;n-=6)a=u(t,n,n+6),this.words[r]|=a<<i&67108863,this.words[r+1]|=a>>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);n+6!==e&&(a=u(t,e,n+6),this.words[r]|=a<<i&67108863,this.words[r+1]|=a>>>26-i&4194303),this._strip()},s.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=t.length-n,s=i%r,o=Math.min(i,i-s)+n,u=0,A=n;A<o;A+=r)u=c(t,A,A+r,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(t,A,t.length,e),A=0;A<s;A++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){A(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?s.prototype[Symbol.for("nodejs.util.inspect.custom")]=d:s.prototype.inspect=d;var p=["","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"],f=[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],l=[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];s.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,i=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<r|i)).toString(16);n=0!==(i=o>>>24-r&16777215)||s!==this.length-1?p[6-u.length]+u+n:u+n,(r+=2)>=26&&(r-=26,s--)}for(0!==i&&(n=i.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],A=l[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(A).toString(t);n=(d=d.idivn(A)).isZero()?h+n:p[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}a(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function h(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var a=0|t.words[0],i=0|e.words[0],s=a*i,o=67108863&s,u=s/67108864|0;n.words[0]=o;for(var c=1;c<r;c++){for(var A=u>>>26,d=67108863&u,p=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=p;f++){var l=c-f|0;A+=(s=(a=0|t.words[l])*(i=0|e.words[f])+d)/67108864|0,d=67108863&s}n.words[c]=0|d,u=0|A}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}s.prototype.toArrayLike=function(t,e,n){this._strip();var r=this.byteLength(),i=n||Math.max(1,r);a(r<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,r),s},s.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|r;t[n++]=255&s,n<t.length&&(t[n++]=s>>8&255),n<t.length&&(t[n++]=s>>16&255),6===i?(n<t.length&&(t[n++]=s>>24&255),r=0,i=0):(r=s>>>24,i+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|r;t[n--]=255&s,n>=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===i?(n>=0&&(t[n--]=s>>24&255),r=0,i=0):(r=s>>>24,i+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return a(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return a(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return a(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){a("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){a("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<r:this.words[n]&~(1<<r),this._strip()},s.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var a=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<n.length;i++)e=(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,n){var r,a,i,s=t.words,o=e.words,u=n.words,c=0,A=0|s[0],d=8191&A,p=A>>>13,f=0|s[1],l=8191&f,h=f>>>13,y=0|s[2],g=8191&y,b=y>>>13,m=0|s[3],I=8191&m,C=m>>>13,v=0|s[4],w=8191&v,E=v>>>13,B=0|s[5],Q=8191&B,M=B>>>13,_=0|s[6],x=8191&_,k=_>>>13,S=0|s[7],D=8191&S,R=S>>>13,N=0|s[8],T=8191&N,O=N>>>13,H=0|s[9],L=8191&H,U=H>>>13,j=0|o[0],F=8191&j,P=j>>>13,G=0|o[1],q=8191&G,Y=G>>>13,K=0|o[2],z=8191&K,J=K>>>13,V=0|o[3],W=8191&V,Z=V>>>13,X=0|o[4],$=8191&X,tt=X>>>13,et=0|o[5],nt=8191&et,rt=et>>>13,at=0|o[6],it=8191&at,st=at>>>13,ot=0|o[7],ut=8191&ot,ct=ot>>>13,At=0|o[8],dt=8191&At,pt=At>>>13,ft=0|o[9],lt=8191&ft,ht=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var yt=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,P))+Math.imul(p,F)|0))<<13)|0;c=((i=Math.imul(p,P))+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(l,F),a=(a=Math.imul(l,P))+Math.imul(h,F)|0,i=Math.imul(h,P);var gt=(c+(r=r+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(p,q)|0))<<13)|0;c=((i=i+Math.imul(p,Y)|0)+(a>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,F),a=(a=Math.imul(g,P))+Math.imul(b,F)|0,i=Math.imul(b,P),r=r+Math.imul(l,q)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(h,q)|0,i=i+Math.imul(h,Y)|0;var bt=(c+(r=r+Math.imul(d,z)|0)|0)+((8191&(a=(a=a+Math.imul(d,J)|0)+Math.imul(p,z)|0))<<13)|0;c=((i=i+Math.imul(p,J)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,P))+Math.imul(C,F)|0,i=Math.imul(C,P),r=r+Math.imul(g,q)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,Y)|0,r=r+Math.imul(l,z)|0,a=(a=a+Math.imul(l,J)|0)+Math.imul(h,z)|0,i=i+Math.imul(h,J)|0;var mt=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(p,W)|0))<<13)|0;c=((i=i+Math.imul(p,Z)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,P))+Math.imul(E,F)|0,i=Math.imul(E,P),r=r+Math.imul(I,q)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,q)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(g,z)|0,a=(a=a+Math.imul(g,J)|0)+Math.imul(b,z)|0,i=i+Math.imul(b,J)|0,r=r+Math.imul(l,W)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(h,W)|0,i=i+Math.imul(h,Z)|0;var It=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;c=((i=i+Math.imul(p,tt)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(Q,F),a=(a=Math.imul(Q,P))+Math.imul(M,F)|0,i=Math.imul(M,P),r=r+Math.imul(w,q)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(E,q)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(I,z)|0,a=(a=a+Math.imul(I,J)|0)+Math.imul(C,z)|0,i=i+Math.imul(C,J)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,Z)|0,r=r+Math.imul(l,$)|0,a=(a=a+Math.imul(l,tt)|0)+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0;var Ct=(c+(r=r+Math.imul(d,nt)|0)|0)+((8191&(a=(a=a+Math.imul(d,rt)|0)+Math.imul(p,nt)|0))<<13)|0;c=((i=i+Math.imul(p,rt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,P))+Math.imul(k,F)|0,i=Math.imul(k,P),r=r+Math.imul(Q,q)|0,a=(a=a+Math.imul(Q,Y)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(w,z)|0,a=(a=a+Math.imul(w,J)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,J)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(g,$)|0,a=(a=a+Math.imul(g,tt)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,tt)|0,r=r+Math.imul(l,nt)|0,a=(a=a+Math.imul(l,rt)|0)+Math.imul(h,nt)|0,i=i+Math.imul(h,rt)|0;var vt=(c+(r=r+Math.imul(d,it)|0)|0)+((8191&(a=(a=a+Math.imul(d,st)|0)+Math.imul(p,it)|0))<<13)|0;c=((i=i+Math.imul(p,st)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(D,F),a=(a=Math.imul(D,P))+Math.imul(R,F)|0,i=Math.imul(R,P),r=r+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(Q,z)|0,a=(a=a+Math.imul(Q,J)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,J)|0,r=r+Math.imul(w,W)|0,a=(a=a+Math.imul(w,Z)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(I,$)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,tt)|0,r=r+Math.imul(g,nt)|0,a=(a=a+Math.imul(g,rt)|0)+Math.imul(b,nt)|0,i=i+Math.imul(b,rt)|0,r=r+Math.imul(l,it)|0,a=(a=a+Math.imul(l,st)|0)+Math.imul(h,it)|0,i=i+Math.imul(h,st)|0;var wt=(c+(r=r+Math.imul(d,ut)|0)|0)+((8191&(a=(a=a+Math.imul(d,ct)|0)+Math.imul(p,ut)|0))<<13)|0;c=((i=i+Math.imul(p,ct)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(T,F),a=(a=Math.imul(T,P))+Math.imul(O,F)|0,i=Math.imul(O,P),r=r+Math.imul(D,q)|0,a=(a=a+Math.imul(D,Y)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(x,z)|0,a=(a=a+Math.imul(x,J)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,J)|0,r=r+Math.imul(Q,W)|0,a=(a=a+Math.imul(Q,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(w,$)|0,a=(a=a+Math.imul(w,tt)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,tt)|0,r=r+Math.imul(I,nt)|0,a=(a=a+Math.imul(I,rt)|0)+Math.imul(C,nt)|0,i=i+Math.imul(C,rt)|0,r=r+Math.imul(g,it)|0,a=(a=a+Math.imul(g,st)|0)+Math.imul(b,it)|0,i=i+Math.imul(b,st)|0,r=r+Math.imul(l,ut)|0,a=(a=a+Math.imul(l,ct)|0)+Math.imul(h,ut)|0,i=i+Math.imul(h,ct)|0;var Et=(c+(r=r+Math.imul(d,dt)|0)|0)+((8191&(a=(a=a+Math.imul(d,pt)|0)+Math.imul(p,dt)|0))<<13)|0;c=((i=i+Math.imul(p,pt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,F),a=(a=Math.imul(L,P))+Math.imul(U,F)|0,i=Math.imul(U,P),r=r+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(O,q)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(D,z)|0,a=(a=a+Math.imul(D,J)|0)+Math.imul(R,z)|0,i=i+Math.imul(R,J)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(Q,$)|0,a=(a=a+Math.imul(Q,tt)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,a=(a=a+Math.imul(w,rt)|0)+Math.imul(E,nt)|0,i=i+Math.imul(E,rt)|0,r=r+Math.imul(I,it)|0,a=(a=a+Math.imul(I,st)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,st)|0,r=r+Math.imul(g,ut)|0,a=(a=a+Math.imul(g,ct)|0)+Math.imul(b,ut)|0,i=i+Math.imul(b,ct)|0,r=r+Math.imul(l,dt)|0,a=(a=a+Math.imul(l,pt)|0)+Math.imul(h,dt)|0,i=i+Math.imul(h,pt)|0;var Bt=(c+(r=r+Math.imul(d,lt)|0)|0)+((8191&(a=(a=a+Math.imul(d,ht)|0)+Math.imul(p,lt)|0))<<13)|0;c=((i=i+Math.imul(p,ht)|0)+(a>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(L,q),a=(a=Math.imul(L,Y))+Math.imul(U,q)|0,i=Math.imul(U,Y),r=r+Math.imul(T,z)|0,a=(a=a+Math.imul(T,J)|0)+Math.imul(O,z)|0,i=i+Math.imul(O,J)|0,r=r+Math.imul(D,W)|0,a=(a=a+Math.imul(D,Z)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,tt)|0,r=r+Math.imul(Q,nt)|0,a=(a=a+Math.imul(Q,rt)|0)+Math.imul(M,nt)|0,i=i+Math.imul(M,rt)|0,r=r+Math.imul(w,it)|0,a=(a=a+Math.imul(w,st)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,st)|0,r=r+Math.imul(I,ut)|0,a=(a=a+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,i=i+Math.imul(C,ct)|0,r=r+Math.imul(g,dt)|0,a=(a=a+Math.imul(g,pt)|0)+Math.imul(b,dt)|0,i=i+Math.imul(b,pt)|0;var Qt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(a=(a=a+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,r=Math.imul(L,z),a=(a=Math.imul(L,J))+Math.imul(U,z)|0,i=Math.imul(U,J),r=r+Math.imul(T,W)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(D,$)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,r=r+Math.imul(x,nt)|0,a=(a=a+Math.imul(x,rt)|0)+Math.imul(k,nt)|0,i=i+Math.imul(k,rt)|0,r=r+Math.imul(Q,it)|0,a=(a=a+Math.imul(Q,st)|0)+Math.imul(M,it)|0,i=i+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,a=(a=a+Math.imul(w,ct)|0)+Math.imul(E,ut)|0,i=i+Math.imul(E,ct)|0,r=r+Math.imul(I,dt)|0,a=(a=a+Math.imul(I,pt)|0)+Math.imul(C,dt)|0,i=i+Math.imul(C,pt)|0;var Mt=(c+(r=r+Math.imul(g,lt)|0)|0)+((8191&(a=(a=a+Math.imul(g,ht)|0)+Math.imul(b,lt)|0))<<13)|0;c=((i=i+Math.imul(b,ht)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,W),a=(a=Math.imul(L,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(T,$)|0,a=(a=a+Math.imul(T,tt)|0)+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,r=r+Math.imul(D,nt)|0,a=(a=a+Math.imul(D,rt)|0)+Math.imul(R,nt)|0,i=i+Math.imul(R,rt)|0,r=r+Math.imul(x,it)|0,a=(a=a+Math.imul(x,st)|0)+Math.imul(k,it)|0,i=i+Math.imul(k,st)|0,r=r+Math.imul(Q,ut)|0,a=(a=a+Math.imul(Q,ct)|0)+Math.imul(M,ut)|0,i=i+Math.imul(M,ct)|0,r=r+Math.imul(w,dt)|0,a=(a=a+Math.imul(w,pt)|0)+Math.imul(E,dt)|0,i=i+Math.imul(E,pt)|0;var _t=(c+(r=r+Math.imul(I,lt)|0)|0)+((8191&(a=(a=a+Math.imul(I,ht)|0)+Math.imul(C,lt)|0))<<13)|0;c=((i=i+Math.imul(C,ht)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(L,$),a=(a=Math.imul(L,tt))+Math.imul(U,$)|0,i=Math.imul(U,tt),r=r+Math.imul(T,nt)|0,a=(a=a+Math.imul(T,rt)|0)+Math.imul(O,nt)|0,i=i+Math.imul(O,rt)|0,r=r+Math.imul(D,it)|0,a=(a=a+Math.imul(D,st)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,st)|0,r=r+Math.imul(x,ut)|0,a=(a=a+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,i=i+Math.imul(k,ct)|0,r=r+Math.imul(Q,dt)|0,a=(a=a+Math.imul(Q,pt)|0)+Math.imul(M,dt)|0,i=i+Math.imul(M,pt)|0;var xt=(c+(r=r+Math.imul(w,lt)|0)|0)+((8191&(a=(a=a+Math.imul(w,ht)|0)+Math.imul(E,lt)|0))<<13)|0;c=((i=i+Math.imul(E,ht)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,nt),a=(a=Math.imul(L,rt))+Math.imul(U,nt)|0,i=Math.imul(U,rt),r=r+Math.imul(T,it)|0,a=(a=a+Math.imul(T,st)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,st)|0,r=r+Math.imul(D,ut)|0,a=(a=a+Math.imul(D,ct)|0)+Math.imul(R,ut)|0,i=i+Math.imul(R,ct)|0,r=r+Math.imul(x,dt)|0,a=(a=a+Math.imul(x,pt)|0)+Math.imul(k,dt)|0,i=i+Math.imul(k,pt)|0;var kt=(c+(r=r+Math.imul(Q,lt)|0)|0)+((8191&(a=(a=a+Math.imul(Q,ht)|0)+Math.imul(M,lt)|0))<<13)|0;c=((i=i+Math.imul(M,ht)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,it),a=(a=Math.imul(L,st))+Math.imul(U,it)|0,i=Math.imul(U,st),r=r+Math.imul(T,ut)|0,a=(a=a+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,i=i+Math.imul(O,ct)|0,r=r+Math.imul(D,dt)|0,a=(a=a+Math.imul(D,pt)|0)+Math.imul(R,dt)|0,i=i+Math.imul(R,pt)|0;var St=(c+(r=r+Math.imul(x,lt)|0)|0)+((8191&(a=(a=a+Math.imul(x,ht)|0)+Math.imul(k,lt)|0))<<13)|0;c=((i=i+Math.imul(k,ht)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(L,ut),a=(a=Math.imul(L,ct))+Math.imul(U,ut)|0,i=Math.imul(U,ct),r=r+Math.imul(T,dt)|0,a=(a=a+Math.imul(T,pt)|0)+Math.imul(O,dt)|0,i=i+Math.imul(O,pt)|0;var Dt=(c+(r=r+Math.imul(D,lt)|0)|0)+((8191&(a=(a=a+Math.imul(D,ht)|0)+Math.imul(R,lt)|0))<<13)|0;c=((i=i+Math.imul(R,ht)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(L,dt),a=(a=Math.imul(L,pt))+Math.imul(U,dt)|0,i=Math.imul(U,pt);var Rt=(c+(r=r+Math.imul(T,lt)|0)|0)+((8191&(a=(a=a+Math.imul(T,ht)|0)+Math.imul(O,lt)|0))<<13)|0;c=((i=i+Math.imul(O,ht)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(c+(r=Math.imul(L,lt))|0)+((8191&(a=(a=Math.imul(L,ht))+Math.imul(U,lt)|0))<<13)|0;return c=((i=Math.imul(U,ht))+(a>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=yt,u[1]=gt,u[2]=bt,u[3]=mt,u[4]=It,u[5]=Ct,u[6]=vt,u[7]=wt,u[8]=Et,u[9]=Bt,u[10]=Qt,u[11]=Mt,u[12]=_t,u[13]=xt,u[14]=kt,u[15]=St,u[16]=Dt,u[17]=Rt,u[18]=Nt,0!==c&&(u[19]=c,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,a=0,i=0;i<n.length-1;i++){var s=a;a=0;for(var o=67108863&r,u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var A=i-c,d=(0|t.words[A])*(0|e.words[c]),p=67108863&d;o=67108863&(p=p+o|0),a+=(s=(s=s+(d/67108864|0)|0)+(p>>>26)|0)>>>26,s&=67108863}n.words[i]=o,r=s,s=a}return 0!==r?n.words[i]=r:n.length--,n._strip()}function b(t,e,n){return g(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(y=h),s.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):n<63?h(this,t,e):n<1024?g(this,t,e):b(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},m.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,a=0;a<e;a++)r|=(1&t)<<e-a-1,t>>=1;return r},m.prototype.permute=function(t,e,n,r,a,i){for(var s=0;s<i;s++)r[s]=e[t[s]],a[s]=n[t[s]]},m.prototype.transform=function(t,e,n,r,a,i){this.permute(i,t,e,n,r,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),A=0;A<a;A+=o)for(var d=u,p=c,f=0;f<s;f++){var l=n[A+f],h=r[A+f],y=n[A+f+s],g=r[A+f+s],b=d*y-p*g;g=d*g+p*y,y=b,n[A+f]=l+y,r[A+f]=h+g,n[A+f+s]=l-y,r[A+f+s]=h-g,f!==o&&(b=u*d-c*p,p=u*p+c*d,d=b)}},m.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,a=0;for(n=n/2|0;n;n>>>=1)a++;return 1<<a+1+r},m.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var a=t[r];t[r]=t[n-r-1],t[n-r-1]=a,a=e[r],e[r]=-e[n-r-1],e[n-r-1]=-a}},m.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var a=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&a,n=a<67108864?0:a/67108864|0}return t},m.prototype.convert13b=function(t,e,n,r){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<r;++s)n[s]=0;a(0===i),a(0==(-8192&i))},m.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},m.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(r),i=this.stub(r),s=new Array(r),o=new Array(r),u=new Array(r),c=new Array(r),A=new Array(r),d=new Array(r),p=n.words;p.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,o,u,r,a),this.transform(c,i,A,d,r,a);for(var f=0;f<r;f++){var l=o[f]*A[f]-u[f]*d[f];u[f]=o[f]*d[f]+u[f]*A[f],o[f]=l}return this.conjugate(o,u,r),this.transform(o,u,p,i,r,a),this.conjugate(p,i,r),this.normalize13b(p,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),b(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),a("number"==typeof t),a(t<67108864);for(var n=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[r]=67108863&s}return 0!==n&&(this.words[r]=n,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,a=n%26;e[n]=t.words[r]>>>a&1}return e}(t);if(0===e.length)return new s(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var a=n.sqr();r<e.length;r++,a=a.sqr())0!==e[r]&&(n=n.mul(a));return n},s.prototype.iushln=function(t){a("number"==typeof t&&t>=0);var e,n=t%26,r=(t-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var o=this.words[e]&i,u=(0|this.words[e])-o<<n;this.words[e]=u|s,s=o>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this._strip()},s.prototype.ishln=function(t){return a(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,n){var r;a("number"==typeof t&&t>=0),r=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<<i,u=n;if(r-=s,r=Math.max(0,r),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var A=0;for(c=this.length-1;c>=0&&(0!==A||c>=r);c--){var d=0|this.words[c];this.words[c]=A<<26-i|d>>>i,A=d&o}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,n){return a(0===this.negative),this.iushrn(t,e,n)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){a("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,r=1<<e;return!(this.length<=n)&&!!(this.words[n]&r)},s.prototype.imaskn=function(t){a("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return a("number"==typeof t),a(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(a("number"==typeof t),a(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,n){var r,i,s=t.length+n;this._expand(s);var o=0;for(r=0;r<t.length;r++){i=(0|this.words[r+n])+o;var u=(0|t.words[r])*e;o=((i-=67108863&u)>>26)-(u/67108864|0),this.words[r+n]=67108863&i}for(;r<this.length-n;r++)o=(i=(0|this.words[r+n])+o)>>26,this.words[r+n]=67108863&i;if(0===o)return this._strip();for(a(-1===o),o=0,r=0;r<this.length;r++)o=(i=-(0|this.words[r])+o)>>26,this.words[r]=67108863&i;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),a=t,i=0|a.words[a.length-1];0!==(n=26-this._countBits(i))&&(a=a.ushln(n),r.iushln(n),i=0|a.words[a.length-1]);var o,u=r.length-a.length;if("mod"!==e){(o=new s(null)).length=u+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var A=r.clone()._ishlnsubmul(a,1,u);0===A.negative&&(r=A,o&&(o.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(p=Math.min(p/i|0,67108863),r._ishlnsubmul(a,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=p)}return o&&o._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},s.prototype.divmod=function(t,e,n){return a(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(r=o.div.neg()),"div"!==e&&(i=o.mod.neg(),n&&0!==i.negative&&i.iadd(t)),{div:r,mod:i}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(i=o.mod.neg(),n&&0!==i.negative&&i.isub(t)),{div:o.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var r,i,o},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),a=t.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),a(t<=67108863);for(var n=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(n*r+(0|this.words[i]))%t;return e?-r:r},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),a(t<=67108863);for(var n=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*n;this.words[r]=i/t|0,n=i%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){a(0===t.negative),a(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new s(1),i=new s(0),o=new s(0),u=new s(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var A=n.clone(),d=e.clone();!e.isZero();){for(var p=0,f=1;0==(e.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(A),i.isub(d)),r.iushrn(1),i.iushrn(1);for(var l=0,h=1;0==(n.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(n.iushrn(l);l-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(A),u.isub(d)),o.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),r.isub(o),i.isub(u)):(n.isub(e),o.isub(r),u.isub(i))}return{a:o,b:u,gcd:n.iushln(c)}},s.prototype._invmp=function(t){a(0===t.negative),a(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,i=new s(1),o=new s(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,A=1;0==(e.words[0]&A)&&c<26;++c,A<<=1);if(c>0)for(e.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(u),i.iushrn(1);for(var d=0,p=1;0==(n.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(n.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(o)):(n.isub(e),o.isub(i))}return(r=0===e.cmpn(1)?i:o).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var a=e.cmp(n);if(a<0){var i=e;e=n,n=i}else if(0===a||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){a("number"==typeof t);var e=t%26,n=(t-e)/26,r=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var i=r,s=n;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),a(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],a=0|t.words[n];if(r!==a){r<a?e=-1:r>a&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new Q(t)},s.prototype.toRed=function(t){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return a(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return a(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var I={k256:null,p224:null,p192:null,p25519:null};function C(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Q(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else a(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){Q.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}C.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},C.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n._strip(),n},C.prototype.split=function(t,e){t.iushrn(this.n,0,e)},C.prototype.imulK=function(t){return t.imul(this.k)},i(v,C),v.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,t.words[r-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,C),i(E,C),i(B,C),B.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,a=67108863&r;r>>>=26,t.words[n]=a,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(I[t])return I[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new B}return I[t]=e,e},Q.prototype._verify1=function(t){a(0===t.negative,"red works only with positives"),a(t.red,"red works only with red numbers")},Q.prototype._verify2=function(t,e){a(0==(t.negative|e.negative),"red works only with positives"),a(t.red&&t.red===e.red,"red works only with red numbers")},Q.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(A(t,t.umod(this.m)._forceRed(this)),t)},Q.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Q.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},Q.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},Q.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},Q.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},Q.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},Q.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},Q.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},Q.prototype.isqr=function(t){return this.imul(t,t.clone())},Q.prototype.sqr=function(t){return this.mul(t,t)},Q.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(a(e%2==1),3===e){var n=this.m.add(new s(1)).iushrn(2);return this.pow(t,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);a(!r.isZero());var o=new s(1).toRed(this),u=o.redNeg(),c=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new s(2*A*A).toRed(this);0!==this.pow(A,c).cmp(u);)A.redIAdd(u);for(var d=this.pow(A,r),p=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),l=i;0!==f.cmp(o);){for(var h=f,y=0;0!==h.cmp(o);y++)h=h.redSqr();a(y<l);var g=this.pow(d,new s(1).iushln(l-y-1));p=p.redMul(g),d=g.redSqr(),f=f.redMul(d),l=y}return p},Q.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},Q.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new s(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var a=n[0],i=0,o=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],A=u-1;A>=0;A--){var d=c>>A&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==i?(i<<=1,i|=d,(4===++o||0===r&&0===A)&&(a=this.mul(a,n[i]),o=0,i=0)):o=0}u=26}return a},Q.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},Q.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new M(t)},i(M,Q),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(10)(t))},function(t,e,n){t.exports=n(154)},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){var n,r,a=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],A=!1,d=-1;function p(){A&&u&&(A=!1,u.length?c=u.concat(c):d=-1,c.length&&f())}function f(){if(!A){var t=o(p);A=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,A=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function h(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new l(t,e)),1!==c.length||A||o(f)},l.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=h,a.addListener=h,a.once=h,a.off=h,a.removeListener=h,a.removeAllListeners=h,a.emit=h,a.prependListener=h,a.prependOnceListener=h,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=n,n.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},function(t,e,n){"use strict";var r=e,a=n(3),i=n(8),s=n(127);r.assert=i,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var a=1<<e+1,i=t.clone(),s=0;s<r.length;s++){var o,u=i.andln(a-1);i.isOdd()?(o=u>(a>>1)-1?(a>>1)-u:u,i.isubn(o)):o=0,r[s]=o,i.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,a=0,i=0;t.cmpn(-a)>0||e.cmpn(-i)>0;){var s,o,u=t.andln(3)+a&3,c=e.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==c?u:-u,n[0].push(s),o=0==(1&c)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[1].push(o),2*a===s+1&&(a=1-a),2*i===o+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new a(t,"hex","le")}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(8),a=n(0);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=a,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),a=0;a<t.length;a+=2)n.push(parseInt(t[a]+t[a+1],16))}else for(var r=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(t,a)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++a)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(a=0;a<t.length;a++)n[a]=0|t[a];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=o(t[n].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var a=t[r];"little"===e&&(a=s(a)),n+=u(a.toString(16))}return n},e.zero2=o,e.zero8=u,e.join32=function(t,e,n,a){var i=n-e;r(i%4==0);for(var s=new Array(i/4),o=0,u=e;o<s.length;o++,u+=4){var c;c="big"===a?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[o]=c>>>0}return s},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,a=0;r<t.length;r++,a+=4){var i=t[r];"big"===e?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,a){return t+e+n+r+a>>>0},e.sum64=function(t,e,n,r){var a=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+a;t[e]=s>>>0,t[e+1]=i},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,a,i,s,o){var u=0,c=e;return u+=(c=c+r>>>0)<e?1:0,u+=(c=c+i>>>0)<i?1:0,t+n+a+s+(u+=(c=c+o>>>0)<o?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,a,i,s,o){return e+r+i+o>>>0},e.sum64_5_hi=function(t,e,n,r,a,i,s,o,u,c){var A=0,d=e;return A+=(d=d+r>>>0)<e?1:0,A+=(d=d+i>>>0)<i?1:0,A+=(d=d+o>>>0)<o?1:0,t+n+a+s+u+(A+=(d=d+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,a,i,s,o,u,c){return e+r+i+o+c>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){(function(n){var r,a,i,s;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}s=function(){return function t(e,n,r){function a(s,o){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){return a(e[s][1][t]||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=!1,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.version="4.0.48"},{}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./utils/properties"),a=(i.isSigner=function(t){return r.isType(t,"Signer")},i);function i(){r.setType(this,"Signer")}n.Signer=a},{"./utils/properties":74}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./utils/bignumber");n.AddressZero="0x0000000000000000000000000000000000000000",n.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",n.EtherSymbol="Ξ";var a=r.bigNumberify(-1);n.NegativeOne=a;var i=r.bigNumberify(0);n.Zero=i;var s=r.bigNumberify(1);n.One=s;var o=r.bigNumberify(2);n.Two=o;var u=r.bigNumberify("1000000000000000000");n.WeiPerEther=u;var c=r.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");n.MaxUint256=c},{"./utils/bignumber":63}],4:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,u=t("./constants"),c=i(t("./errors")),A=t("./utils/abi-coder"),d=t("./utils/address"),p=t("./utils/bignumber"),f=t("./utils/bytes"),l=t("./utils/interface"),h=t("./utils/properties"),y=t("./providers/abstract-provider"),g=t("./abstract-signer"),b=(a(m,s=g.Signer),m.prototype.getAddress=function(){return Promise.resolve(this.address)},m.prototype._fail=function(t,e){return Promise.resolve().then((function(){c.throwError(t,c.UNSUPPORTED_OPERATION,{operation:e})}))},m.prototype.signMessage=function(t){return this._fail("VoidSigner cannot sign messages","signMessage")},m.prototype.sendTransaction=function(t){return this._fail("VoidSigner cannot sign transactions","sendTransaction")},m.prototype.connect=function(t){return new m(this.address,t)},m);function m(t,e){var n=s.call(this)||this;return h.defineReadOnly(n,"address",t),h.defineReadOnly(n,"provider",e),n}n.VoidSigner=b;var I={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function C(t,e,n){var r=t.interface.functions[e];return function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var i={},s=null;if(e.length===r.inputs.length+1&&"object"==o(e[e.length-1]))for(var d in null!=(i=h.shallowCopy(e.pop())).blockTag&&(s=i.blockTag),delete i.blockTag,i)if(!I[d])throw new Error("unknown transaction override "+d);if(e.length!=r.inputs.length)throw new Error("incorrect number of arguments");return["data","to"].forEach((function(t){null!=i[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),i.to=t._deployed(s).then((function(){return t.addressPromise})),function t(e,n,r){if(Array.isArray(r)){var a=[];return r.forEach((function(r,i){var s=Array.isArray(n)?n[i]:n[r.name];a.push(t(e,s,r))})),Promise.all(a)}if("address"===r.type)return e.resolveName(n);if("tuple"===r.type)return t(e,n,r.components);var i=r.type.match(/(.*)(\[[0-9]*\]$)/);if(i){if(!Array.isArray(n))throw new Error("invalid value for array");var s=[],o={components:r.components,type:i[1]};return n.forEach((function(n){s.push(t(e,n,o))})),Promise.all(s)}return Promise.resolve(n)}(t.provider,e,r.inputs).then((function(e){if(i.data=r.encode(e),"call"===r.type)return n?Promise.resolve(u.Zero):(t.provider||c.throwError("call (constant functions) require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach((function(t){if(null!=i[t])throw new Error("call cannot override "+t)})),null==i.from&&t.signer&&(i.from=t.signer.getAddress()),t.provider.call(i,s).then((function(n){var a;f.hexDataLength(n)%32==4&&"0x08c379a0"===f.hexDataSlice(n,0,4)&&(a=A.defaultAbiCoder.decode(["string"],f.hexDataSlice(n,4)),c.throwError("call revert exception",c.CALL_EXCEPTION,{address:t.address,args:e,method:r.signature,errorSignature:"Error(string)",errorArgs:[a],reason:a,transaction:i}));try{var s=r.decode(n);return 1===r.outputs.length&&(s=s[0]),s}catch(a){throw"0x"===n&&0<r.outputs.length&&c.throwError("call exception",c.CALL_EXCEPTION,{address:t.address,method:r.signature,args:e}),a}})));if("transaction"===r.type)return n?(t.provider||c.throwError("estimate gas require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),null==i.from&&t.signer&&(i.from=t.signer.getAddress()),t.provider.estimateGas(i)):(null==i.gasLimit&&null!=r.gas&&(i.gasLimit=p.bigNumberify(r.gas).add(21e3)),t.signer||c.throwError("sending a transaction requires a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=i.from&&c.throwError("cannot override from in a transaction",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.signer.sendTransaction(i).then((function(e){var n=e.wait.bind(e);return e.wait=function(e){return n(e).then((function(e){return e.events=e.logs.map((function(n){var r=h.deepCopy(n),a=t.interface.parseLog(n);return a&&(r.args=a.values,r.decode=a.decode,r.event=a.name,r.eventSignature=a.signature),r.removeListener=function(){return t.provider},r.getBlock=function(){return t.provider.getBlock(e.blockHash)},r.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},r.getTransactionReceipt=function(){return Promise.resolve(e)},r})),e}))},e})));throw new Error("invalid type - "+r.type)}))}}function v(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.join(":"):""):"*"}var w=(E.prototype.deployed=function(){return this._deployed()},E.prototype._deployed=function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&c.throwError("contract not deployed",c.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise},E.prototype.fallback=function(t){var e=this;this.signer||c.throwError("sending a transaction requires a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var n=h.shallowCopy(t||{});return["from","to"].forEach((function(t){null!=n[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),n.to=this.addressPromise,this.deployed().then((function(){return e.signer.sendTransaction(n)}))},E.prototype.connect=function(t){"string"==typeof t&&(t=new b(t,this.provider));var e=new E(this.address,this.interface,t);return this.deployTransaction&&h.defineReadOnly(e,"deployTransaction",this.deployTransaction),e},E.prototype.attach=function(t){return new E(t,this.interface,this.signer||this.provider)},E.isIndexed=function(t){return l.Interface.isIndexed(t)},E.prototype._getEventFilter=function(t){var e=this;if("string"==typeof t){if("*"===t)return{prepareEvent:function(t){var n=e.interface.parseLog(t);return n&&(t.args=n.values,t.decode=n.decode,t.event=n.name,t.eventSignature=n.signature),[t]},eventTag:"*",filter:{address:this.address}};-1!==t.indexOf("(")&&(t=A.formatSignature(A.parseSignature("event "+t)));var n=this.interface.events[t];n||c.throwError("unknown event - "+t,c.INVALID_ARGUMENT,{argumnet:"eventName",value:t});var r={address:this.address,topics:[n.topic]};return{prepareEvent:function(t){var e=n.decode(t.data,t.topics);t.args=e;var r=Array.prototype.slice.call(e);return r.push(t),r},event:n,eventTag:v(r),filter:r}}var a={address:this.address},i=null;if(t.topics&&t.topics[0])for(var s in a.topics=t.topics,this.interface.events)if(-1!==s.indexOf("(")){var o=this.interface.events[s];if(o.topic===t.topics[0].toLowerCase()){i=o;break}}return{prepareEvent:function(t){if(!i)return[t];var e=i.decode(t.data,t.topics);t.args=e;var n=Array.prototype.slice.call(e);return n.push(t),n},event:i,eventTag:v(a),filter:a}},E.prototype._addEventListener=function(t,e,n){var r=this;function a(n){var a=h.deepCopy(n),i=t.prepareEvent(a);t.event&&(a.decode=t.event.decode,a.event=t.event.name,a.eventSignature=t.event.signature),a.removeListener=function(){r.removeListener(t.filter,e)},a.getBlock=function(){return r.provider.getBlock(n.blockHash)},a.getTransaction=function(){return r.provider.getTransaction(n.transactionHash)},a.getTransactionReceipt=function(){return r.provider.getTransactionReceipt(n.transactionHash)},r.emit.apply(r,[t.filter].concat(i))}this.provider||c.throwError("events require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"once"}),this.provider.on(t.filter,a),this._events.push({eventFilter:t,listener:e,wrappedListener:a,once:n})},E.prototype.on=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!1),this},E.prototype.once=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!0),this},E.prototype.addListener=function(t,e){return this.on(t,e)},E.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this.provider)return!1;var a=!1,i=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==i.eventTag||(setTimeout((function(){t.listener.apply(e,n)}),0),a=!0,!t.once)})),a},E.prototype.listenerCount=function(t){if(!this.provider)return 0;var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).length},E.prototype.listeners=function(t){if(!this.provider)return[];var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).map((function(t){return t.listener}))},E.prototype.removeAllListeners=function(t){var e=this;if(!this.provider)return this;var n=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==n.eventTag||(e.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!1)})),this},E.prototype.removeListener=function(t,e){var n=this;if(!this.provider)return this;var r=!1,a=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==a.eventTag||t.listener!==e||(n.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!!r||!(r=!0))})),this},E);function E(t,e,n){var r=this;if(c.checkNew(this,E),l.Interface.isInterface(e)?h.defineReadOnly(this,"interface",e):h.defineReadOnly(this,"interface",new l.Interface(e)),g.Signer.isSigner(n)?(h.defineReadOnly(this,"provider",n.provider),h.defineReadOnly(this,"signer",n)):y.Provider.isProvider(n)?(h.defineReadOnly(this,"provider",n),h.defineReadOnly(this,"signer",null)):c.throwError("invalid signer or provider",c.INVALID_ARGUMENT,{arg:"signerOrProvider",value:n}),h.defineReadOnly(this,"estimate",{}),h.defineReadOnly(this,"functions",{}),h.defineReadOnly(this,"filters",{}),Object.keys(this.interface.events).forEach((function(t){var e=r.interface.events[t];h.defineReadOnly(r.filters,t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{address:r.address,topics:e.encodeTopics(t)}}))})),this._events=[],h.defineReadOnly(this,"address",t),this.provider)h.defineReadOnly(this,"addressPromise",this.provider.resolveName(t).then((function(t){if(null==t)throw new Error("name not found");return t})).catch((function(t){throw t})));else try{h.defineReadOnly(this,"addressPromise",Promise.resolve(d.getAddress(t)))}catch(e){c.throwError("provider is required to use non-address contract address",c.INVALID_ARGUMENT,{argument:"addressOrName",value:t})}Object.keys(this.interface.functions).forEach((function(t){var e=C(r,t,!1);null==r[t]?h.defineReadOnly(r,t,e):c.warn("WARNING: Multiple definitions for "+t),null==r.functions[t]&&(h.defineReadOnly(r.functions,t,e),h.defineReadOnly(r.estimate,t,C(r,t,!0)))}))}n.Contract=w;var B=(Q.prototype.getDeployTransaction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={};if(t.length===this.interface.deployFunction.inputs.length+1)for(var r in n=h.shallowCopy(t.pop()))if(!I[r])throw new Error("unknown transaction override "+r);return["data","from","to"].forEach((function(t){null!=n[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),c.checkArgumentCount(t.length,this.interface.deployFunction.inputs.length," in Contract constructor"),n.data=this.interface.deployFunction.encode(this.bytecode,t),n},Q.prototype.deploy=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.getDeployTransaction.apply(this,e);return this.signer.sendTransaction(r).then((function(e){var n=new w(d.getContractAddress(e),t.interface,t.signer);return h.defineReadOnly(n,"deployTransaction",e),n}))},Q.prototype.attach=function(t){return new w(t,this.interface,this.signer)},Q.prototype.connect=function(t){return new Q(this.interface,this.bytecode,t)},Q.fromSolidity=function(t,e){null==t&&c.throwError("missing compiler output",c.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var n=t.abi,r=null;return t.bytecode?r=t.bytecode:t.evm&&t.evm.bytecode&&(r=t.evm.bytecode),new Q(n,r,e)},Q);function Q(t,e,n){var r=null;"string"==typeof e?r=e:f.isArrayish(e)?r=f.hexlify(e):"string"==typeof e.object?r=e.object:c.throwError("bytecode must be a valid hex string",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),"0x"!==r.substring(0,2)&&(r="0x"+r),f.isHexString(r)||c.throwError("bytecode must be a valid hex string",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),r.length%2!=0&&c.throwError("bytecode must be valid data (even length)",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),h.defineReadOnly(this,"bytecode",r),l.Interface.isInterface(t)?h.defineReadOnly(this,"interface",t):h.defineReadOnly(this,"interface",new l.Interface(t)),n&&!g.Signer.isSigner(n)&&c.throwError("invalid signer",c.INVALID_ARGUMENT,{arg:"signer",value:null}),h.defineReadOnly(this,"signer",n||null)}n.ContractFactory=B},{"./abstract-signer":2,"./constants":3,"./errors":5,"./providers/abstract-provider":50,"./utils/abi-coder":59,"./utils/address":60,"./utils/bignumber":63,"./utils/bytes":64,"./utils/interface":69,"./utils/properties":74}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./_version");n.UNKNOWN_ERROR="UNKNOWN_ERROR",n.NOT_IMPLEMENTED="NOT_IMPLEMENTED",n.MISSING_NEW="MISSING_NEW",n.CALL_EXCEPTION="CALL_EXCEPTION",n.INVALID_ARGUMENT="INVALID_ARGUMENT",n.MISSING_ARGUMENT="MISSING_ARGUMENT",n.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",n.NUMERIC_FAULT="NUMERIC_FAULT",n.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",n.NONCE_EXPIRED="NONCE_EXPIRED",n.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED";var a=!(n.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION"),i=!1;function s(t,e,a){if(i)throw new Error("unknown error");e=e||n.UNKNOWN_ERROR,a=a||{};var s=[];Object.keys(a).forEach((function(t){try{s.push(t+"="+JSON.stringify(a[t]))}catch(e){s.push(t+"="+JSON.stringify(a[t].toString()))}})),s.push("version="+r.version);var o=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=o,u.code=e,Object.keys(a).forEach((function(t){u[t]=a[t]})),u}n.throwError=s,n.checkNew=function(t,e){t instanceof e||s("missing new",n.MISSING_NEW,{name:e.name})},n.checkArgumentCount=function(t,e,r){r=r||"",t<e&&s("missing argument"+r,n.MISSING_ARGUMENT,{count:t,expectedCount:e}),e<t&&s("too many arguments"+r,n.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})},n.setCensorship=function(t,e){a&&s("error censorship permanent",n.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i=!!t,a=!!e},n.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",n.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var o={debug:1,default:2,info:2,warn:3,error:4,off:5},u=o.default;function c(t,e){u>o[t]||console.log.apply(console,e)}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c("warn",t)}n.setLogLevel=function(t){var e=o[t];null!=e?u=e:A("invliad log level - "+t)},n.warn=A,n.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c("info",t)}},{"./_version":1}],6:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./contract");n.Contract=a.Contract,n.ContractFactory=a.ContractFactory,n.VoidSigner=a.VoidSigner;var i=t("./abstract-signer");n.Signer=i.Signer;var s=t("./wallet");n.Wallet=s.Wallet;var o=r(t("./constants"));n.constants=o;var u=r(t("./errors"));n.errors=u;var c=r(t("./providers"));n.providers=c;var A=r(t("./utils"));n.utils=A;var d=r(t("./wordlists"));n.wordlists=d;var p=t("./utils/shims");n.platform=p.platform;var f=t("./_version");n.version=f.version,n.getDefaultProvider=function(t){null==t&&(t="homestead");var e=A.getNetwork(t);return e&&e._defaultProvider||u.throwError("unsupported getDefaultProvider network",u.UNSUPPORTED_OPERATION,{operation:"getDefaultProvider",network:t}),e._defaultProvider(c)}},{"./_version":1,"./abstract-signer":2,"./constants":3,"./contract":4,"./errors":5,"./providers":54,"./utils":68,"./utils/shims":80,"./wallet":88,"./wordlists":89}],7:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("./ethers"));n.ethers=a,function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./ethers"))},{"./ethers":6}],8:[function(t,e,n){"use strict";!function(t){function r(t){return parseInt(t)===t}function a(t){if(r(t.length)){for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||255<t[e])return;return 1}}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!a(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&a(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function s(t){return new Uint8Array(t)}function o(t,e,n,r,a){null==r&&null==a||(t=t.slice?t.slice(r,a):Array.prototype.slice.call(t,r,a)),e.set(t,n)}var u,c={toBytes:function(t){var e=[],n=0;for(t=encodeURI(t);n<t.length;){var r=t.charCodeAt(n++);37===r?(e.push(parseInt(t.substr(n,2),16)),n+=2):e.push(r)}return i(e)},fromBytes:function(t){for(var e=[],n=0;n<t.length;){var r=t[n];r<128?(e.push(String.fromCharCode(r)),n++):191<r&&r<224?(e.push(String.fromCharCode((31&r)<<6|63&t[n+1])),n+=2):(e.push(String.fromCharCode((15&r)<<12|(63&t[n+1])<<6|63&t[n+2])),n+=3)}return e.join("")}},A=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},fromBytes:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(u[(240&r)>>4]+u[15&r])}return e.join("")}}),d={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],h=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],I=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],C=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],v=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],B=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Q=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(t){for(var e=[],n=0;n<t.length;n+=4)e.push(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);return e}var _=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};_.prototype._prepare=function(){var t=d[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var n,r=4*(t+1),a=this.key.length/4,i=M(this.key);for(e=0;e<a;e++)n=e>>2,this._Ke[n][e%4]=i[e],this._Kd[t-n][e%4]=i[e];for(var s,o=0,u=a;u<r;){if(s=i[a-1],i[0]^=f[s>>16&255]<<24^f[s>>8&255]<<16^f[255&s]<<8^f[s>>24&255]^p[o]<<24,o+=1,8!=a)for(e=1;e<a;e++)i[e]^=i[e-1];else{for(e=1;e<a/2;e++)i[e]^=i[e-1];for(s=i[a/2-1],i[a/2]^=f[255&s]^f[s>>8&255]<<8^f[s>>16&255]<<16^f[s>>24&255]<<24,e=a/2+1;e<a;e++)i[e]^=i[e-1]}for(e=0;e<a&&u<r;)c=u>>2,A=u%4,this._Ke[c][A]=i[e],this._Kd[t-c][A]=i[e++],u++}for(var c=1;c<t;c++)for(var A=0;A<4;A++)s=this._Kd[c][A],this._Kd[c][A]=w[s>>24&255]^E[s>>16&255]^B[s>>8&255]^Q[255&s]},_.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,n=[0,0,0,0],r=M(t),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var i=1;i<e;i++){for(a=0;a<4;a++)n[a]=h[r[a]>>24&255]^y[r[(a+1)%4]>>16&255]^g[r[(a+2)%4]>>8&255]^b[255&r[(a+3)%4]]^this._Ke[i][a];r=n.slice()}var o,u=s(16);for(a=0;a<4;a++)o=this._Ke[e][a],u[4*a]=255&(f[r[a]>>24&255]^o>>24),u[4*a+1]=255&(f[r[(a+1)%4]>>16&255]^o>>16),u[4*a+2]=255&(f[r[(a+2)%4]>>8&255]^o>>8),u[4*a+3]=255&(f[255&r[(a+3)%4]]^o);return u},_.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,n=[0,0,0,0],r=M(t),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var i=1;i<e;i++){for(a=0;a<4;a++)n[a]=m[r[a]>>24&255]^I[r[(a+3)%4]>>16&255]^C[r[(a+2)%4]>>8&255]^v[255&r[(a+1)%4]]^this._Kd[i][a];r=n.slice()}var o,u=s(16);for(a=0;a<4;a++)o=this._Kd[e][a],u[4*a]=255&(l[r[a]>>24&255]^o>>24),u[4*a+1]=255&(l[r[(a+3)%4]>>16&255]^o>>16),u[4*a+2]=255&(l[r[(a+2)%4]>>8&255]^o>>8),u[4*a+3]=255&(l[255&r[(a+1)%4]]^o);return u};var x=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new _(e)};x.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16)o(t,n,0,r,r+16),o(n=this._aes.encrypt(n),e,r);return e},x.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16)o(t,n,0,r,r+16),o(n=this._aes.decrypt(n),e,r);return e};var k=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=s(16);this._lastCipherblock=i(n,!0),this._aes=new _(e)};k.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16){o(t,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),o(this._lastCipherblock,e,r)}return e},k.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16){o(t,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)e[r+a]=n[a]^this._lastCipherblock[a];o(t,this._lastCipherblock,0,r,r+16)}return e};var S=function t(e,n,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 size)")}else n=s(16);r=r||1,this.segmentSize=r,this._shiftRegister=i(n,!0),this._aes=new _(e)};S.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,n=i(t,!0),r=0;r<n.length;r+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)n[r+a]^=e[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(n,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return n},S.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,n=i(t,!0),r=0;r<n.length;r+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)n[r+a]^=e[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(t,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return n};var D=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=s(16);this._lastPrecipher=i(n,!0),this._lastPrecipherIndex=16,this._aes=new _(e)};D.prototype.encrypt=function(t){for(var e=i(t,!0),n=0;n<e.length;n++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[n]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},D.prototype.decrypt=D.prototype.encrypt;var R=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=s(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;0<=e;--e)this._counter[e]=t%256,t>>=8},R.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var N=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof R||(n=new R(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new _(e)};N.prototype.encrypt=function(t){for(var e=i(t,!0),n=0;n<e.length;n++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[n]^=this._remainingCounter[this._remainingCounterIndex++];return e},N.prototype.decrypt=N.prototype.encrypt;var T={AES:_,Counter:R,ModeOfOperation:{ecb:x,cbc:k,cfb:S,ofb:D,ctr:N},utils:{hex:A,utf8:c},padding:{pkcs7:{pad:function(t){var e=16-(t=i(t,!0)).length%16,n=s(t.length+e);o(t,n);for(var r=t.length;r<n.length;r++)n[r]=e;return n},strip:function(t){if((t=i(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(16<e)throw new Error("PKCS#7 padding byte out of range");for(var n=t.length-e,r=0;r<e;r++)if(t[n+r]!==e)throw new Error("PKCS#7 invalid padding byte");var a=s(n);return o(t,a,0,0,n),a}}},_arrayTest:{coerceArray:i,createArray:s,copyArray:o}};void 0!==n?e.exports=T:(t.aesjs&&(T._aesjs=t.aesjs),t.aesjs=T)}(this)},{}],9:[function(t,e,n){!function(e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){function n(){}t.super_=e,n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==o(e)?e.exports=i:n.BN=i,(i.BN=i).wordSize=26;try{s=t("buffer").Buffer}catch(e){}function u(t,e,n){for(var r=0,a=Math.min(t.length,n),i=e;i<a;i++){var s=t.charCodeAt(i)-48;r<<=4,r|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return r}function c(t,e,n,r){for(var a=0,i=Math.min(t.length,n),s=e;s<i;s++){var o=t.charCodeAt(s)-48;a*=r,a+=49<=o?o-49+10:17<=o?o-17+10:o}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==o(t)&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return 0<t.cmp(e)?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==o(t))return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&2<=e&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a,i,s=0;s<this.length;s++)this.words[s]=0;var o=0;if("be"===n)for(s=t.length-1,a=0;0<=s;s-=3)i=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[a]|=i<<o&67108863,this.words[a+1]=i>>>26-o&67108863,26<=(o+=24)&&(o-=26,a++);else if("le"===n)for(a=s=0;s<t.length;s+=3)i=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[a]|=i<<o&67108863,this.words[a+1]=i>>>26-o&67108863,26<=(o+=24)&&(o-=26,a++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n,r=0;r<this.length;r++)this.words[r]=0;for(var a=0,i=(r=t.length-6,0);e<=r;r-=6)n=u(t,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==e&&(n=u(t,e,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},i.prototype._parseBase=function(t,e,n){this.words=[0];for(var r=0,a=this.length=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=t.length-n,s=i%r,o=Math.min(i,i-s)+n,u=0,A=n;A<o;A+=r)u=c(t,A,A+r,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!=s){var d=1;for(u=c(t,A,t.length,e),A=0;A<s;A++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],d=[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];function f(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0,a=(r=(n.length=r)-1|0,67108863&(d=(0|t.words[0])*(0|e.words[0]))),i=d/67108864|0;n.words[0]=a;for(var s=1;s<r;s++){for(var o=i>>>26,u=67108863&i,c=Math.min(s,e.length-1),A=Math.max(0,s-t.length+1);A<=c;A++){var d,p=s-A|0;o+=(d=(0|t.words[p])*(0|e.words[A])+u)/67108864|0,u=67108863&d}n.words[s]=0|u,i=0|o}return 0!==i?n.words[s]=0|i:n.length--,n.strip()}i.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){u="";for(var n=0,a=0,i=0;i<this.length;i++){var s=this.words[i],o=(16777215&(s<<n|a)).toString(16),u=0!=(a=s>>>24-n&16777215)||i!==this.length-1?A[6-o.length]+o+u:o+u;26<=(n+=2)&&(n-=26,i--)}for(0!==a&&(u=a.toString(16)+u);u.length%e!=0;)u="0"+u;return 0!==this.negative&&(u="-"+u),u}if(t===(0|t)&&2<=t&&t<=36){var c=d[t],f=p[t];for(u="",(l=this.clone()).negative=0;!l.isZero();){var l,h=l.modn(f).toString(t);u=(l=l.idivn(f)).isZero()?h+u:A[c-h.length]+h+u}for(this.isZero()&&(u="0"+u);u.length%e!=0;)u="0"+u;return 0!==this.negative&&(u="-"+u),u}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==s),this.toArrayLike(s,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(0<i,"Requested array length <= 0"),this.strip();var s,o,u="le"===e,c=new t(i),A=this.clone();if(u){for(o=0;!A.isZero();o++)s=A.andln(255),A.iushrn(8),c[o]=s;for(;o<i;o++)c[o]=0}else{for(o=0;o<i-a;o++)c[o]=0;for(o=0;!A.isZero();o++)s=A.andln(255),A.iushrn(8),c[i-o-1]=s}return c},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return 4096<=e&&(n+=13,e>>>=13),64<=e&&(n+=7,e>>>=7),8<=e&&(n+=4,e>>>=4),2<=e&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){for(var e=this.length>t.length?t:this,n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){for(var e,n=this.length>t.length?(e=this,t):(e=t,this),r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),0<n&&e--;for(var a=0;a<e;a++)this.words[a]=67108863&~this.words[a];return 0<n&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&0<=t);var n=t/26|0,a=t%26;return this._expand(1+n),this.words[n]=e?this.words[n]|1<<a:this.words[n]&~(1<<a),this.strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();r=this.length>t.length?(n=this,t):(n=t,this);for(var a=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<n.length;i++)e=(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;r=0<a?(n=this,t):(n=t,this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,n){var r,a,i,s=t.words,o=e.words,u=n.words,c=0|s[0],A=8191&c,d=c>>>13,p=0|s[1],f=8191&p,l=p>>>13,h=0|s[2],y=8191&h,g=h>>>13,b=0|s[3],m=8191&b,I=b>>>13,C=0|s[4],v=8191&C,w=C>>>13,E=0|s[5],B=8191&E,Q=E>>>13,M=0|s[6],_=8191&M,x=M>>>13,k=0|s[7],S=8191&k,D=k>>>13,R=0|s[8],N=8191&R,T=R>>>13,O=0|s[9],H=8191&O,L=O>>>13,U=0|o[0],j=8191&U,F=U>>>13,P=0|o[1],G=8191&P,q=P>>>13,Y=0|o[2],K=8191&Y,z=Y>>>13,J=0|o[3],V=8191&J,W=J>>>13,Z=0|o[4],X=8191&Z,$=Z>>>13,tt=0|o[5],et=8191&tt,nt=tt>>>13,rt=0|o[6],at=8191&rt,it=rt>>>13,st=0|o[7],ot=8191&st,ut=st>>>13,ct=0|o[8],At=8191&ct,dt=ct>>>13,pt=0|o[9],ft=8191&pt,lt=pt>>>13;n.negative=t.negative^e.negative,n.length=19;var ht=(0+Math.imul(A,j)|0)+((8191&(a=Math.imul(A,F)+Math.imul(d,j)|0))<<13)|0,yt=(Math.imul(d,F)+(a>>>13)|0)+(ht>>>26)|0;ht&=67108863,r=Math.imul(f,j),a=Math.imul(f,F)+Math.imul(l,j)|0,i=Math.imul(l,F);var gt=(yt+(r+Math.imul(A,G)|0)|0)+((8191&(a=(a+Math.imul(A,q)|0)+Math.imul(d,G)|0))<<13)|0;yt=((i+Math.imul(d,q)|0)+(a>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(y,j),a=Math.imul(y,F)+Math.imul(g,j)|0,i=Math.imul(g,F),r=r+Math.imul(f,G)|0,a=(a+Math.imul(f,q)|0)+Math.imul(l,G)|0,i=i+Math.imul(l,q)|0;var bt=(yt+(r+Math.imul(A,K)|0)|0)+((8191&(a=(a+Math.imul(A,z)|0)+Math.imul(d,K)|0))<<13)|0;yt=((i+Math.imul(d,z)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(m,j),a=Math.imul(m,F)+Math.imul(I,j)|0,i=Math.imul(I,F),r=r+Math.imul(y,G)|0,a=(a+Math.imul(y,q)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,q)|0,r=r+Math.imul(f,K)|0,a=(a+Math.imul(f,z)|0)+Math.imul(l,K)|0,i=i+Math.imul(l,z)|0;var mt=(yt+(r+Math.imul(A,V)|0)|0)+((8191&(a=(a+Math.imul(A,W)|0)+Math.imul(d,V)|0))<<13)|0;yt=((i+Math.imul(d,W)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(v,j),a=Math.imul(v,F)+Math.imul(w,j)|0,i=Math.imul(w,F),r=r+Math.imul(m,G)|0,a=(a+Math.imul(m,q)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,q)|0,r=r+Math.imul(y,K)|0,a=(a+Math.imul(y,z)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,z)|0,r=r+Math.imul(f,V)|0,a=(a+Math.imul(f,W)|0)+Math.imul(l,V)|0,i=i+Math.imul(l,W)|0;var It=(yt+(r+Math.imul(A,X)|0)|0)+((8191&(a=(a+Math.imul(A,$)|0)+Math.imul(d,X)|0))<<13)|0;yt=((i+Math.imul(d,$)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,j),a=Math.imul(B,F)+Math.imul(Q,j)|0,i=Math.imul(Q,F),r=r+Math.imul(v,G)|0,a=(a+Math.imul(v,q)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,q)|0,r=r+Math.imul(m,K)|0,a=(a+Math.imul(m,z)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,z)|0,r=r+Math.imul(y,V)|0,a=(a+Math.imul(y,W)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(f,X)|0,a=(a+Math.imul(f,$)|0)+Math.imul(l,X)|0,i=i+Math.imul(l,$)|0;var Ct=(yt+(r+Math.imul(A,et)|0)|0)+((8191&(a=(a+Math.imul(A,nt)|0)+Math.imul(d,et)|0))<<13)|0;yt=((i+Math.imul(d,nt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(_,j),a=Math.imul(_,F)+Math.imul(x,j)|0,i=Math.imul(x,F),r=r+Math.imul(B,G)|0,a=(a+Math.imul(B,q)|0)+Math.imul(Q,G)|0,i=i+Math.imul(Q,q)|0,r=r+Math.imul(v,K)|0,a=(a+Math.imul(v,z)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,z)|0,r=r+Math.imul(m,V)|0,a=(a+Math.imul(m,W)|0)+Math.imul(I,V)|0,i=i+Math.imul(I,W)|0,r=r+Math.imul(y,X)|0,a=(a+Math.imul(y,$)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(f,et)|0,a=(a+Math.imul(f,nt)|0)+Math.imul(l,et)|0,i=i+Math.imul(l,nt)|0;var vt=(yt+(r+Math.imul(A,at)|0)|0)+((8191&(a=(a+Math.imul(A,it)|0)+Math.imul(d,at)|0))<<13)|0;yt=((i+Math.imul(d,it)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(S,j),a=Math.imul(S,F)+Math.imul(D,j)|0,i=Math.imul(D,F),r=r+Math.imul(_,G)|0,a=(a+Math.imul(_,q)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,q)|0,r=r+Math.imul(B,K)|0,a=(a+Math.imul(B,z)|0)+Math.imul(Q,K)|0,i=i+Math.imul(Q,z)|0,r=r+Math.imul(v,V)|0,a=(a+Math.imul(v,W)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,a=(a+Math.imul(m,$)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(y,et)|0,a=(a+Math.imul(y,nt)|0)+Math.imul(g,et)|0,i=i+Math.imul(g,nt)|0,r=r+Math.imul(f,at)|0,a=(a+Math.imul(f,it)|0)+Math.imul(l,at)|0,i=i+Math.imul(l,it)|0;var wt=(yt+(r+Math.imul(A,ot)|0)|0)+((8191&(a=(a+Math.imul(A,ut)|0)+Math.imul(d,ot)|0))<<13)|0;yt=((i+Math.imul(d,ut)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(N,j),a=Math.imul(N,F)+Math.imul(T,j)|0,i=Math.imul(T,F),r=r+Math.imul(S,G)|0,a=(a+Math.imul(S,q)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,q)|0,r=r+Math.imul(_,K)|0,a=(a+Math.imul(_,z)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,z)|0,r=r+Math.imul(B,V)|0,a=(a+Math.imul(B,W)|0)+Math.imul(Q,V)|0,i=i+Math.imul(Q,W)|0,r=r+Math.imul(v,X)|0,a=(a+Math.imul(v,$)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,$)|0,r=r+Math.imul(m,et)|0,a=(a+Math.imul(m,nt)|0)+Math.imul(I,et)|0,i=i+Math.imul(I,nt)|0,r=r+Math.imul(y,at)|0,a=(a+Math.imul(y,it)|0)+Math.imul(g,at)|0,i=i+Math.imul(g,it)|0,r=r+Math.imul(f,ot)|0,a=(a+Math.imul(f,ut)|0)+Math.imul(l,ot)|0,i=i+Math.imul(l,ut)|0;var Et=(yt+(r+Math.imul(A,At)|0)|0)+((8191&(a=(a+Math.imul(A,dt)|0)+Math.imul(d,At)|0))<<13)|0;yt=((i+Math.imul(d,dt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(H,j),a=Math.imul(H,F)+Math.imul(L,j)|0,i=Math.imul(L,F),r=r+Math.imul(N,G)|0,a=(a+Math.imul(N,q)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,q)|0,r=r+Math.imul(S,K)|0,a=(a+Math.imul(S,z)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,z)|0,r=r+Math.imul(_,V)|0,a=(a+Math.imul(_,W)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,W)|0,r=r+Math.imul(B,X)|0,a=(a+Math.imul(B,$)|0)+Math.imul(Q,X)|0,i=i+Math.imul(Q,$)|0,r=r+Math.imul(v,et)|0,a=(a+Math.imul(v,nt)|0)+Math.imul(w,et)|0,i=i+Math.imul(w,nt)|0,r=r+Math.imul(m,at)|0,a=(a+Math.imul(m,it)|0)+Math.imul(I,at)|0,i=i+Math.imul(I,it)|0,r=r+Math.imul(y,ot)|0,a=(a+Math.imul(y,ut)|0)+Math.imul(g,ot)|0,i=i+Math.imul(g,ut)|0,r=r+Math.imul(f,At)|0,a=(a+Math.imul(f,dt)|0)+Math.imul(l,At)|0,i=i+Math.imul(l,dt)|0;var Bt=(yt+(r+Math.imul(A,ft)|0)|0)+((8191&(a=(a+Math.imul(A,lt)|0)+Math.imul(d,ft)|0))<<13)|0;yt=((i+Math.imul(d,lt)|0)+(a>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(H,G),a=Math.imul(H,q)+Math.imul(L,G)|0,i=Math.imul(L,q),r=r+Math.imul(N,K)|0,a=(a+Math.imul(N,z)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,z)|0,r=r+Math.imul(S,V)|0,a=(a+Math.imul(S,W)|0)+Math.imul(D,V)|0,i=i+Math.imul(D,W)|0,r=r+Math.imul(_,X)|0,a=(a+Math.imul(_,$)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(B,et)|0,a=(a+Math.imul(B,nt)|0)+Math.imul(Q,et)|0,i=i+Math.imul(Q,nt)|0,r=r+Math.imul(v,at)|0,a=(a+Math.imul(v,it)|0)+Math.imul(w,at)|0,i=i+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,a=(a+Math.imul(m,ut)|0)+Math.imul(I,ot)|0,i=i+Math.imul(I,ut)|0,r=r+Math.imul(y,At)|0,a=(a+Math.imul(y,dt)|0)+Math.imul(g,At)|0,i=i+Math.imul(g,dt)|0;var Qt=(yt+(r+Math.imul(f,ft)|0)|0)+((8191&(a=(a+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;yt=((i+Math.imul(l,lt)|0)+(a>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,r=Math.imul(H,K),a=Math.imul(H,z)+Math.imul(L,K)|0,i=Math.imul(L,z),r=r+Math.imul(N,V)|0,a=(a+Math.imul(N,W)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,W)|0,r=r+Math.imul(S,X)|0,a=(a+Math.imul(S,$)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(_,et)|0,a=(a+Math.imul(_,nt)|0)+Math.imul(x,et)|0,i=i+Math.imul(x,nt)|0,r=r+Math.imul(B,at)|0,a=(a+Math.imul(B,it)|0)+Math.imul(Q,at)|0,i=i+Math.imul(Q,it)|0,r=r+Math.imul(v,ot)|0,a=(a+Math.imul(v,ut)|0)+Math.imul(w,ot)|0,i=i+Math.imul(w,ut)|0,r=r+Math.imul(m,At)|0,a=(a+Math.imul(m,dt)|0)+Math.imul(I,At)|0,i=i+Math.imul(I,dt)|0;var Mt=(yt+(r+Math.imul(y,ft)|0)|0)+((8191&(a=(a+Math.imul(y,lt)|0)+Math.imul(g,ft)|0))<<13)|0;yt=((i+Math.imul(g,lt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(H,V),a=Math.imul(H,W)+Math.imul(L,V)|0,i=Math.imul(L,W),r=r+Math.imul(N,X)|0,a=(a+Math.imul(N,$)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,$)|0,r=r+Math.imul(S,et)|0,a=(a+Math.imul(S,nt)|0)+Math.imul(D,et)|0,i=i+Math.imul(D,nt)|0,r=r+Math.imul(_,at)|0,a=(a+Math.imul(_,it)|0)+Math.imul(x,at)|0,i=i+Math.imul(x,it)|0,r=r+Math.imul(B,ot)|0,a=(a+Math.imul(B,ut)|0)+Math.imul(Q,ot)|0,i=i+Math.imul(Q,ut)|0,r=r+Math.imul(v,At)|0,a=(a+Math.imul(v,dt)|0)+Math.imul(w,At)|0,i=i+Math.imul(w,dt)|0;var _t=(yt+(r+Math.imul(m,ft)|0)|0)+((8191&(a=(a+Math.imul(m,lt)|0)+Math.imul(I,ft)|0))<<13)|0;yt=((i+Math.imul(I,lt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(H,X),a=Math.imul(H,$)+Math.imul(L,X)|0,i=Math.imul(L,$),r=r+Math.imul(N,et)|0,a=(a+Math.imul(N,nt)|0)+Math.imul(T,et)|0,i=i+Math.imul(T,nt)|0,r=r+Math.imul(S,at)|0,a=(a+Math.imul(S,it)|0)+Math.imul(D,at)|0,i=i+Math.imul(D,it)|0,r=r+Math.imul(_,ot)|0,a=(a+Math.imul(_,ut)|0)+Math.imul(x,ot)|0,i=i+Math.imul(x,ut)|0,r=r+Math.imul(B,At)|0,a=(a+Math.imul(B,dt)|0)+Math.imul(Q,At)|0,i=i+Math.imul(Q,dt)|0;var xt=(yt+(r+Math.imul(v,ft)|0)|0)+((8191&(a=(a+Math.imul(v,lt)|0)+Math.imul(w,ft)|0))<<13)|0;yt=((i+Math.imul(w,lt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(H,et),a=Math.imul(H,nt)+Math.imul(L,et)|0,i=Math.imul(L,nt),r=r+Math.imul(N,at)|0,a=(a+Math.imul(N,it)|0)+Math.imul(T,at)|0,i=i+Math.imul(T,it)|0,r=r+Math.imul(S,ot)|0,a=(a+Math.imul(S,ut)|0)+Math.imul(D,ot)|0,i=i+Math.imul(D,ut)|0,r=r+Math.imul(_,At)|0,a=(a+Math.imul(_,dt)|0)+Math.imul(x,At)|0,i=i+Math.imul(x,dt)|0;var kt=(yt+(r+Math.imul(B,ft)|0)|0)+((8191&(a=(a+Math.imul(B,lt)|0)+Math.imul(Q,ft)|0))<<13)|0;yt=((i+Math.imul(Q,lt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(H,at),a=Math.imul(H,it)+Math.imul(L,at)|0,i=Math.imul(L,it),r=r+Math.imul(N,ot)|0,a=(a+Math.imul(N,ut)|0)+Math.imul(T,ot)|0,i=i+Math.imul(T,ut)|0,r=r+Math.imul(S,At)|0,a=(a+Math.imul(S,dt)|0)+Math.imul(D,At)|0,i=i+Math.imul(D,dt)|0;var St=(yt+(r+Math.imul(_,ft)|0)|0)+((8191&(a=(a+Math.imul(_,lt)|0)+Math.imul(x,ft)|0))<<13)|0;yt=((i+Math.imul(x,lt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(H,ot),a=Math.imul(H,ut)+Math.imul(L,ot)|0,i=Math.imul(L,ut),r=r+Math.imul(N,At)|0,a=(a+Math.imul(N,dt)|0)+Math.imul(T,At)|0,i=i+Math.imul(T,dt)|0;var Dt=(yt+(r+Math.imul(S,ft)|0)|0)+((8191&(a=(a+Math.imul(S,lt)|0)+Math.imul(D,ft)|0))<<13)|0;yt=((i+Math.imul(D,lt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(H,At),a=Math.imul(H,dt)+Math.imul(L,At)|0,i=Math.imul(L,dt);var Rt=(yt+(r+Math.imul(N,ft)|0)|0)+((8191&(a=(a+Math.imul(N,lt)|0)+Math.imul(T,ft)|0))<<13)|0;yt=((i+Math.imul(T,lt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(yt+Math.imul(H,ft)|0)+((8191&(a=Math.imul(H,lt)+Math.imul(L,ft)|0))<<13)|0;return yt=(Math.imul(L,lt)+(a>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=ht,u[1]=gt,u[2]=bt,u[3]=mt,u[4]=It,u[5]=Ct,u[6]=vt,u[7]=wt,u[8]=Et,u[9]=Bt,u[10]=Qt,u[11]=Mt,u[12]=_t,u[13]=xt,u[14]=kt,u[15]=St,u[16]=Dt,u[17]=Rt,u[18]=Nt,0!=yt&&(u[19]=yt,n.length++),n};function h(t,e,n){return(new y).mulp(t,e,n)}function y(t,e){this.x=t,this.y=e}Math.imul||(l=f),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return(10===this.length&&10===t.length?l:n<63?f:n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,a=0,i=0;i<n.length-1;i++){for(var s=a,o=(a=0,67108863&r),u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var A=i-c,d=(0|t.words[A])*(0|e.words[c]),p=67108863&d;o=67108863&(p=p+o|0),a+=(s=(s=s+(d/67108864|0)|0)+(p>>>26)|0)>>>26,s&=67108863}n.words[i]=o,r=s,s=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}:h)(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),n=i.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},y.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,a=0;a<e;a++)r|=(1&t)<<e-a-1,t>>=1;return r},y.prototype.permute=function(t,e,n,r,a,i){for(var s=0;s<i;s++)r[s]=e[t[s]],a[s]=n[t[s]]},y.prototype.transform=function(t,e,n,r,a,i){this.permute(i,t,e,n,r,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),A=0;A<a;A+=o)for(var d=u,p=c,f=0;f<s;f++){var l=n[A+f],h=r[A+f],y=d*(b=n[A+f+s])-p*(g=r[A+f+s]),g=d*g+p*b,b=y;n[A+f]=l+b,r[A+f]=h+g,n[A+f+s]=l-b,r[A+f+s]=h-g,f!==o&&(y=u*d-c*p,p=u*p+c*d,d=y)}},y.prototype.guessLen13b=function(t,e){for(var n=1&(a=1|Math.max(e,t)),r=0,a=a/2|0;a;a>>>=1)r++;return 1<<r+1+n},y.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var a=t[r];t[r]=t[n-r-1],t[n-r-1]=a,a=e[r],e[r]=-e[n-r-1],e[n-r-1]=-a}},y.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var a=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&a,n=a<67108864?0:a/67108864|0}return t},y.prototype.convert13b=function(t,e,n,a){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<a;++s)n[s]=0;r(0===i),r(0==(-8192&i))},y.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},y.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(r),i=this.stub(r),s=new Array(r),o=new Array(r),u=new Array(r),c=new Array(r),A=new Array(r),d=new Array(r),p=n.words;p.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,o,u,r,a),this.transform(c,i,A,d,r,a);for(var f=0;f<r;f++){var l=o[f]*A[f]-u[f]*d[f];u[f]=o[f]*d[f]+u[f]*A[f],o[f]=l}return this.conjugate(o,u,r),this.transform(o,u,p,i,r,a),this.conjugate(p,i,r),this.normalize13b(p,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),h(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var a=(0|this.words[n])*t,i=(67108863&a)+(67108863&e);e>>=26,e+=a/67108864|0,e+=i>>>26,this.words[n]=67108863&i}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,a=n%26;e[n]=(t.words[r]&1<<a)>>>a}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var a=n.sqr();r<e.length;r++,a=a.sqr())0!==e[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,a=67108863>>>26-e<<26-e;if(0!=e){for(var i=0,s=0;s<this.length;s++){var o=this.words[s]&a,u=(0|this.words[s])-o<<e;this.words[s]=u|i,i=o>>>26-e}i&&(this.words[s]=i,this.length++)}if(0!=n){for(s=this.length-1;0<=s;s--)this.words[s+n]=this.words[s];for(s=0;s<n;s++)this.words[s]=0;this.length+=n}return this.strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var a;r("number"==typeof t&&0<=t),a=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<<i,u=n;if(a-=s,a=Math.max(0,a),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0!==s)if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var A=0;for(c=this.length-1;0<=c&&(0!==A||a<=c);c--){var d=0|this.words[c];this.words[c]=A<<26-i|d>>>i,A=d&o}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,a=1<<e;return!(this.length<=n||!(this.words[n]&a))},i.prototype.imaskn=function(t){r("number"==typeof t&&0<=t);var e,n=t%26,a=(t-n)/26;return r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a?this:(0!=n&&a++,this.length=Math.min(a,this.length),0!=n&&(e=67108863^67108863>>>n<<n,this.words[this.length-1]&=e),this.strip())},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,--this.words[e+1];return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var a,i=t.length+n;this._expand(i);for(var s=0,o=0;o<t.length;o++){a=(0|this.words[o+n])+s;var u=(0|t.words[o])*e;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&a}for(;o<this.length-n;o++)s=(a=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),o=s=0;o<this.length;o++)s=(a=-(0|this.words[o])+s)>>26,this.words[o]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),a=t,s=0|a.words[a.length-1];0!=(n=26-this._countBits(s))&&(a=a.ushln(n),r.iushln(n),s=0|a.words[a.length-1]);var o,u=r.length-a.length;if("mod"!==e){(o=new i(null)).length=1+u,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var A=r.clone()._ishlnsubmul(a,1,u);0===A.negative&&(r=A,o&&(o.words[u]=1));for(var d=u-1;0<=d;d--){var p=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(p=Math.min(p/s|0,67108863),r._ishlnsubmul(a,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=p)}return o&&o.strip(),r.strip(),"div"!==e&&0!=n&&r.iushrn(n),{div:o||null,mod:r}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:a,mod:s}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(s=o.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:o.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,s,o},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),a=t.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,a=this.length-1;0<=a;a--)n=(e*n+(0|this.words[a]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;0<=n;n--){var a=(0|this.words[n])+67108864*e;this.words[n]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());for(var e=this,n=t.clone(),a=(e=0!==e.negative?e.umod(t):e.clone(),new i(1)),s=new i(0),o=new i(0),u=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var A=n.clone(),d=e.clone();!e.isZero();){for(var p=0,f=1;0==(e.words[0]&f)&&p<26;++p,f<<=1);if(0<p)for(e.iushrn(p);0<p--;)(a.isOdd()||s.isOdd())&&(a.iadd(A),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var l=0,h=1;0==(n.words[0]&h)&&l<26;++l,h<<=1);if(0<l)for(n.iushrn(l);0<l--;)(o.isOdd()||u.isOdd())&&(o.iadd(A),u.isub(d)),o.iushrn(1),u.iushrn(1);0<=e.cmp(n)?(e.isub(n),a.isub(o),s.isub(u)):(n.isub(e),o.isub(a),u.isub(s))}return{a:o,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());for(var e,n=this,a=t.clone(),s=(n=0!==n.negative?n.umod(t):n.clone(),new i(1)),o=new i(0),u=a.clone();0<n.cmpn(1)&&0<a.cmpn(1);){for(var c=0,A=1;0==(n.words[0]&A)&&c<26;++c,A<<=1);if(0<c)for(n.iushrn(c);0<c--;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,p=1;0==(a.words[0]&p)&&d<26;++d,p<<=1);if(0<d)for(a.iushrn(d);0<d--;)o.isOdd()&&o.iadd(u),o.iushrn(1);0<=n.cmp(a)?(n.isub(a),s.isub(o)):(a.isub(n),o.isub(s))}return(e=0===n.cmpn(1)?s:o).cmpn(0)<0&&e.iadd(t),e},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0;for(var r=n.negative=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var a=e.cmp(n);if(a<0){var i=e;e=n,n=i}else if(0===a||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,a=1<<e;if(this.length<=n)return this._expand(1+n),this.words[n]|=a,this;for(var i=a,s=n;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n,a=t<0;return 0===this.negative||a?0===this.negative&&a?1:(this.strip(),n=1<this.length?1:(a&&(t=-t),r(t<=67108863,"Number is too big"),(e=0|this.words[0])===t?0:e<t?-1:1),0!==this.negative?0|-n:n):-1},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;0<=n;n--){var r=0|this.words[n],a=0|t.words[n];if(r!=a){r<a?e=-1:a<r&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return 0<=this.cmpn(t)},i.prototype.gte=function(t){return 0<=this.cmp(t)},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function I(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){var e;"string"==typeof t?(e=i._prime(t),this.m=e.p,this.prime=e):(r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null)}function E(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){for(var e,n=t;this.split(n,this.tmp),(e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength())>this.n;);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):0<r?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},a(m,b),m.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,0===(t.words[r-10]=a)&&10<t.length?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},a(I,b),a(C,b),a(v,b),v.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,a=67108863&r;r>>>=26,t.words[n]=a,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new I;else if("p192"===t)e=new C;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return g[t]=e},w.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return 0<=n.cmp(this.m)&&n.isub(this.m),n._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return 0<=n.cmp(this.m)&&n.isub(this.m),n},w.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());for(var o=new i(1).toRed(this),u=o.redNeg(),c=this.m.subn(1).iushrn(1),A=new i(2*(A=this.m.bitLength())*A).toRed(this);0!==this.pow(A,c).cmp(u);)A.redIAdd(u);for(var d=this.pow(A,a),p=this.pow(t,a.addn(1).iushrn(1)),f=this.pow(t,a),l=s;0!==f.cmp(o);){for(var h=f,y=0;0!==h.cmp(o);y++)h=h.redSqr();r(y<l);var g=this.pow(d,new i(1).iushln(l-y-1));p=p.redMul(g),d=g.redSqr(),f=f.redMul(d),l=y}return p},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var a=n[0],s=0,o=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;0<=r;r--){for(var c=e.words[r],A=u-1;0<=A;A--){var d=c>>A&1;a!==n[0]&&(a=this.sqr(a)),0!=d||0!==s?(s<<=1,s|=d,(4==++o||0===r&&0===A)&&(a=this.mul(a,n[s]),s=o=0)):o=0}u=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},a(E,w),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return 0<=a.cmp(this.m)?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),s=a;return 0<=a.cmp(this.m)?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,e,r){(function(t){e.exports=function(e){var n=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(n),n}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,n){},{}],12:[function(t,e,n){"use strict";var r=n;r.version=t("../package.json").version,r.utils=t("./elliptic/utils"),r.rand=t("brorand"),r.curve=t("./elliptic/curve"),r.curves=t("./elliptic/curves"),r.ec=t("./elliptic/ec"),r.eddsa=t("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils"),i=a.getNAF,s=a.getJSF,o=a.assert;function u(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||0<n.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=u).prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){o(t.precomputed);var n=t._getDoubles(),r=i(e,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;for(var s=[],u=0;u<r.length;u+=n.step){var c=0;for(e=u+n.step-1;u<=e;e--)c=(c<<1)+r[e];s.push(c)}for(var A=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=a;0<p;p--){for(u=0;u<s.length;u++)(c=s[u])===p?d=d.mixedAdd(n.points[u]):c===-p&&(d=d.mixedAdd(n.points[u].neg()));A=A.add(d)}return A.toP()},u.prototype._wnafMul=function(t,e){for(var n=t._getNAFPoints(4),r=n.wnd,a=n.points,s=i(e,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;0<=c;c--){for(e=0;0<=c&&0===s[c];c--)e++;if(0<=c&&e++,u=u.dblp(e),c<0)break;var A=s[c];o(0!==A),u="affine"===t.type?0<A?u.mixedAdd(a[A-1>>1]):u.mixedAdd(a[-A-1>>1].neg()):0<A?u.add(a[A-1>>1]):u.add(a[-A-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,n,r,a){for(var o=this._wnafT1,u=this._wnafT2,c=this._wnafT3,A=0,d=0;d<r;d++){var p=(B=e[d])._getNAFPoints(t);o[d]=p.wnd,u[d]=p.points}for(d=r-1;1<=d;d-=2){var f=d-1,l=d;if(1===o[f]&&1===o[l]){var h=[e[f],null,null,e[l]];0===e[f].y.cmp(e[l].y)?(h[1]=e[f].add(e[l]),h[2]=e[f].toJ().mixedAdd(e[l].neg())):0===e[f].y.cmp(e[l].y.redNeg())?(h[1]=e[f].toJ().mixedAdd(e[l]),h[2]=e[f].add(e[l].neg())):(h[1]=e[f].toJ().mixedAdd(e[l]),h[2]=e[f].toJ().mixedAdd(e[l].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=s(n[f],n[l]);A=Math.max(g[0].length,A),c[f]=new Array(A),c[l]=new Array(A);for(var b=0;b<A;b++){var m=0|g[0][b],I=0|g[1][b];c[f][b]=y[3*(1+m)+(1+I)],c[l][b]=0,u[f]=h}}else c[f]=i(n[f],o[f],this._bitLength),c[l]=i(n[l],o[l],this._bitLength),A=Math.max(c[f].length,A),A=Math.max(c[l].length,A)}var C=this.jpoint(null,null,null),v=this._wnafT4;for(d=A;0<=d;d--){for(var w=0;0<=d;){var E=!0;for(b=0;b<r;b++)v[b]=0|c[b][d],0!==v[b]&&(E=!1);if(!E)break;w++,d--}if(0<=d&&w++,C=C.dblp(w),d<0)break;for(b=0;b<r;b++){var B,Q=v[b];0!==Q&&(0<Q?B=u[b][Q-1>>1]:Q<0&&(B=u[b][-Q-1>>1].neg()),C="affine"===B.type?C.mixedAdd(B):C.add(B))}}for(d=0;d<r;d++)u[d]=null;return a?C:C.toP()},(u.BasePoint=c).prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=a.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?o(t[t.length-1]%2==0):7===t[0]&&o(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return a.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a<e;a+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1==n?null:this.dbl(),a=1;a<n;a++)e[a]=e[a-1].add(r);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},{"../utils":24,"bn.js":9}],14:[function(t,e,n){e.exports={}},{}],15:[function(t,e,n){"use strict";var r=n;r.base=t("./base"),r.short=t("./short"),r.mont=t("./mont"),r.edwards=t("./edwards")},{"./base":13,"./edwards":14,"./mont":16,"./short":17}],16:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],17:[function(t,e,n){"use strict";var r=t("../utils"),a=t("bn.js"),i=t("inherits"),s=t("./base"),o=r.assert;function u(t){s.call(this,"short",t),this.a=new a(t.a,16).toRed(this.red),this.b=new a(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,n,r){s.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(e,16),this.y=new a(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function A(t,e,n,r){s.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(e,16),this.y=new a(n,16),this.z=new a(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(u,s),(e.exports=u).prototype._getEndomorphism=function(t){var e,n,r,i;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=t.beta?new a(t.beta,16).toRed(this.red):(r=(n=this._getEndoRoots(this.p))[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red),t.lambda?e=new a(t.lambda,16):(i=this._getEndoRoots(this.n),0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?e=i[0]:(e=i[1],o(0===this.g.mul(e).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:e,basis:t.basis?t.basis.map((function(t){return{a:new a(t.a,16),b:new a(t.b,16)}})):this._getEndoBasis(e)}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:a.mont(t),n=new a(2).toRed(e).redInvm(),r=n.redNeg(),i=new a(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,n,r,i,s,o,u,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),A=t,d=this.n.clone(),p=new a(1),f=new a(0),l=new a(0),h=new a(1),y=0;0!==A.cmpn(0);){var g=d.div(A),b=d.sub(g.mul(A)),m=l.sub(g.mul(p)),I=h.sub(g.mul(f));if(!r&&b.cmp(c)<0)e=u.neg(),n=p,r=b.neg(),i=m;else if(r&&2==++y)break;d=A,A=u=b,l=p,p=m,h=f,f=I}s=b.neg(),o=m;var C=r.sqr().add(i.sqr());return 0<=s.sqr().add(o.sqr()).cmp(C)&&(s=e,o=n),r.negative&&(r=r.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:r,b:i},{a:s,b:o}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],a=r.b.mul(t).divRound(this.n),i=n.b.neg().mul(t).divRound(this.n),s=a.mul(n.a),o=i.mul(r.a),u=a.mul(n.b),c=i.mul(r.b);return{k1:t.sub(s).sub(o),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new a(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),a=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(a).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,a=this._endoWnafT2,i=0;i<t.length;i++){var s=this._endoSplit(e[i]),o=t[i],u=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),r[2*i]=o,r[2*i+1]=u,a[2*i]=s.k1,a[2*i+1]=s.k2}for(var c=this._wnafMulAdd(1,r,a,2*i,n),A=0;A<2*i;A++)r[A]=null,a[A]=null;return c},i(c,s.BasePoint),u.prototype.point=function(t,e,n){return new c(this,t,e,n)},u.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e,n,r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);return t&&(e=this.curve,n=function(t){return e.point(t.x.redMul(e.endo.beta),t.y)},(t.beta=r).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}),r}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],n);if(!e[2])return r;function a(e){return t.point(e[0],e[1],n)}var i=e[2];return r.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[r].concat(i.doubles.points.map(a))},naf:i.naf&&{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(a))}},r},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),i=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new a(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,n){var r=[this,e],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a):this.curve._wnafMulAdd(1,r,a,2)},c.prototype.jmulAdd=function(t,e,n){var r=[this,e],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a,!0):this.curve._wnafMulAdd(1,r,a,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e,n,r=this.curve.point(this.x,this.y.redNeg());return t&&this.precomputed&&(e=this.precomputed,n=function(t){return t.neg()},r.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}),r},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(A,s.BasePoint),u.prototype.jpoint=function(t,e,n){return new A(this,t,e,n)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),a=t.x.redMul(n),i=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),o=r.redSub(a),u=i.redSub(s);if(0===o.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),A=c.redMul(o),d=r.redMul(c),p=u.redSqr().redIAdd(A).redISub(d).redISub(d),f=u.redMul(d.redISub(p)).redISub(i.redMul(A)),l=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(p,f,l)},A.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),a=this.y,i=t.y.redMul(e).redMul(this.z),s=n.redSub(r),o=a.redSub(i);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),A=n.redMul(u),d=o.redSqr().redIAdd(c).redISub(A).redISub(A),p=o.redMul(A.redISub(d)).redISub(a.redMul(c)),f=this.z.redMul(s);return this.curve.jpoint(d,p,f)},A.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}var r=this.curve.a,a=this.curve.tinv,i=this.x,s=this.y,o=this.z,u=o.redSqr().redSqr(),c=s.redAdd(s);for(n=0;n<t;n++){var A=i.redSqr(),d=c.redSqr(),p=d.redSqr(),f=A.redAdd(A).redIAdd(A).redIAdd(r.redMul(u)),l=i.redMul(d),h=f.redSqr().redISub(l.redAdd(l)),y=l.redISub(h),g=(g=f.redMul(y)).redIAdd(g).redISub(p),b=c.redMul(o);n+1<t&&(u=u.redMul(p)),i=h,o=b,c=g}return this.curve.jpoint(i,c.redMul(a),o)},A.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},A.prototype._zeroDbl=function(){var t,e,n,r,a,i,s,o,u,c,A,d,p,f,l,h,y=this.zOne?(n=this.x.redSqr(),a=(r=this.y.redSqr()).redSqr(),i=(i=this.x.redAdd(r).redSqr().redISub(n).redISub(a)).redIAdd(i),o=(s=n.redAdd(n).redIAdd(n)).redSqr().redISub(i).redISub(i),u=(u=(u=a.redIAdd(a)).redIAdd(u)).redIAdd(u),t=o,e=s.redMul(i.redISub(o)).redISub(u),this.y.redAdd(this.y)):(c=this.x.redSqr(),d=(A=this.y.redSqr()).redSqr(),p=(p=this.x.redAdd(A).redSqr().redISub(c).redISub(d)).redIAdd(p),l=(f=c.redAdd(c).redIAdd(c)).redSqr(),h=(h=(h=d.redIAdd(d)).redIAdd(h)).redIAdd(h),t=l.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(h),(y=this.y.redMul(this.z)).redIAdd(y));return this.curve.jpoint(t,e,y)},A.prototype._threeDbl=function(){var t,e,n,r,a,i,s,o,u,c,A,d,p,f,l,h,y;return this.zOne?(n=this.x.redSqr(),a=(r=this.y.redSqr()).redSqr(),i=(i=this.x.redAdd(r).redSqr().redISub(n).redISub(a)).redIAdd(i),u=o=(s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a)).redSqr().redISub(i).redISub(i),c=(c=(c=a.redIAdd(a)).redIAdd(c)).redIAdd(c),t=s.redMul(i.redISub(o)).redISub(c),e=this.y.redAdd(this.y)):(A=this.z.redSqr(),d=this.y.redSqr(),p=this.x.redMul(d),f=(f=this.x.redSub(A).redMul(this.x.redAdd(A))).redAdd(f).redIAdd(f),h=(l=(l=p.redIAdd(p)).redIAdd(l)).redAdd(l),u=f.redSqr().redISub(h),e=this.y.redAdd(this.z).redSqr().redISub(d).redISub(A),y=(y=(y=(y=d.redSqr()).redIAdd(y)).redIAdd(y)).redIAdd(y),t=f.redMul(l.redISub(u)).redISub(y)),this.curve.jpoint(u,t,e)},A.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,a=r.redSqr().redSqr(),i=e.redSqr(),s=n.redSqr(),o=i.redAdd(i).redIAdd(i).redIAdd(t.redMul(a)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),A=o.redSqr().redISub(c.redAdd(c)),d=c.redISub(A),p=s.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=o.redMul(d).redISub(p),l=n.redAdd(n).redMul(r);return this.curve.jpoint(A,f,l)},A.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),a=t.redAdd(t).redIAdd(t),i=a.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(r),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=a.redIAdd(s).redSqr().redISub(i).redISub(o).redISub(u),A=e.redMul(c);A=(A=A.redIAdd(A)).redIAdd(A);var d=this.x.redMul(o).redISub(A);d=(d=d.redIAdd(d)).redIAdd(d);var p=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(o)));p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=this.z.redAdd(s).redSqr().redISub(n).redISub(o);return this.curve.jpoint(d,p,f)},A.prototype.mul=function(t,e){return t=new a(t,e),this.curve._wnafMul(this,t)},A.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),a=n.redMul(t.z);return 0===this.y.redMul(a).redISub(t.y.redMul(r)).cmpn(0)},A.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),a=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(n.redIAdd(a),0===this.x.cmp(n))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(t,e,n){"use strict";var r,a=n,i=t("hash.js"),s=t("./curve"),o=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:function(){var n=new u(e);return Object.defineProperty(a,t,{configurable:!0,enumerable:!0,value:n}),n}})}a.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=t("./precomputed/secp256k1")}catch(t){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("hmac-drbg"),i=t("../utils"),s=t("../curves"),u=t("brorand"),c=i.assert,A=t("./key"),d=t("./signature");function p(t){if(!(this instanceof p))return new p(t);"string"==typeof t&&(c(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=p).prototype.keyPair=function(t){return new A(this,t)},p.prototype.keyFromPrivate=function(t,e){return A.fromPrivate(this,t,e)},p.prototype.keyFromPublic=function(t,e){return A.fromPublic(this,t,e)},p.prototype.genKeyPair=function(t){t=t||{};for(var e=new a({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||u(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new r(2));;){var s=new r(e.generate(n));if(!(0<s.cmp(i)))return s.iaddn(1),this.keyFromPrivate(s)}},p.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return 0<n&&(t=t.ushrn(n)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},p.prototype.sign=function(t,e,n,i){"object"==o(n)&&(i=n,n=null),i=i||{},e=this.keyFromPrivate(e,n),t=this._truncateToN(new r(t,16));for(var s=this.n.byteLength(),u=e.getPrivate().toArray("be",s),c=t.toArray("be",s),A=new a({hash:this.hash,entropy:u,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new r(1)),f=0;;f++){var l=i.k?i.k(f):new r(A.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||0<=l.cmp(p))){var h=this.g.mul(l);if(!h.isInfinity()){var y=h.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var b=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return i.canonical&&0<b.cmp(this.nh)&&(b=this.n.sub(b),m^=1),new d({r:g,s:b,recoveryParam:m})}}}}}},p.prototype.verify=function(t,e,n,a){t=this._truncateToN(new r(t,16)),n=this.keyFromPublic(n,a);var i=(e=new d(e,"hex")).r,s=e.s;if(i.cmpn(1)<0||0<=i.cmp(this.n))return!1;if(s.cmpn(1)<0||0<=s.cmp(this.n))return!1;var o,u=s.invm(this.n),c=u.mul(t).umod(this.n),A=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(c,n.getPublic(),A)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(c,n.getPublic(),A)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},p.prototype.recoverPubKey=function(t,e,n,a){c((3&n)===n,"The recovery param is more than two bits"),e=new d(e,a);var i=this.n,s=new r(t),o=e.r,u=e.s,A=1&n,p=n>>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&p)throw new Error("Unable to find sencond key candinate");o=p?this.curve.pointFromX(o.add(this.curve.n),A):this.curve.pointFromX(o,A);var f=e.r.invm(i),l=i.sub(s).mul(f).umod(i),h=u.mul(f).umod(i);return this.g.mulAdd(l,o,h)},p.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new d(e,r)).recoveryParam)return e.recoveryParam;for(var a,i=0;i<4;i++){try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils").assert;function i(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=i).fromPublic=function(t,e,n){return e instanceof i?e:new i(t,{pub:e,pubEnc:n})},i.fromPrivate=function(t,e,n){return e instanceof i?e:new i(t,{priv:e,privEnc:n})},i.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},i.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},i.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(t,e){this.priv=new r(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?a(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},i.prototype.derive=function(t){return t.mul(this.priv).getX()},i.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},i.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":24,"bn.js":9}],21:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils"),i=a.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(i(t.r&&t.s,"Signature without r or s"),this.r=new r(t.r,16),this.s=new r(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function o(){this.place=0}function u(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0==r||4<r)return!1;for(var a=0,i=0,s=e.place;i<r;i++,s++)a<<=8,a|=t[s],a>>>=0;return!(a<=127)&&(e.place=s,a)}function c(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function A(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=a.toArray(t,e);var n=new o;if(48!==t[n.place++])return!1;var i=u(t,n);if(!1===i)return!1;if(i+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var s=u(t,n);if(!1===s)return!1;var c=t.slice(n.place,s+n.place);if(n.place+=s,2!==t[n.place++])return!1;var A=u(t,n);if(!1===A)return!1;if(t.length!==A+n.place)return!1;var d=t.slice(n.place,A+n.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new r(c),this.s=new r(d),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=c(e),n=c(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];A(r,e.length),(r=r.concat(e)).push(2),A(r,n.length);var i=r.concat(n),s=[48];return A(s,i.length),s=s.concat(i),a.encode(s,t)}},{"../utils":24,"bn.js":9}],22:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],23:[function(t,e,n){e.exports=void 0},{}],24:[function(t,e,n){"use strict";var r=n,a=t("bn.js"),i=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");r.assert=i,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var a=1<<e+1,i=t.clone(),s=0;s<r.length;s++){var o,u=i.andln(a-1);i.isOdd()?(o=(a>>1)-1<u?(a>>1)-u:u,i.isubn(o)):o=0,r[s]=o,i.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r=0,a=0;0<t.cmpn(-r)||0<e.cmpn(-a);){var i,s,o,u=t.andln(3)+r&3,c=e.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),i=0==(1&u)?0:3!=(s=t.andln(7)+r&7)&&5!==s||2!==c?u:-u,n[0].push(i),o=0==(1&c)?0:3!=(s=e.andln(7)+a&7)&&5!==s||2!==u?c:-c,n[1].push(o),2*r===i+1&&(r=1-r),2*a===o+1&&(a=1-a),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new a(t,"hex","le")}},{"bn.js":9,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],25:[function(t,e,n){e.exports={version:"6.5.3"}},{}],26:[function(t,e,n){var r=n;r.utils=t("./hash/utils"),r.common=t("./hash/common"),r.sha=t("./hash/sha"),r.ripemd=t("./hash/ripemd"),r.hmac=t("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":27,"./hash/hmac":28,"./hash/ripemd":29,"./hash/sha":30,"./hash/utils":37}],27:[function(t,e,n){"use strict";var r=t("./utils"),a=t("minimalistic-assert");function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(n.BlockHash=i).prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=t>>>24&255,r[a++]=t>>>16&255,r[a++]=t>>>8&255,r[a++]=255&t}else for(r[a++]=255&t,r[a++]=t>>>8&255,r[a++]=t>>>16&255,r[a++]=t>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r}},{"./utils":37,"minimalistic-assert":41}],28:[function(t,e,n){"use strict";var r=t("./utils"),a=t("minimalistic-assert");function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,n))}(e.exports=i).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),a(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":37,"minimalistic-assert":41}],29:[function(t,e,n){"use strict";var r=t("./utils"),a=t("./common"),i=r.rotl32,s=r.sum32,o=r.sum32_3,u=r.sum32_4,c=a.BlockHash;function A(){if(!(this instanceof A))return new A;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}r.inherits(A,c),(n.ripemd160=A).blockSize=512,A.outSize=160,A.hmacStrength=192,A.padLength=64,A.prototype._update=function(t,e){for(var n,r,a=I=this.h[0],c=E=this.h[1],A=w=this.h[2],y=v=this.h[3],g=C=this.h[4],b=0;b<80;b++){var m=s(i(u(I,d(b,E,w,v),t[p[b]+e],(r=b)<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838),l[b]),C),I=C,C=v,v=i(w,10),w=E,E=m;m=s(i(u(a,d(79-b,c,A,y),t[f[b]+e],(n=b)<=15?1352829926:n<=31?1548603684:n<=47?1836072691:n<=63?2053994217:0),h[b]),g),a=g,g=y,y=i(A,10),A=c,c=m}m=o(this.h[1],w,y),this.h[1]=o(this.h[2],v,g),this.h[2]=o(this.h[3],C,a),this.h[3]=o(this.h[4],I,c),this.h[4]=o(this.h[0],E,A),this.h[0]=m},A.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.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],f=[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],l=[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],h=[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]},{"./common":27,"./utils":37}],30:[function(t,e,n){"use strict";n.sha1=t("./sha/1"),n.sha224=t("./sha/224"),n.sha256=t("./sha/256"),n.sha384=t("./sha/384"),n.sha512=t("./sha/512")},{"./sha/1":31,"./sha/224":32,"./sha/256":33,"./sha/384":34,"./sha/512":35}],31:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],32:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],33:[function(t,e,n){"use strict";var r=t("../utils"),a=t("../common"),i=t("./common"),s=t("minimalistic-assert"),o=r.sum32,u=r.sum32_4,c=r.sum32_5,A=i.ch32,d=i.maj32,p=i.s0_256,f=i.s1_256,l=i.g0_256,h=i.g1_256,y=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}r.inherits(b,y),(e.exports=b).blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=u(h(n[r-2]),n[r-7],l(n[r-15]),n[r-16]);var a=this.h[0],i=this.h[1],y=this.h[2],g=this.h[3],b=this.h[4],m=this.h[5],I=this.h[6],C=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var v=c(C,f(b),A(b,m,I),this.k[r],n[r]),w=o(p(a),d(a,i,y));C=I,I=m,m=b,b=o(g,v),g=y,y=i,i=a,a=o(v,w)}this.h[0]=o(this.h[0],a),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],y),this.h[3]=o(this.h[3],g),this.h[4]=o(this.h[4],b),this.h[5]=o(this.h[5],m),this.h[6]=o(this.h[6],I),this.h[7]=o(this.h[7],C)},b.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},{"../common":27,"../utils":37,"./common":36,"minimalistic-assert":41}],34:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],35:[function(t,e,n){"use strict";var r=t("../utils"),a=t("../common"),i=t("minimalistic-assert"),s=r.rotr64_hi,o=r.rotr64_lo,u=r.shr64_hi,c=r.shr64_lo,A=r.sum64,d=r.sum64_hi,p=r.sum64_lo,f=r.sum64_4_hi,l=r.sum64_4_lo,h=r.sum64_5_hi,y=r.sum64_5_lo,g=a.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}r.inherits(m,g),(e.exports=m).blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var a=function(t,e){var n=s(t,e,19)^s(e,t,29)^u(t,e,6);return n<0&&(n+=4294967296),n}(n[r-4],n[r-3]),i=function(t,e){var n=o(t,e,19)^o(e,t,29)^c(t,e,6);return n<0&&(n+=4294967296),n}(n[r-4],n[r-3]),A=n[r-14],d=n[r-13],p=function(t,e){var n=s(t,e,1)^s(t,e,8)^u(t,e,7);return n<0&&(n+=4294967296),n}(n[r-30],n[r-29]),h=function(t,e){var n=o(t,e,1)^o(t,e,8)^c(t,e,7);return n<0&&(n+=4294967296),n}(n[r-30],n[r-29]),y=n[r-32],g=n[r-31];n[r]=f(a,i,A,d,p,h,y,g),n[r+1]=l(a,i,A,d,p,h,y,g)}},m.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],a=this.h[1],u=this.h[2],c=this.h[3],f=this.h[4],l=this.h[5],g=this.h[6],b=this.h[7],m=this.h[8],I=this.h[9],C=this.h[10],v=this.h[11],w=this.h[12],E=this.h[13],B=this.h[14],Q=this.h[15];i(this.k.length===n.length);for(var M=0;M<n.length;M+=2){var _=B,x=Q,k=function(t,e){var n=s(t,e,14)^s(t,e,18)^s(e,t,9);return n<0&&(n+=4294967296),n}(m,I),S=function(t,e){var n=o(t,e,14)^o(t,e,18)^o(e,t,9);return n<0&&(n+=4294967296),n}(m,I),D=function(t,e,n){var r=t&e^~t&n;return r<0&&(r+=4294967296),r}(m,C,w),R=function(t,e,n){var r=t&e^~t&n;return r<0&&(r+=4294967296),r}(I,v,E),N=this.k[M],T=this.k[M+1],O=n[M],H=n[M+1],L=h(_,x,k,S,D,R,N,T,O,H),U=y(_,x,k,S,D,R,N,T,O,H),j=(_=function(t,e){var n=s(t,e,28)^s(e,t,2)^s(e,t,7);return n<0&&(n+=4294967296),n}(r,a),x=function(t,e){var n=o(t,e,28)^o(e,t,2)^o(e,t,7);return n<0&&(n+=4294967296),n}(r,a),k=function(t,e,n){var r=t&e^t&n^e&n;return r<0&&(r+=4294967296),r}(r,u,f),S=function(t,e,n){var r=t&e^t&n^e&n;return r<0&&(r+=4294967296),r}(a,c,l),d(_,x,k,S)),F=p(_,x,k,S);B=w,Q=E,w=C,E=v,C=m,v=I,m=d(g,b,L,U),I=p(b,b,L,U),g=f,b=l,f=u,l=c,u=r,c=a,r=d(L,U,j,F),a=p(L,U,j,F)}A(this.h,0,r,a),A(this.h,2,u,c),A(this.h,4,f,l),A(this.h,6,g,b),A(this.h,8,m,I),A(this.h,10,C,v),A(this.h,12,w,E),A(this.h,14,B,Q)},m.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},{"../common":27,"../utils":37,"minimalistic-assert":41}],36:[function(t,e,n){"use strict";var r=t("../utils").rotr32;function a(t,e,n){return t&e^~t&n}function i(t,e,n){return t&e^t&n^e&n}n.ft_1=function(t,e,n,r){return 0===t?a(e,n,r):1===t||3===t?e^n^r:2===t?i(e,n,r):void 0},n.ch32=a,n.maj32=i,n.p32=function(t,e,n){return t^e^n},n.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},n.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},n.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},n.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},{"../utils":37}],37:[function(t,e,n){"use strict";var r=t("minimalistic-assert"),a=t("inherits");function i(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function o(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}n.inherits=a,n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(var r=0;r<t.length;r++){var a=t.charCodeAt(r),i=a>>8,s=255&a;i?n.push(i,s):n.push(s)}else for(r=0;r<t.length;r++)n[r]=0|t[r];return n},n.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=s(t[n].toString(16));return e},n.htonl=i,n.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var a=t[r];"little"===e&&(a=i(a)),n+=o(a.toString(16))}return n},n.zero2=s,n.zero8=o,n.join32=function(t,e,n,a){var i=n-e;r(i%4==0);for(var s=new Array(i/4),o=0,u=e;o<s.length;o++,u+=4){var c="big"===a?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u];s[o]=c>>>0}return s},n.split32=function(t,e){for(var n=new Array(4*t.length),r=0,a=0;r<t.length;r++,a+=4){var i=t[r];"big"===e?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},n.rotr32=function(t,e){return t>>>e|t<<32-e},n.rotl32=function(t,e){return t<<e|t>>>32-e},n.sum32=function(t,e){return t+e>>>0},n.sum32_3=function(t,e,n){return t+e+n>>>0},n.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},n.sum32_5=function(t,e,n,r,a){return t+e+n+r+a>>>0},n.sum64=function(t,e,n,r){var a=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+a;t[e]=s>>>0,t[e+1]=i},n.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},n.sum64_lo=function(t,e,n,r){return e+r>>>0},n.sum64_4_hi=function(t,e,n,r,a,i,s,o){var u=0,c=e;return u+=(c=c+r>>>0)<e?1:0,u+=(c=c+i>>>0)<i?1:0,t+n+a+s+(u+=(c=c+o>>>0)<o?1:0)>>>0},n.sum64_4_lo=function(t,e,n,r,a,i,s,o){return e+r+i+o>>>0},n.sum64_5_hi=function(t,e,n,r,a,i,s,o,u,c){var A=0,d=e;return A+=(d=d+r>>>0)<e?1:0,A+=(d=d+i>>>0)<i?1:0,A+=(d=d+o>>>0)<o?1:0,t+n+a+s+u+(A+=(d=d+c>>>0)<c?1:0)>>>0},n.sum64_5_lo=function(t,e,n,r,a,i,s,o,u,c){return e+r+i+o+c>>>0},n.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},n.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},n.shr64_hi=function(t,e,n){return t>>>n},n.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(t,e,n){"use strict";var r=t("hash.js"),a=t("minimalistic-crypto-utils"),i=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=a.toArray(t.entropy,t.entropyEnc||"hex"),n=a.toArray(t.nonce,t.nonceEnc||"hex"),r=a.toArray(t.pers,t.persEnc||"hex");i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}(e.exports=s).prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=a.toArray(t,e),n=a.toArray(n,r),i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},s.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=a.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,t);return this._update(n),this._reseed++,a.encode(s,e)}},{"hash.js":26,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],39:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){var n;e&&(t.super_=e,(n=function(){}).prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t)}},{}],40:[function(t,e,r){(function(t,n){!function(){"use strict";var r="object"==("undefined"==typeof window?"undefined":o(window))?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"==o(t)&&t.versions&&t.versions.node&&(r=n);for(var a=!r.JS_SHA3_NO_COMMON_JS&&"object"==o(e)&&e.exports,i="0123456789abcdef".split(""),s=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],c=[224,256,384,512],A=["hex","buffer","arrayBuffer","array"],d=function(t,e,n){return function(r){return new v(t,e,t).update(r)[n]()}},p=function(t,e,n){return function(r,a){return new v(t,e,a).update(r)[n]()}},f=function(t,e){var n=d(t,e,"hex");n.create=function(){return new v(t,e,t)},n.update=function(t){return n.create().update(t)};for(var r=0;r<A.length;++r){var a=A[r];n[a]=d(t,e,a)}return n},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:c,createMethod:f},{name:"sha3",padding:[6,1536,393216,100663296],bits:c,createMethod:f},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var n=p(t,e,"hex");n.create=function(n){return new v(t,e,n)},n.update=function(t,e){return n.create(e).update(t)};for(var r=0;r<A.length;++r){var a=A[r];n[a]=p(t,e,a)}return n}}],h={},y=[],g=0;g<l.length;++g)for(var b=l[g],m=b.bits,I=0;I<m.length;++I){var C=b.name+"_"+m[I];y.push(C),h[C]=b.createMethod(m[I],b.padding)}function v(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}v.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var n,r,a=t.length,i=this.blocks,o=this.byteCount,u=this.blockCount,c=0,A=this.s;c<a;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<u+1;++n)i[n]=0;if(e)for(n=this.start;c<a&&n<o;++c)i[n>>2]|=t[c]<<s[3&n++];else for(n=this.start;c<a&&n<o;++c)(r=t.charCodeAt(c))<128?i[n>>2]|=r<<s[3&n++]:(r<2048?i[n>>2]|=(192|r>>6)<<s[3&n++]:(r<55296||57344<=r?i[n>>2]|=(224|r>>12)<<s[3&n++]:(r=65536+((1023&r)<<10|1023&t.charCodeAt(++c)),i[n>>2]|=(240|r>>18)<<s[3&n++],i[n>>2]|=(128|r>>12&63)<<s[3&n++]),i[n>>2]|=(128|r>>6&63)<<s[3&n++]),i[n>>2]|=(128|63&r)<<s[3&n++]);if(o<=(this.lastByteIndex=n)){for(this.start=n-o,this.block=i[u],n=0;n<u;++n)A[n]^=i[n];w(A),this.reset=!0}else this.start=n}return this},v.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];w(r)},v.prototype.toString=v.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,s=0,o=0,u="";o<r;){for(s=0;s<e&&o<r;++s,++o)t=n[s],u+=i[t>>4&15]+i[15&t]+i[t>>12&15]+i[t>>8&15]+i[t>>20&15]+i[t>>16&15]+i[t>>28&15]+i[t>>24&15];o%e==0&&(w(n),s=0)}return a&&(t=n[s],0<a&&(u+=i[t>>4&15]+i[15&t]),1<a&&(u+=i[t>>12&15]+i[t>>8&15]),2<a&&(u+=i[t>>20&15]+i[t>>16&15])),u},v.prototype.buffer=v.prototype.arrayBuffer=function(){this.finalize();for(var t=this.blockCount,e=this.s,n=this.outputBlocks,r=this.extraBytes,a=0,i=0,s=this.outputBits>>3,o=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(s),u=new Uint32Array(o);i<n;){for(a=0;a<t&&i<n;++a,++i)u[i]=e[a];i%t==0&&w(e)}return r&&(u[a]=e[a],o=o.slice(0,s)),o},v.prototype.digest=v.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,a=this.outputBlocks,i=this.extraBytes,s=0,o=0,u=[];o<a;){for(s=0;s<n&&o<a;++s,++o)t=o<<2,e=r[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;o%n==0&&w(r)}return i&&(t=o<<2,e=r[s],0<i&&(u[t]=255&e),1<i&&(u[t+1]=e>>8&255),2<i&&(u[t+2]=e>>16&255)),u};var w=function(t){for(var e,n,r,a,i,s,o,c,A,d,p,f,l,h,y,g,b,m,I,C,v,w,E,B,Q,M,_,x,k,S,D,R,N,T,O,H,L,U,j,F,P,G,q,Y,K,z,J,V,W,Z,X,$,tt,et,nt,rt,at,it,st,ot,ut,ct,At=0;At<48;At+=2)r=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],A=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(p=t[8]^t[18]^t[28]^t[38]^t[48])^(i<<1|s>>>31),n=(f=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|i>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=r^(o<<1|c>>>31),n=a^(c<<1|o>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=i^(A<<1|d>>>31),n=s^(d<<1|A>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=o^(p<<1|f>>>31),n=c^(f<<1|p>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=A^(r<<1|a>>>31),n=d^(a<<1|r>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,l=t[0],h=t[1],K=t[11]<<4|t[10]>>>28,z=t[10]<<4|t[11]>>>28,_=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ot=t[30]<<9|t[31]>>>23,P=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,T=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,V=t[23]<<10|t[22]>>>22,k=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,O=t[14]<<6|t[15]>>>26,H=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,m=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,D=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,E=t[6]<<28|t[7]>>>4,B=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,rt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,I=t[36]<<21|t[37]>>>11,C=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,$=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,Y=t[9]<<27|t[8]>>>5,Q=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,at=t[29]<<7|t[28]>>>25,it=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,v=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=l^~y&b,t[1]=h^~g&m,t[10]=E^~Q&_,t[11]=B^~M&x,t[20]=N^~O&L,t[21]=T^~H&U,t[30]=q^~K&J,t[31]=Y^~z&V,t[40]=tt^~nt&at,t[41]=et^~rt&it,t[2]=y^~b&I,t[3]=g^~m&C,t[12]=Q^~_&k,t[13]=M^~x&S,t[22]=O^~L&j,t[23]=H^~U&F,t[32]=K^~J&W,t[33]=z^~V&Z,t[42]=nt^~at&st,t[43]=rt^~it&ot,t[4]=b^~I&v,t[5]=m^~C&w,t[14]=_^~k&D,t[15]=x^~S&R,t[24]=L^~j&P,t[25]=U^~F&G,t[34]=J^~W&X,t[35]=V^~Z&$,t[44]=at^~st&ut,t[45]=it^~ot&ct,t[6]=I^~v&l,t[7]=C^~w&h,t[16]=k^~D&E,t[17]=S^~R&B,t[26]=j^~P&N,t[27]=F^~G&T,t[36]=W^~X&q,t[37]=Z^~$&Y,t[46]=st^~ut&tt,t[47]=ot^~ct&et,t[8]=v^~l&y,t[9]=w^~h&g,t[18]=D^~E&Q,t[19]=R^~B&M,t[28]=P^~N&O,t[29]=G^~T&H,t[38]=X^~q&K,t[39]=$^~Y&z,t[48]=ut^~tt&nt,t[49]=ct^~et&rt,t[0]^=u[At],t[1]^=u[At+1]};if(a)e.exports=h;else for(g=0;g<y.length;++g)r[y[g]]=h[y[g]]}()}).call(this,t("_process"),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:43}],41:[function(t,e,n){(e.exports=function(t,e){if(!t)throw new Error(e||"Assertion failed")}).equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},{}],42:[function(t,e,n){"use strict";var r=n;function a(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",n=0;n<t.length;n++)e+=a(t[n].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var a=t.charCodeAt(r),i=a>>8,s=255&a;i?n.push(i,s):n.push(s)}return n},r.zero2=a,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},{}],43:[function(t,e,n){e.exports={browser:!0}},{}],44:[function(t,e,n){(function(t){"use strict";function r(t){var e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=1779033703,r=3144134277,a=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635,c=1541459225,A=new Array(64);function d(t){for(var d=0,p=t.length;64<=p;){for(var f,l,h,y,g=n,b=r,m=a,I=i,C=s,v=o,w=u,E=c,B=0;B<16;B++)l=d+4*B,A[B]=(255&t[l])<<24|(255&t[l+1])<<16|(255&t[l+2])<<8|255&t[l+3];for(B=16;B<64;B++)h=((f=A[B-2])>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,y=((f=A[B-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,A[B]=(h+A[B-7]|0)+(y+A[B-16]|0)|0;for(B=0;B<64;B++)h=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&v^~C&w)|0)+(E+(e[B]+A[B]|0)|0)|0,y=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&m^b&m)|0,E=w,w=v,v=C,C=I+h|0,I=m,m=b,b=g,g=h+y|0;n=n+g|0,r=r+b|0,a=a+m|0,i=i+I|0,s=s+C|0,o=o+v|0,u=u+w|0,c=c+E|0,d+=64,p-=64}}d(t);var p,f=t.length%64,l=t.length/536870912|0,h=t.length<<3,y=f<56?56:120,g=t.slice(t.length-f,t.length);for(g.push(128),p=1+f;p<y;p++)g.push(0);return g.push(l>>>24&255),g.push(l>>>16&255),g.push(l>>>8&255),g.push(l>>>0&255),g.push(h>>>24&255),g.push(h>>>16&255),g.push(h>>>8&255),g.push(h>>>0&255),d(g),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function a(t,e,n){t=t.length<=64?t:r(t);for(var a=64+e.length+4,i=new Array(a),s=new Array(64),o=[],u=0;u<64;u++)i[u]=54;for(u=0;u<t.length;u++)i[u]^=t[u];for(u=0;u<e.length;u++)i[64+u]=e[u];for(u=a-4;u<a;u++)i[u]=0;for(u=0;u<64;u++)s[u]=92;for(u=0;u<t.length;u++)s[u]^=t[u];function c(){for(var t=a-1;a-4<=t;t--){if(i[t]++,i[t]<=255)return;i[t]=0}}for(;32<=n;)c(),o=o.concat(r(s.concat(r(i)))),n-=32;return 0<n&&(c(),o=o.concat(r(s.concat(r(i))).slice(0,n))),o}function i(t,e,n,r,a){var i;for(u(t,16*(2*n-1),a,0,16),i=0;i<2*n;i++)o(t,16*i,a,16),function(t,e){u(t,0,e,0,16);for(var n=8;0<n;n-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(n=0;n<16;++n)t[n]+=e[n]}(a,r),u(a,0,t,e+16*i,16);for(i=0;i<n;i++)u(t,e+2*i*16,t,16*i,16);for(i=0;i<n;i++)u(t,e+16*(2*i+1),t,16*(i+n),16)}function s(t,e){return t<<e|t>>>32-e}function o(t,e,n,r){for(var a=0;a<r;a++)n[a]^=t[e+a]}function u(t,e,n,r,a){for(;a--;)n[r++]=t[e++]}function c(t){if(t&&"number"==typeof t.length){for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return;var n=parseInt(t[e]);if(n!=t[e]||n<0||256<=n)return}return 1}}function A(t,e){var n=parseInt(t);if(t!=n)throw new Error("invalid "+e);return n}function d(e,n,r,s,d,p,l){if(!l)throw new Error("missing callback");if(r=A(r,"N"),s=A(s,"r"),d=A(d,"p"),p=A(p,"dkLen"),0===r||0!=(r&r-1))throw new Error("N must be power of 2");if(f/128/s<r)throw new Error("N too large");if(f/128/d<s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(n))throw new Error("salt must be an array or buffer");n=Array.prototype.slice.call(n);for(var h=a(e,n,128*d*s),y=new Uint32Array(32*d*s),g=0;g<y.length;g++){var b=4*g;y[g]=(255&h[3+b])<<24|(255&h[2+b])<<16|(255&h[1+b])<<8|(255&h[0+b])<<0}var m,I,C=new Uint32Array(64*s),v=new Uint32Array(32*s*r),w=32*s,E=new Uint32Array(16),B=new Uint32Array(16),Q=d*r*2,M=0,_=null,x=!1,k=0,S=0,D=parseInt(1e3/s),R=void 0!==t?t:setTimeout;!function t(){if(x)return l(new Error("cancelled"),M/Q);switch(k){case 0:u(y,I=32*S*s,C,0,w),k=1,m=0;case 1:D<(c=r-m)&&(c=D);for(var n=0;n<c;n++)u(C,0,v,(m+n)*w,w),i(C,w,s,E,B);if(m+=c,M+=c,(A=parseInt(1e3*M/Q))!==_){if(x=l(null,M/Q))break;_=A}if(m<r)break;m=0,k=2;case 2:var c,A;for(D<(c=r-m)&&(c=D),n=0;n<c;n++){var f=C[16*(2*s-1)]&r-1;o(v,f*w,C,w),i(C,w,s,E,B)}if(m+=c,M+=c,(A=parseInt(1e3*M/Q))!==_){if(x=l(null,M/Q))break;_=A}if(m<r)break;if(u(C,0,y,I,w),++S<d){k=0;break}for(h=[],n=0;n<y.length;n++)h.push(y[n]>>0&255),h.push(y[n]>>8&255),h.push(y[n]>>16&255),h.push(y[n]>>24&255);var g=a(e,h,p);return l(null,1,g)}R(t)}()}var p,f;p=this,f=2147483647,void 0!==n?e.exports=d:p&&(p.scrypt&&(p._scrypt=p.scrypt),p.scrypt=d)}).call(this,t("timers").setImmediate)},{timers:46}],45:[function(t,e,r){(function(t,e,n){!function(e,n){"use strict";var r,a,i,s,o,u,c,A,d;function p(t){return a[r]=f.apply(n,t),r++}function f(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(n,e):new Function(""+t)()}}function l(t){if(i)setTimeout(f(l,t),0);else{var e=a[t];if(e){i=!0;try{e()}finally{h(t),i=!1}}}}function h(t){delete a[t]}function y(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(A)&&l(+t.data.slice(A.length))}e.setImmediate||(r=1,i=!(a={}),s=e.document,d=(d=Object.getPrototypeOf&&Object.getPrototypeOf(e))&&d.setTimeout?d:e,o="[object process]"==={}.toString.call(e.process)?function(){var e=p(arguments);return t.nextTick(f(l,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(A="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",y,!1):e.attachEvent("onmessage",y),function(){var t=p(arguments);return e.postMessage(A+t,"*"),t}):e.MessageChannel?((c=new MessageChannel).port1.onmessage=function(t){l(t.data)},function(){var t=p(arguments);return c.port2.postMessage(t),t}):s&&"onreadystatechange"in s.createElement("script")?(u=s.documentElement,function(){var t=p(arguments),e=s.createElement("script");return e.onreadystatechange=function(){l(t),e.onreadystatechange=null,u.removeChild(e),e=null},u.appendChild(e),t}):function(){var t=p(arguments);return setTimeout(f(l,t),0),t},d.setImmediate=o,d.clearImmediate=h)}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:43,timers:46}],46:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){(function(t){var n,r,a;t.crypto&&crypto.getRandomValues&&(n=new Uint8Array(16),r=function(){return crypto.getRandomValues(n),n}),r||(a=new Array(16),r=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),a[e]=t>>>((3&e)<<3)&255;return a}),e.exports=r}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(t,e,n){for(var r=t("./rng"),a=[],i={},s=0;s<256;s++)a[s]=(s+256).toString(16).substr(1),i[a[s]]=s;function o(t,e){var n=e||0;return a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]}var u=r(),c=[1|u[0],u[1],u[2],u[3],u[4],u[5]],A=16383&(u[6]<<8|u[7]),d=0,p=0;function f(t,e,n){var a=e&&n||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;s++)e[a+s]=i[s];return e||o(i)}var l=f;l.v1=function(t,e,n){var r=e&&n||0,a=e||[],i=void 0!==(t=t||{}).clockseq?t.clockseq:A,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:p+1,f=s-d+(u-p)/1e4;if(f<0&&void 0===t.clockseq&&(i=i+1&16383),(f<0||d<s)&&void 0===t.nsecs&&(u=0),1e4<=u)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=s,A=i;var l=(1e4*(268435455&(s+=122192928e5))+(p=u))%4294967296;a[r++]=l>>>24&255,a[r++]=l>>>16&255,a[r++]=l>>>8&255,a[r++]=255&l;var h=s/4294967296*1e4&268435455;a[r++]=h>>>8&255,a[r++]=255&h,a[r++]=h>>>24&15|16,a[r++]=h>>>16&255,a[r++]=i>>>8|128,a[r++]=255&i;for(var y=t.node||c,g=0;g<6;g++)a[r+g]=y[g];return e||o(a)},l.v4=f,l.parse=function(t,e,n){var r=e&&n||0,a=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){a<16&&(e[r+a++]=i[t])}));a<16;)e[r+a++]=0;return e},l.unparse=o,e.exports=l},{"./rng":47}],49:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],50:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/properties"),a=(i.isProvider=function(t){return r.isType(t,"Provider")},i);function i(){r.setType(this,"Provider")}n.Provider=a},{"../utils/properties":74}],51:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("../utils/address"),u=t("../utils/bignumber"),c=t("../utils/bytes"),A=t("../constants"),d=t("../utils/hash"),p=t("../utils/networks"),f=t("../utils/properties"),l=t("../utils/rlp"),h=t("../utils/transaction"),y=t("../utils/utf8"),g=t("../utils/web"),b=i(t("../errors")),m=t("./abstract-provider");function I(t,e){var n={};for(var r in t)try{var a=t[r](e[r]);void 0!==a&&(n[r]=a)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}function C(t,e){return function(n){return null==n?e:t(n)}}function v(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var n=[];return e.forEach((function(e){n.push(t(e))})),n}}function w(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===c.hexDataLength(t))?t.toLowerCase():(b.throwError("invalid hash",b.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function E(t){return u.bigNumberify(t).toNumber()}function B(t){if(!c.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function Q(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return c.hexStripZeros(c.hexlify(t));if(c.isHexString(t))return c.hexStripZeros(t);throw new Error("invalid blockTag")}var M={hash:w,blockHash:C(w,null),blockNumber:C(E,null),transactionIndex:C(E,null),confirmations:C(E,null),from:s.getAddress,gasPrice:u.bigNumberify,gasLimit:u.bigNumberify,to:C(s.getAddress,null),value:u.bigNumberify,nonce:E,data:c.hexlify,r:C(B),s:C(B),v:C(E),creates:C(s.getAddress,null),raw:C(c.hexlify)};function _(t){var e;null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&u.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),t.raw||t.v&&t.r&&t.s&&(e=[c.stripZeros(c.hexlify(t.nonce)),c.stripZeros(c.hexlify(t.gasPrice)),c.stripZeros(c.hexlify(t.gasLimit)),t.to||"0x",c.stripZeros(c.hexlify(t.value||"0x")),c.hexlify(t.data||"0x"),c.stripZeros(c.hexlify(t.v||"0x")),c.stripZeros(c.hexlify(t.r)),c.stripZeros(c.hexlify(t.s))],t.raw=l.encode(e));var n=I(M,t),r=t.networkId;return null!=t.chainId&&null==r&&null==n.v&&(r=t.chainId),c.isHexString(r)&&(r=u.bigNumberify(r).toNumber()),"number"!=typeof r&&null!=n.v&&((r=(n.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),n.networkId=r,null==n.chainId&&null!=r&&(n.chainId=r),n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}var x={hash:w,parentHash:w,number:E,timestamp:E,nonce:C(c.hexlify),difficulty:function(t){var e=u.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:u.bigNumberify,gasUsed:u.bigNumberify,miner:s.getAddress,extraData:c.hexlify,transactions:C(v(w))},k=f.shallowCopy(x);function S(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),I(e?k:x,t)}k.transactions=C(v(_));var D={from:C(s.getAddress),nonce:C(E),gasLimit:C(u.bigNumberify),gasPrice:C(u.bigNumberify),to:C(s.getAddress),value:C(u.bigNumberify),data:C(c.hexlify)};function R(t){return I(D,t)}var N={transactionLogIndex:C(E),transactionIndex:E,blockNumber:E,transactionHash:w,address:s.getAddress,topics:v(w),data:c.hexlify,logIndex:E,blockHash:w},T={to:C(s.getAddress,null),from:C(s.getAddress,null),contractAddress:C(s.getAddress,null),transactionIndex:E,root:C(w),gasUsed:u.bigNumberify,logsBloom:C(c.hexlify),blockHash:w,transactionHash:w,logs:v((function(t){return I(N,t)})),blockNumber:E,confirmations:C(E,null),cumulativeGasUsed:u.bigNumberify,status:C(E)};function O(t){return Array.isArray(t)?t.forEach((function(t){O(t)})):null!=t&&w(t),t}var H,L={fromBlock:C(Q,void 0),toBlock:C(Q,void 0),address:C(s.getAddress,void 0),topics:C(O,void 0)},U={blockHash:C(w,void 0),address:C(s.getAddress,void 0),topics:C(O,void 0)},j={blockNumber:C(E),blockHash:C(w),transactionIndex:E,removed:C((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(H=c.hexlify,function(t){return t?H(t):"0x"}),topics:v(w),transactionHash:w,logIndex:E};function F(t){return I(j,t)}function P(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==c.hexDataLength(t)&&b.throwError("invalid topic",b.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":b.throwError("invalid topic value",b.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function G(t){if("string"==typeof t){if(20===c.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===c.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+P(t);if(t&&"object"==o(t))return"filter:"+(t.address||"")+":"+P(t.topics||[])}throw new Error("invalid event - "+t)}function q(){return(new Date).getTime()}var Y,K=(a(z,Y=m.Provider),z.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t.polling&&(t._setFastBlockNumber(e),e!==t._lastBlockNumber)){-2===t._emitted.block&&(t._emitted.block=e-1);for(var n=t._emitted.block+1;n<=e;n++)t.emit("block",n);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(n){var r;"block"===n||"pending"!==(r=t._emitted[n])&&12<e-r&&delete t._emitted[n]}))),-2===t._lastBlockNumber&&(t._lastBlockNumber=e-1);var r={},a={};return t._events.forEach((function(t){a[t.tag]=!0})),Object.keys(a).forEach((function(n){var a=n.split(":");switch(a[0]){case"tx":var i=a[1];t.getTransactionReceipt(i).then((function(e){return e&&null!=e.blockNumber&&(t._emitted["t:"+i]=e.blockNumber,t.emit(i,e)),null})).catch((function(e){t.emit("error",e)}));break;case"address":var s=a[1];t._balances[s]&&(r[s]=t._balances[s]),t.getBalance(s,"latest").then((function(e){var n=t._balances[s];if(!n||!e.eq(n))return t._balances[s]=e,t.emit(s,e),null})).catch((function(e){t.emit("error",e)}));break;case"filter":var o=a[2].split(/&/g).map((function(t){var e=t.split(",");return 1===e.length?""===e[0]?null:t:e.map((function(t){return""===t?null:t}))})),u={address:a[1],fromBlock:t._lastBlockNumber+1,toBlock:e,topics:o};u.address||delete u.address,t.getLogs(u).then((function(e){if(0!==e.length)return e.forEach((function(e){t._emitted["b:"+e.blockHash]=e.blockNumber,t._emitted["t:"+e.transactionHash]=e.blockNumber,t.emit(u,e)})),null})).catch((function(e){t.emit("error",e)}))}})),t._lastBlockNumber=e,t._balances=r,null}})).catch((function(t){})),this.doPoll()},z.prototype.resetEventsBlock=function(t){this._lastBlockNumber=t-1,this.polling&&this._doPoll()},Object.defineProperty(z.prototype,"network",{get:function(){return this._network},enumerable:!0,configurable:!0}),z.prototype.getNetwork=function(){return this.ready},Object.defineProperty(z.prototype,"blockNumber",{get:function(){return this._fastBlockNumber},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"polling",{get:function(){return null!=this._poller},set:function(t){var e=this;setTimeout((function(){t&&!e._poller?(e._poller=setInterval(e._doPoll.bind(e),e.pollingInterval),e._doPoll()):!t&&e._poller&&(clearInterval(e._poller),e._poller=null)}),0)},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e._doPoll()}),this._pollingInterval))},enumerable:!0,configurable:!0}),z.prototype._getFastBlockNumber=function(){var t=this,e=q();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},z.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=q(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},z.prototype.waitForTransaction=function(t,e){var n=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(r){return 0===e||r&&r.confirmations>=e?r:new Promise((function(r){n.on(t,(function a(i){i.confirmations<e||(n.removeListener(t,a),r(i))}))}))}))},z.prototype.getBlockNumber=function(){var t=this;return this.ready.then((function(){return t.perform("getBlockNumber",{}).then((function(e){var n=parseInt(e);if(n!=e)throw new Error("invalid response - getBlockNumber");return t._setFastBlockNumber(n),n}))}))},z.prototype.getGasPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getGasPrice",{}).then((function(t){return u.bigNumberify(t)}))}))},z.prototype.getBalance=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getBalance",e).then((function(t){return u.bigNumberify(t)}))}))}))}))},z.prototype.getTransactionCount=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getTransactionCount",e).then((function(t){return u.bigNumberify(t).toNumber()}))}))}))}))},z.prototype.getCode=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getCode",e).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.getStorageAt=function(t,e,n){var r=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,position:e,blockTag:n}).then((function(t){var e=t.addressOrName,n=t.position,a=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:Q(a),position:c.hexStripZeros(c.hexlify(n))};return r.perform("getStorageAt",e).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.sendTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({signedTransaction:t}).then((function(t){var n=t.signedTransaction,r={signedTransaction:c.hexlify(n)};return e.perform("sendTransaction",r).then((function(t){return e._wrapTransaction(h.parse(n),t)}),(function(t){throw t.transaction=h.parse(n),t.transaction.hash&&(t.transactionHash=t.transaction.hash),t}))}))}))},z.prototype._wrapTransaction=function(t,e){var n=this;if(null!=e&&32!==c.hexDataLength(e))throw new Error("invalid response - sendTransaction");var r=t;return null!=e&&t.hash!==e&&b.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=function(e){return 0!==e&&(n._emitted["t:"+t.hash]="pending"),n.waitForTransaction(t.hash,e).then((function(r){return null==r&&0===e?null:(n._emitted["t:"+t.hash]=r.blockNumber,0===r.status&&b.throwError("transaction failed",b.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t}),r)}))},r},z.prototype.call=function(t,e){var n=this,r=f.shallowCopy(t);return this.ready.then((function(){return f.resolveProperties({blockTag:e,tx:r}).then((function(t){var e=t.blockTag,r=t.tx;return n._resolveNames(r,["to","from"]).then((function(t){var r={blockTag:Q(e),transaction:R(t)};return n.perform("call",r).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.estimateGas=function(t){var e=this,n={to:t.to,from:t.from,data:t.data,gasPrice:t.gasPrice,value:t.value};return this.ready.then((function(){return f.resolveProperties(n).then((function(t){return e._resolveNames(t,["to","from"]).then((function(t){var n={transaction:R(t)};return e.perform("estimateGas",n).then((function(t){return u.bigNumberify(t)}))}))}))}))},z.prototype.getBlock=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({blockHashOrBlockTag:t}).then((function(t){var r=t.blockHashOrBlockTag;try{var a=c.hexlify(r);if(32===c.hexDataLength(a))return g.poll((function(){return n.perform("getBlock",{blockHash:a,includeTransactions:!!e}).then((function(t){return null==t?null==n._emitted["b:"+a]?null:void 0:S(t,e)}))}),{onceBlock:n})}catch(t){}try{var i=-128,s=Q(r);return c.isHexString(s)&&(i=parseInt(s.substring(2),16)),g.poll((function(){return n.perform("getBlock",{blockTag:s,includeTransactions:!!e}).then((function(t){return null!=t?S(t,e):i<=n._emitted.block?void 0:null}))}),{onceBlock:n})}catch(t){}throw new Error("invalid block hash or block tag")}))}))},z.prototype.getTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var n=t.transactionHash,r={transactionHash:w(n,!0)};return g.poll((function(){return e.perform("getTransaction",r).then((function(t){if(null==t)return null==e._emitted["t:"+n]?null:void 0;var r=z.checkTransactionResponse(t);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations)return e._getFastBlockNumber().then((function(t){var n=t-r.blockNumber+1;return n<=0&&(n=1),r.confirmations=n,e._wrapTransaction(r)}));return e._wrapTransaction(r)}))}),{onceBlock:e})}))}))},z.prototype.getTransactionReceipt=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var n=t.transactionHash,r={transactionHash:w(n,!0)};return g.poll((function(){return e.perform("getTransactionReceipt",r).then((function(t){if(null==t)return null==e._emitted["t:"+n]?null:void 0;if(null!=t.blockHash){var r,a,i=((a=I(T,r=t)).logs.forEach((function(t,e){null==t.transactionLogIndex&&(t.transactionLogIndex=e)})),null!=r.status&&(a.byzantium=!0),a);if(null==i.blockNumber)i.confirmations=0;else if(null==i.confirmations)return e._getFastBlockNumber().then((function(t){var e=t-i.blockNumber+1;return e<=0&&(e=1),i.confirmations=e,i}));return i}}))}),{onceBlock:e})}))}))},z.prototype.getLogs=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties(t).then((function(t){return e._resolveNames(t,["address"]).then((function(t){var n,r={filter:(n=t)&&n.blockHash?I(U,n):I(L,n)};return e.perform("getLogs",r).then((function(t){return v(F)(t)}))}))}))}))},z.prototype.getEtherPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getEtherPrice",{}).then((function(t){return t}))}))},z.prototype._getAddress=function(t){return this.resolveName(t).then((function(e){return null==e&&b.throwError("ENS name not configured",b.UNSUPPORTED_OPERATION,{operation:"resolveName("+JSON.stringify(t)+")"}),e}))},z.prototype._resolveNames=function(t,e){var n=[],r=f.shallowCopy(t);return e.forEach((function(t){null!=r[t]&&n.push(this._getAddress(r[t]).then((function(e){r[t]=e})))}),this),Promise.all(n).then((function(){return r}))},z.prototype._getResolver=function(t){var e=this;return this.getNetwork().then((function(n){n.ensAddress||b.throwError("network does not support ENS",b.UNSUPPORTED_OPERATION,{operation:"ENS",network:n.name});var r="0x0178b8bf"+d.namehash(t).substring(2),a={to:n.ensAddress,data:r};return e.call(a).then((function(t){if(32!==c.hexDataLength(t))return null;var e=s.getAddress(c.hexDataSlice(t,12));return e===A.AddressZero?null:e}))}))},z.prototype.resolveName=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.resolveName(t)}));try{return Promise.resolve(s.getAddress(t))}catch(e){if(c.isHexString(t))throw e}var n=this,r=d.namehash(t);return this._getResolver(t).then((function(t){if(null==t)return null;var e={to:t,data:"0x3b3b57de"+r.substring(2)};return n.call(e)})).then((function(t){if(32!==c.hexDataLength(t))return null;var e=s.getAddress(c.hexDataSlice(t,12));return e===A.AddressZero?null:e}))},z.prototype.lookupAddress=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.lookupAddress(t)}));var n=(t=s.getAddress(t)).substring(2)+".addr.reverse",r=d.namehash(n),a=this;return this._getResolver(n).then((function(t){if(!t)return null;var e={to:t,data:"0x691f3431"+r.substring(2)};return a.call(e)})).then((function(e){if(null==e)return null;if((e=e.substring(2)).length<64)return null;if((e=e.substring(64)).length<64)return null;var n=u.bigNumberify("0x"+e.substring(0,64)).toNumber();if(2*n>(e=e.substring(64)).length)return null;var r=y.toUtf8String("0x"+e.substring(0,2*n));return a.resolveName(r).then((function(e){return e!=t?null:r}))}))},z.checkTransactionResponse=_,z.prototype.doPoll=function(){},z.prototype.perform=function(t,e){return b.throwError(t+" not implemented",b.NOT_IMPLEMENTED,{operation:t}),null},z.prototype._startPending=function(){b.warn("WARNING: this provider does not support pending events")},z.prototype._stopPending=function(){},z.prototype._addEventListener=function(t,e,n){this._events.push({tag:G(t),listener:e,once:n}),"pending"===t&&this._startPending(),this.polling=!0},z.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},z.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},z.prototype.addEventListener=function(t,e){return this.on(t,e)},z.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var a=!1,i=G(t);return this._events=this._events.filter((function(t){return t.tag!==i||(setTimeout((function(){t.listener.apply(e,n)}),0),a=!0,!t.once)})),0===this.listenerCount()&&(this.polling=!1),a},z.prototype.listenerCount=function(t){if(!t)return this._events.length;var e=G(t);return this._events.filter((function(t){return t.tag===e})).length},z.prototype.listeners=function(t){var e=G(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))},z.prototype.removeAllListeners=function(t){var e;return null==t?(this._events=[],this._stopPending()):(e=G(t),this._events=this._events.filter((function(t){return t.tag!==e})),"pending"===t&&this._stopPending()),0===this._events.length&&(this.polling=!1),this},z.prototype.removeListener=function(t,e){var n=!1,r=G(t);return this._events=this._events.filter((function(t){return t.tag!==r||t.listener!=e||!!n||!(n=!0)})),"pending"===t&&0===this.listenerCount("pending")&&this._stopPending(),0===this.listenerCount()&&(this.polling=!1),this},z);function z(t){var e,n=Y.call(this)||this;return b.checkNew(n,m.Provider),t instanceof Promise?(f.defineReadOnly(n,"ready",t.then((function(t){return f.defineReadOnly(n,"_network",t),t}))),n.ready.catch((function(t){}))):(e=p.getNetwork(null==t?"homestead":t))?(f.defineReadOnly(n,"_network",e),f.defineReadOnly(n,"ready",Promise.resolve(n._network))):b.throwError("invalid network",b.INVALID_ARGUMENT,{arg:"network",value:t}),n._lastBlockNumber=-2,n._balances={},n._events=[],n._pollingInterval=4e3,n._emitted={block:-2},n._fastQueryDate=0,n}n.BaseProvider=K,f.defineReadOnly(m.Provider,"inherits",f.inheritable(m.Provider))},{"../constants":3,"../errors":5,"../utils/address":60,"../utils/bignumber":63,"../utils/bytes":64,"../utils/hash":65,"../utils/networks":72,"../utils/properties":74,"../utils/rlp":76,"../utils/transaction":83,"../utils/utf8":85,"../utils/web":86,"./abstract-provider":50}],52:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=t("../utils/bytes"),u=t("../utils/properties"),c=t("../utils/web"),A=i(t("../errors"));function d(t){var e,n=[];for(var r in t)null!=t[r]&&(e=o.hexlify(t[r]),{gasLimit:!0,gasPrice:!0,nonce:!0,value:!0}[r]&&(e=o.hexStripZeros(e)),n.push(r+"="+e));return n.join("&")}function p(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1==t.status&&"OK"==t.message)return t.result;var e=new Error("invalid response");throw e.result=JSON.stringify(t),e}function f(t){if("2.0"!=t.jsonrpc)throw(e=new Error("invalid response")).result=JSON.stringify(t),e;if(t.error){var e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function l(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}var h,y=(a(g,h=s.BaseProvider),g.prototype.perform=function(t,e){var n,r=this,a=this.baseUrl,i="";function s(t,e){return c.fetchJson(t,null,e||f).then((function(e){return r.emit("debug",{action:"perform",request:t,response:e,provider:r}),e}))}switch(this.apiKey&&(i+="&apikey="+this.apiKey),t){case"getBlockNumber":return s(a+="/api?module=proxy&action=eth_blockNumber"+i);case"getGasPrice":return s(a+="/api?module=proxy&action=eth_gasPrice"+i);case"getBalance":return a+="/api?module=account&action=balance&address="+e.address,s(a+="&tag="+e.blockTag+i,p);case"getTransactionCount":return a+="/api?module=proxy&action=eth_getTransactionCount&address="+e.address,s(a+="&tag="+e.blockTag+i);case"getCode":return a+="/api?module=proxy&action=eth_getCode&address="+e.address,s(a+="&tag="+e.blockTag+i,f);case"getStorageAt":return a+="/api?module=proxy&action=eth_getStorageAt&address="+e.address,a+="&position="+e.position,s(a+="&tag="+e.blockTag+i,f);case"sendTransaction":return a+="/api?module=proxy&action=eth_sendRawTransaction&hex="+e.signedTransaction,s(a+=i).catch((function(t){throw t.responseText&&(0<=t.responseText.toLowerCase().indexOf("insufficient funds")&&A.throwError("insufficient funds",A.INSUFFICIENT_FUNDS,{}),0<=t.responseText.indexOf("same hash was already imported")&&A.throwError("nonce has already been used",A.NONCE_EXPIRED,{}),0<=t.responseText.indexOf("another transaction with same nonce")&&A.throwError("replacement fee too low",A.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?(a+="/api?module=proxy&action=eth_getBlockByNumber&tag="+e.blockTag,e.includeTransactions?a+="&boolean=true":a+="&boolean=false",s(a+=i)):Promise.reject(new Error("getBlock by blockHash not implemeneted"));case"getTransaction":return a+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+e.transactionHash,s(a+=i);case"getTransactionReceipt":return a+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+e.transactionHash,s(a+=i);case"call":return a+="/api?module=proxy&action=eth_call"+(n=(n=d(e.transaction))&&"&"+n),"latest"!==e.blockTag?Promise.reject(new Error("EtherscanProvider does not support blockTag for call")):s(a+=i);case"estimateGas":return a+="/api?module=proxy&action=eth_estimateGas&"+(n=(n=d(e.transaction))&&"&"+n),s(a+=i);case"getLogs":a+="/api?module=logs&action=getLogs";try{if(e.filter.fromBlock&&(a+="&fromBlock="+l(e.filter.fromBlock)),e.filter.toBlock&&(a+="&toBlock="+l(e.filter.toBlock)),e.filter.blockHash)try{A.throwError("Etherscan does not support blockHash filters",A.UNSUPPORTED_OPERATION,{operation:"getLogs(blockHash)"})}catch(t){return Promise.reject(t)}if(e.filter.address&&(a+="&address="+e.filter.address),e.filter.topics&&0<e.filter.topics.length){if(1<e.filter.topics.length)throw new Error("unsupported topic format");var o=e.filter.topics[0];if("string"!=typeof o||66!==o.length)throw new Error("unsupported topic0 format");a+="&topic0="+o}}catch(t){return Promise.reject(t)}var u=this;return s(a+=i,p).then((function(t){var e={},n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return null!=t.blockHash?null:(t.blockHash=e[t.transactionHash],null==t.blockHash?u.getTransaction(t.transactionHash).then((function(n){return e[t.transactionHash]=n.blockHash,t.blockHash=n.blockHash,null})):null)}))})),n.then((function(){return t}))}));case"getEtherPrice":return"homestead"!==this.network.name?Promise.resolve(0):(a+="/api?module=stats&action=ethprice",s(a+=i,p).then((function(t){return parseFloat(t.ethusd)})))}return h.prototype.perform.call(this,t,e)},g.prototype.getHistory=function(t,e,n){var r=this,a=this.baseUrl,i="";return this.apiKey&&(i+="&apikey="+this.apiKey),null==e&&(e=0),null==n&&(n=99999999),this.resolveName(t).then((function(t){return a+="/api?module=account&action=txlist&address="+t,a+="&startblock="+e,a+="&endblock="+n,a+="&sort=asc"+i,c.fetchJson(a,null,p).then((function(t){r.emit("debug",{action:"getHistory",request:a,response:t,provider:r});var e=[];return t.forEach((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var n=s.BaseProvider.checkTransactionResponse(t);t.timeStamp&&(n.timestamp=parseInt(t.timeStamp)),e.push(n)})),e}))}))},g);function g(t,e){var n=h.call(this,t)||this;A.checkNew(n,g);var r="invalid";n.network&&(r=n.network.name);var a=null;switch(r){case"homestead":a="https://api.etherscan.io";break;case"ropsten":a="https://api-ropsten.etherscan.io";break;case"rinkeby":a="https://api-rinkeby.etherscan.io";break;case"kovan":a="https://api-kovan.etherscan.io";break;case"goerli":a="https://api-goerli.etherscan.io";break;default:throw new Error("unsupported network")}return u.defineReadOnly(n,"baseUrl",a),u.defineReadOnly(n,"apiKey",e||"8FG3JMZ9USS4NTA6YKEKHINU56SEPPVBJR"),n}n.EtherscanProvider=y},{"../errors":5,"../utils/bytes":64,"../utils/properties":74,"../utils/web":86,"./base-provider":51}],53:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=i(t("../errors"));function u(t){var e=!0,n=null;return t.forEach((function(r){null!=r?null!=n?n.name===r.name&&n.chainId===r.chainId&&(n.ensAddress===r.ensAddress||null==n.ensAddress&&null==r.ensAddress)||o.throwError("provider mismatch",o.INVALID_ARGUMENT,{arg:"networks",value:t}):n=r:e=!1})),e}var c,A=(a(d,c=s.BaseProvider),Object.defineProperty(d.prototype,"providers",{get:function(){return this._providers.slice(0)},enumerable:!0,configurable:!0}),d.prototype.perform=function(t,e){var n=this.providers;return new Promise((function(r,a){var i=null;!function s(){n.length?n.shift().perform(t,e).then((function(t){return r(t)})).catch((function(t){i=i||t,setTimeout(s,0)})):a(i)}()}))},d);function d(t){var e,n=this;if(0===t.length)throw new Error("no providers");return n=u(t.map((function(t){return t.network})))?c.call(this,t[0].network)||this:(e=Promise.all(t.map((function(t){return t.getNetwork()}))).then((function(t){return u(t)||o.throwError("getNetwork returned null",o.UNKNOWN_ERROR,{}),t[0]})),c.call(this,e)||this),o.checkNew(n,d),n._providers=t.slice(0),n}n.FallbackProvider=A},{"../errors":5,"./base-provider":51}],54:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./abstract-provider");n.Provider=r.Provider;var a=t("./base-provider");n.BaseProvider=a.BaseProvider;var i=t("./etherscan-provider");n.EtherscanProvider=i.EtherscanProvider;var s=t("./fallback-provider");n.FallbackProvider=s.FallbackProvider;var o=t("./ipc-provider");n.IpcProvider=o.IpcProvider;var u=t("./infura-provider");n.InfuraProvider=u.InfuraProvider;var c=t("./json-rpc-provider");n.JsonRpcProvider=c.JsonRpcProvider,n.JsonRpcSigner=c.JsonRpcSigner;var A=t("./web3-provider");n.Web3Provider=A.Web3Provider},{"./abstract-provider":50,"./base-provider":51,"./etherscan-provider":52,"./fallback-provider":53,"./infura-provider":55,"./ipc-provider":56,"./json-rpc-provider":57,"./web3-provider":58}],55:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./json-rpc-provider"),u=t("../utils/bytes"),c=t("../utils/networks"),A=t("../utils/properties"),d=i(t("../errors")),p=(a(f,s=o.JsonRpcProvider),f.prototype._startPending=function(){d.warn("WARNING: INFURA does not support pending filters")},f.prototype.getSigner=function(t){return d.throwError("INFURA does not support signing",d.UNSUPPORTED_OPERATION,{operation:"getSigner"})},f.prototype.listAccounts=function(){return Promise.resolve([])},f);function f(t,e){var n=this,r=c.getNetwork(null==t?"homestead":t);null==e&&(e="7d0d81d0919f4f05b9ab6634be01ee73");var a=null;switch(r.name){case"homestead":a="mainnet.infura.io";break;case"ropsten":a="ropsten.infura.io";break;case"rinkeby":a="rinkeby.infura.io";break;case"goerli":a="goerli.infura.io";break;case"kovan":a="kovan.infura.io";break;default:d.throwError("unsupported network",d.INVALID_ARGUMENT,{argument:"network",value:t})}return u.isHexString("0x"+e,16)?(n=s.call(this,"https://"+a+"/v3/"+e,r)||this,A.defineReadOnly(n,"apiAccessToken",null),A.defineReadOnly(n,"projectId",e)):(d.warn("The legacy INFURA apiAccesToken API is deprecated; please upgrade to a Project ID instead (see INFURA dshboard; https://infura.io)"),n=s.call(this,"https://"+a+"/"+e,r)||this,A.defineReadOnly(n,"apiAccessToken",e),A.defineReadOnly(n,"projectId",null)),d.checkNew(n,f),n}n.InfuraProvider=p},{"../errors":5,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"./json-rpc-provider":57}],56:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0})},{}],57:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=t("../abstract-signer"),u=i(t("../errors")),c=t("../utils/address"),A=t("../utils/bytes"),d=t("../utils/networks"),p=t("../utils/properties"),f=t("../utils/utf8"),l=t("../utils/web");function h(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function y(t){return t?t.toLowerCase():t}var g,b={},m=42,I=(a(C,g=o.Signer),C.prototype.getAddress=function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&u.throwError("unknown account #"+t._index,u.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t._address=c.getAddress(e[t._index]),t._address}))},C.prototype.getBalance=function(t){return this.provider.getBalance(this.getAddress(),t)},C.prototype.getTransactionCount=function(t){return this.provider.getTransactionCount(this.getAddress(),t)},C.prototype.sendUncheckedTransaction=function(t){var e=this;t=p.shallowCopy(t);var n,r=this.getAddress().then((function(t){return t&&t.toLowerCase()}));return null==t.gasLimit&&((n=p.shallowCopy(t)).from=r,t.gasLimit=this.provider.estimateGas(n)),Promise.all([p.resolveProperties(t),r]).then((function(t){var n=t[0],r=E.hexlifyTransaction(n);return r.from=t[1],e.provider.send("eth_sendTransaction",[r]).then((function(t){return t}),(function(t){throw t.responseText&&(0<=t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{transaction:n}),0<=t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{transaction:n}),0<=t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{transaction:n})),t}))}))},C.prototype.sendTransaction=function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return l.poll((function(){return e.provider.getTransaction(t).then((function(n){if(null!==n)return e.provider._wrapTransaction(n,t)}))}),{fastRetry:250,onceBlock:e.provider}).catch((function(e){throw e.transactionHash=t,e}))}))},C.prototype.signMessage=function(t){var e=this,n="string"==typeof t?f.toUtf8Bytes(t):t;return this.getAddress().then((function(t){return e.provider.send("eth_sign",[t.toLowerCase(),A.hexlify(n)])}))},C.prototype.unlock=function(t){var e=this.provider;return this.getAddress().then((function(n){return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))},C);function C(t,e,n){var r=g.call(this)||this;if(u.checkNew(r,C),t!==b)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return p.defineReadOnly(r,"provider",e),n?"string"==typeof n?p.defineReadOnly(r,"_address",c.getAddress(n)):"number"==typeof n?p.defineReadOnly(r,"_index",n):u.throwError("invalid address or index",u.INVALID_ARGUMENT,{argument:"addressOrIndex",value:n}):p.defineReadOnly(r,"_index",0),r}n.JsonRpcSigner=I;var v,w={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0},E=(a(B,v=s.BaseProvider),B.prototype.getSigner=function(t){return new I(b,this,t)},B.prototype.listAccounts=function(){return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return c.getAddress(t)}))}))},B.prototype.send=function(t,e){var n=this,r={method:t,params:e,id:m++,jsonrpc:"2.0"};return l.fetchJson(this.connection,JSON.stringify(r),h).then((function(t){return n.emit("debug",{action:"send",request:r,response:t,provider:n}),t}))},B.prototype.perform=function(t,e){switch(t){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":return this.send("eth_getBalance",[y(e.address),e.blockTag]);case"getTransactionCount":return this.send("eth_getTransactionCount",[y(e.address),e.blockTag]);case"getCode":return this.send("eth_getCode",[y(e.address),e.blockTag]);case"getStorageAt":return this.send("eth_getStorageAt",[y(e.address),e.position,e.blockTag]);case"sendTransaction":return this.send("eth_sendRawTransaction",[e.signedTransaction]).catch((function(t){throw t.responseText&&(0<t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{}),0<t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{}),0<t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?this.send("eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]):e.blockHash?this.send("eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[e.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[e.transactionHash]);case"call":return this.send("eth_call",[B.hexlifyTransaction(e.transaction,{from:!0}),e.blockTag]);case"estimateGas":return this.send("eth_estimateGas",[B.hexlifyTransaction(e.transaction,{from:!0})]);case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=y(e.filter.address)),this.send("eth_getLogs",[e.filter])}return u.throwError(t+" not implemented",u.NOT_IMPLEMENTED,{operation:t}),null},B.prototype._startPending=function(){var t,e;null==this._pendingFilter&&(e=(t=this).send("eth_newPendingTransactionFilter",[]),(this._pendingFilter=e).then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;var r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return new Promise((function(t){setTimeout((function(){t()}),1e3)}))}))})).then((function(){return t._pendingFilter==e?(setTimeout((function(){r()}),0),null):void t.send("eth_uninstallFilter",[n])})).catch((function(t){}))}(),n})).catch((function(t){})))},B.prototype._stopPending=function(){this._pendingFilter=null},B.hexlifyTransaction=function(t,e){var n=p.shallowCopy(w);if(e)for(var r in e)e[r]&&(n[r]=!0);p.checkProperties(t,n);var a={};return["gasLimit","gasPrice","nonce","value"].forEach((function(e){var n;null!=t[e]&&(n=A.hexStripZeros(A.hexlify(t[e])),"gasLimit"===e&&(e="gas"),a[e]=n)})),["from","to","data"].forEach((function(e){null!=t[e]&&(a[e]=A.hexlify(t[e]))})),a},B);function B(t,e){var n,r=this;return"string"==typeof t&&null===e&&d.getNetwork(t)&&(e=t,t=null),r=e?v.call(this,e)||this:(n=new Promise((function(t,e){setTimeout((function(){r.send("net_version",[]).then((function(e){return t(d.getNetwork(parseInt(e)))})).catch((function(t){e(t)}))}))})),v.call(this,n)||this),u.checkNew(r,B),t=t||"http://localhost:8545",r.connection="string"==typeof t?{url:t}:t,r}n.JsonRpcProvider=E},{"../abstract-signer":2,"../errors":5,"../utils/address":60,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"../utils/utf8":85,"../utils/web":86,"./base-provider":51}],58:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./json-rpc-provider"),u=t("../utils/properties"),c=i(t("../errors")),A=42,d=(a(p,s=o.JsonRpcProvider),p.prototype.send=function(t,e){var n=this;return"eth_sign"==t&&this._web3Provider.isMetaMask&&(t="personal_sign",e=[e[1],e[0]]),new Promise((function(r,a){var i={method:t,params:e,id:A++,jsonrpc:"2.0"};n._sendAsync(i,(function(t,e){if(t)a(t);else{if(e.error){var n=new Error(e.error.message);return n.code=e.error.code,n.data=e.error.data,void a(n)}r(e.result)}}))}))},p);function p(t,e){var n=s.call(this,t.host||t.path||"",e)||this;return c.checkNew(n,p),t&&(t.sendAsync?n._sendAsync=t.sendAsync.bind(t):t.send&&(n._sendAsync=t.send.bind(t))),t&&n._sendAsync||c.throwError("invalid web3Provider",c.INVALID_ARGUMENT,{arg:"web3Provider",value:t}),u.defineReadOnly(n,"_web3Provider",t),u.defineReadOnly(n,"provider",t),n}n.Web3Provider=d},{"../errors":5,"../utils/properties":74,"./json-rpc-provider":57}],59:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("../constants"),u=i(t("../errors")),c=t("./address"),A=t("./bignumber"),d=t("./bytes"),p=t("./utf8"),f=t("./properties"),l=new RegExp(/^bytes([0-9]*)$/),h=new RegExp(/^(u?int)([0-9]*)$/),y=new RegExp(/^(.*)\[([0-9]*)\]$/);n.defaultCoerceFunc=function(t,e){var n=t.match(h);return n&&parseInt(n[2])<=48?e.toNumber():e};var g=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),b=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function I(t,e){var n=t;function r(t){throw new Error('unexpected character "'+n[t]+'" at position '+t+' in "'+n+'"')}t=t.replace(/\s/g," ");for(var a={type:"",name:"",state:{allowType:!0}},i=a,s=0;s<t.length;s++){var o=t[s];switch(o){case"(":i.state.allowParams||r(s),i.state.allowType=!1,i.type=m(i.type),i.components=[{type:"",name:"",parent:i,state:{allowType:!0}}],i=i.components[0];break;case")":delete i.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),i.type=m(i.type);var u=i;(i=i.parent)||r(s),delete u.parent,i.state.allowParams=!1,i.state.allowName=!0,i.state.allowArray=!0;break;case",":delete i.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),i.type=m(i.type);var c={type:"",name:"",parent:i.parent,state:{allowType:!0}};i.parent.components.push(c),delete i.parent,i=c;break;case" ":i.state.allowType&&""!==i.type&&(i.type=m(i.type),delete i.state.allowType,i.state.allowName=!0,i.state.allowParams=!0),i.state.allowName&&""!==i.name&&(e&&"indexed"===i.name?(i.indexed=!0,i.name=""):i.state.allowName=!1);break;case"[":i.state.allowArray||r(s),i.type+=o,i.state.allowArray=!1,i.state.allowName=!1,i.state.readArray=!0;break;case"]":i.state.readArray||r(s),i.type+=o,i.state.readArray=!1,i.state.allowArray=!0,i.state.allowName=!0;break;default:i.state.allowType?(i.type+=o,i.state.allowParams=!0,i.state.allowArray=!0):i.state.allowName?(i.name+=o,delete i.state.allowArray):i.state.readArray?i.type+=o:r(s)}}if(i.parent)throw new Error("unexpected eof");return delete a.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),a.type=m(a.type),a}function C(t){return ot(n.defaultCoerceFunc,t).type}function v(t,e,n,r,a){this.coerceFunc=t,this.name=e,this.type=n,this.localName=r,this.dynamic=a}n.parseParamType=function(t){return I(t,!0)},n.formatParamType=C,n.formatSignature=function(t){return t.name+"("+t.inputs.map(C).join(",")+")"},n.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},n=t.match(g);if(!n)throw new Error("invalid event: "+t);if(e.name=n[1].trim(),it(n[2]).forEach((function(t){(t=I(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),n[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:u.info("unknown modifier: "+t)}})),e.name&&!e.name.match(b))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},n=t.split("@");if(1!==n.length){if(2<n.length)throw new Error("invalid signature");if(!n[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=A.bigNumberify(n[1]),t=n[0]}var r=(n=t.split(" returns "))[0].match(g);if(!r)throw new Error("invalid signature");if(e.name=r[1].trim(),!e.name.match(b))throw new Error('invalid identifier: "'+r[1]+'"');if(it(r[2]).forEach((function(t){e.inputs.push(I(t))})),r[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:u.info("unknown modifier: "+t)}})),1<n.length){var a=n[1].match(g);if(""!=a[1].trim()||""!=a[3].trim())throw new Error("unexpected tokens");it(a[2]).forEach((function(t){e.outputs.push(I(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var w,E=(a(B,w=v),B.prototype.encode=function(t){return this.coder.encode(t)},B.prototype.decode=function(t,e){return this.coder.decode(t,e)},B);function B(t){var e=w.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return f.defineReadOnly(e,"coder",t),e}var Q,M=(a(_,Q=v),_.prototype.encode=function(t){return d.arrayify([])},_.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},_);function _(t,e){return Q.call(this,t,"null","",e,!1)||this}var x,k=(a(S,x=v),S.prototype.encode=function(t){try{var e=A.bigNumberify(t);if(this.signed){var n=s.MaxUint256.maskn(8*this.size-1);if(e.gt(n))throw new Error("out-of-bounds");if(n=n.add(s.One).mul(s.NegativeOne),e.lt(n))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),d.padZeros(d.arrayify(e),32)}catch(e){u.throwError("invalid number value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},S.prototype.decode=function(t,e){t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:d.hexlify(t.slice(e,e+32))});var n=32-this.size,r=A.bigNumberify(t.slice(e+n,e+32));return r=this.signed?r.fromTwos(8*this.size):r.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,r)}},S);function S(t,e,n,r){var a=this,i=(n?"int":"uint")+8*e;return(a=x.call(this,t,i,i,r,!1)||this).size=e,a.signed=n,a}var D,R=new k((function(t,e){return e}),32,!1,"none"),N=(a(T,D=v),T.prototype.encode=function(t){return R.encode(t?1:0)},T.prototype.decode=function(t,e){try{var n=R.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&u.throwError("insufficient data for boolean type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:n.consumed,value:this.coerceFunc("bool",!n.value.isZero())}},T);function T(t,e){return D.call(this,t,"bool","bool",e,!1)||this}var O,H=(a(L,O=v),L.prototype.encode=function(t){var e=new Uint8Array(32);try{var n=d.arrayify(t);if(n.length!==this.length)throw new Error("incorrect data length");e.set(n)}catch(e){u.throwError("invalid "+this.name+" value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},L.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:d.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,d.hexlify(t.slice(e,e+this.length)))}},L);function L(t,e,n){var r=this,a="bytes"+e;return(r=O.call(this,t,a,a,n,!1)||this).length=e,r}var U,j=(a(F,U=v),F.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(d.arrayify(c.getAddress(t)),12)}catch(e){u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},F.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficient data for address type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:d.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",c.getAddress(d.hexlify(t.slice(e+12,e+32))))}},F);function F(t,e){return U.call(this,t,"address","address",e,!1)||this}function P(t){var e=32*Math.ceil(t.length/32),n=new Uint8Array(e-t.length);return d.concat([R.encode(t.length),t,n])}function G(t,e,n){t.length<e+32&&u.throwError("insufficient data for dynamicBytes length",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:d.hexlify(t.slice(e,e+32))});var r=R.decode(t,e).value;try{r=r.toNumber()}catch(t){u.throwError("dynamic bytes count too large",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:r.toString()})}return t.length<e+32+r&&u.throwError("insufficient data for dynamicBytes type",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:d.hexlify(t.slice(e,e+32+r))}),{consumed:32+32*Math.ceil(r/32),value:t.slice(e+32,e+32+r)}}var q,Y=(a(K,q=v),K.prototype.encode=function(t){try{return P(d.arrayify(t))}catch(t){u.throwError("invalid bytes value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},K.prototype.decode=function(t,e){var n=G(t,e,this.localName);return n.value=this.coerceFunc("bytes",d.hexlify(n.value)),n},K);function K(t,e){return q.call(this,t,"bytes","bytes",e,!0)||this}var z,J=(a(V,z=v),V.prototype.encode=function(t){return"string"!=typeof t&&u.throwError("invalid string value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),P(p.toUtf8Bytes(t))},V.prototype.decode=function(t,e){var n=G(t,e,this.localName);return n.value=this.coerceFunc("string",p.toUtf8String(n.value)),n},V);function V(t,e){return z.call(this,t,"string","string",e,!0)||this}function W(t){return 32*Math.ceil(t/32)}function Z(t,e){var n;Array.isArray(e)||(e&&"object"==o(e)?(n=[],t.forEach((function(t){n.push(e[t.localName])})),e=n):u.throwError("invalid tuple value",u.INVALID_ARGUMENT,{coderType:"tuple",value:e})),t.length!==e.length&&u.throwError("types/value length mismatch",u.INVALID_ARGUMENT,{coderType:"tuple",value:e});var r=[];t.forEach((function(t,n){r.push({dynamic:t.dynamic,value:t.encode(e[n])})}));var a=0,i=0;r.forEach((function(t){t.dynamic?(a+=32,i+=W(t.value.length)):a+=W(t.value.length)}));var s=0,c=a,A=new Uint8Array(a+i);return r.forEach((function(t){t.dynamic?(A.set(R.encode(c),s),s+=32,A.set(t.value,c),c+=W(t.value.length)):(A.set(t.value,s),s+=W(t.value.length))})),A}function X(t,e,n){var r=n,a=0,i=[];return t.forEach((function(t){var s,o;t.dynamic?(s=R.decode(e,n),(o=t.decode(e,r+s.value.toNumber())).consumed=s.consumed):o=t.decode(e,n),null!=o.value&&i.push(o.value),n+=o.consumed,a+=o.consumed})),t.forEach((function(t,e){var n=t.localName;n&&("length"===n&&(n="_length"),null==i[n]&&(i[n]=i[e]))})),{value:i,consumed:a}}var $,tt=(a(et,$=v),et.prototype.encode=function(t){Array.isArray(t)||u.throwError("expected array value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,n=new Uint8Array(0);-1===e&&(e=t.length,n=R.encode(e)),u.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var r=[],a=0;a<t.length;a++)r.push(this.coder);return d.concat([n,Z(r,t)])},et.prototype.decode=function(t,e){var n=0,r=this.length;if(-1===r){try{var a=R.decode(t,e)}catch(t){u.throwError("insufficient data for dynamic array length",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{r=a.value.toNumber()}catch(t){u.throwError("array count too large",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:a.value.toString()})}n+=a.consumed,e+=a.consumed}for(var i=[],s=0;s<r;s++)i.push(new E(this.coder));var o=X(i,t,e);return o.consumed+=n,o.value=this.coerceFunc(this.type,o.value),o},et);function et(t,e,n,r){var a=this,i=e.type+"["+(0<=n?n:"")+"]",s=-1===n||e.dynamic;return(a=$.call(this,t,"array",i,r,s)||this).coder=e,a.length=n,a}var nt,rt=(a(at,nt=v),at.prototype.encode=function(t){return Z(this.coders,t)},at.prototype.decode=function(t,e){var n=X(this.coders,t,e);return n.value=this.coerceFunc(this.type,n.value),n},at);function at(t,e,n){var r=this,a=!1,i=[];e.forEach((function(t){t.dynamic&&(a=!0),i.push(t.type)}));var s="tuple("+i.join(",")+")";return(r=nt.call(this,t,"tuple",s,n,a)||this).coders=e,r}function it(t){t=t.trim();for(var e=[],n="",r=0,a=0;a<t.length;a++){var i=t[a];if(","===i&&0===r)e.push(n),n="";else if(n+=i,"("===i)r++;else if(")"===i&&-1==--r)throw new Error("unbalanced parenthsis")}return n&&e.push(n),e}var st={address:j,bool:N,string:J,bytes:Y};function ot(t,e){var n=st[e.type];if(n)return new n(t,e.name);var r,a,i,s,o=e.type.match(h);if(o)return(0===(c=parseInt(o[2]||"256"))||256<c||c%8!=0)&&u.throwError("invalid "+o[1]+" bit length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new k(t,c/8,"int"===o[1],e.name);if(o=e.type.match(l))return(0===(c=parseInt(o[1]))||32<c)&&u.throwError("invalid bytes length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new H(t,c,e.name);if(o=e.type.match(y)){var c=parseInt(o[2]||"-1");return(e=f.shallowCopy(e)).type=o[1],e=f.deepCopy(e),new tt(t,ot(t,e),c,e.name)}return"tuple"===e.type.substring(0,5)?(r=t,a=e.components,i=e.name,s=[],(a=a||[]).forEach((function(t){s.push(ot(r,t))})),new rt(r,s,i)):""===e.type?new M(t,e.name):(u.throwError("invalid type",u.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var ut=(ct.prototype.encode=function(t,e){t.length!==e.length&&u.throwError("types/values length mismatch",u.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=[];return t.forEach((function(t){var e="string"==typeof t?I(t):t;n.push(ot(this.coerceFunc,e))}),this),d.hexlify(new rt(this.coerceFunc,n,"_").encode(e))},ct.prototype.decode=function(t,e){var n=[];return t.forEach((function(t){var e="string"==typeof t?I(t):f.deepCopy(t);n.push(ot(this.coerceFunc,e))}),this),new rt(this.coerceFunc,n,"_").decode(d.arrayify(e),0).value},ct);function ct(t){u.checkNew(this,ct),t=t||n.defaultCoerceFunc,f.defineReadOnly(this,"coerceFunc",t)}n.AbiCoder=ut,n.defaultAbiCoder=new ut},{"../constants":3,"../errors":5,"./address":60,"./bignumber":63,"./bytes":64,"./properties":74,"./utf8":85}],60:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("bn.js")),i=t("./bytes"),s=t("./keccak256"),o=t("./rlp"),u=t("../errors");function c(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40),r=0;r<40;r++)n[r]=e[r].charCodeAt(0);n=i.arrayify(s.keccak256(n));for(var a=0;a<40;a+=2)8<=n[a>>1]>>4&&(e[a]=e[a].toUpperCase()),8<=(15&n[a>>1])&&(e[a+1]=e[a+1].toUpperCase());return"0x"+e.join("")}for(var A={},d=0;d<10;d++)A[String(d)]=String(d);for(d=0;d<26;d++)A[String.fromCharCode(65+d)]=String(10+d);var p,f=Math.floor((p=9007199254740991,Math.log10?Math.log10(p):Math.log(p)/Math.LN10));function l(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=A[t]}));e.length>=f;){var n=e.substring(0,f);e=parseInt(n,10)%97+e.substring(n.length)}for(var r=String(98-parseInt(e,10)%97);r.length<2;)r="0"+r;return r}function h(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==l(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new a.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=c("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}n.getAddress=h,n.getIcapAddress=function(t){for(var e=new a.default.BN(h(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e},n.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return h("0x"+s.keccak256(o.encode([h(t.from),i.stripZeros(i.hexlify(e))])).substring(26))},n.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var n=h(t.from),r=i.arrayify(t.salt);return 32!==r.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),h("0x"+s.keccak256(i.concat(["0xff",n,r,e])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],n=0;n<t.length;n++)e.push(t.charCodeAt(n));return r.arrayify(e)},encode:function(t){t=r.arrayify(t);for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}}},{"../utils/bytes":64}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bytes"),a=t("./properties"),i=(s.prototype.encode=function(t){var e=r.arrayify(t);if(0===e.length)return"";for(var n=[0],a=0;a<e.length;++a){for(var i=e[a],s=0;s<n.length;++s)i+=n[s]<<8,n[s]=i%this.base,i=i/this.base|0;for(;0<i;)n.push(i%this.base),i=i/this.base|0}for(var o="",u=0;0===e[u]&&u<e.length-1;++u)o+=this._leader;for(var c=n.length-1;0<=c;--c)o+=this.alphabet[n[c]];return o},s.prototype.decode=function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var n=0;n<t.length;n++){var a=this._alphabetMap[t[n]];if(void 0===a)throw new Error("Non-base"+this.base+" character");for(var i=a,s=0;s<e.length;++s)i+=e[s]*this.base,e[s]=255&i,i>>=8;for(;0<i;)e.push(255&i),i>>=8}for(var o=0;t[o]===this._leader&&o<t.length-1;++o)e.push(0);return r.arrayify(new Uint8Array(e.reverse()))},s);function s(t){a.defineReadOnly(this,"alphabet",t),a.defineReadOnly(this,"base",t.length),a.defineReadOnly(this,"_alphabetMap",{}),a.defineReadOnly(this,"_leader",t.charAt(0));for(var e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}var o=new(n.BaseX=i)("abcdefghijklmnopqrstuvwxyz234567");n.Base32=o;var u=new i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");n.Base58=u},{"./bytes":64,"./properties":74}],63:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var i=r(t("bn.js")),s=t("./bytes"),o=t("./properties"),u=a(t("../errors")),c=new i.default.BN(-1);function A(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(y(t))}function p(t){return new l(A(t))}function f(t){var e=t._hex;return"-"===e[0]?new i.default.BN(e.substring(3),16).mul(c):new i.default.BN(e.substring(2),16)}var l=(h.prototype.fromTwos=function(t){return p(f(this).fromTwos(t))},h.prototype.toTwos=function(t){return p(f(this).toTwos(t))},h.prototype.abs=function(){return"-"===this._hex[0]?p(f(this).mul(c)):this},h.prototype.add=function(t){return p(f(this).add(d(t)))},h.prototype.sub=function(t){return p(f(this).sub(d(t)))},h.prototype.div=function(t){return y(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),p(f(this).div(d(t)))},h.prototype.mul=function(t){return p(f(this).mul(d(t)))},h.prototype.mod=function(t){return p(f(this).mod(d(t)))},h.prototype.pow=function(t){return p(f(this).pow(d(t)))},h.prototype.maskn=function(t){return p(f(this).maskn(t))},h.prototype.eq=function(t){return f(this).eq(d(t))},h.prototype.lt=function(t){return f(this).lt(d(t))},h.prototype.lte=function(t){return f(this).lte(d(t))},h.prototype.gt=function(t){return f(this).gt(d(t))},h.prototype.gte=function(t){return f(this).gte(d(t))},h.prototype.isZero=function(){return f(this).isZero()},h.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},h.prototype.toString=function(){return f(this).toString(10)},h.prototype.toHexString=function(){return this._hex},h.isBigNumber=function(t){return o.isType(t,"BigNumber")},h);function h(t){if(u.checkNew(this,h),o.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),o.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?o.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),o.defineReadOnly(this,"_hex",A(new i.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{o.defineReadOnly(this,"_hex",A(new i.default.BN(t)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else t instanceof h?o.defineReadOnly(this,"_hex",t._hex):t.toHexString?o.defineReadOnly(this,"_hex",A(d(t.toHexString()))):t._hex&&s.isHexString(t._hex)?o.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?o.defineReadOnly(this,"_hex",A(new i.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}function y(t){return l.isBigNumber(t)?t:new l(t)}n.BigNumber=l,n.bigNumberify=y},{"../errors":5,"./bytes":64,"./properties":74,"bn.js":9}],64:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function u(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var n=t[e];if(n<0||256<=n||parseInt(String(n))!=n)return!1}return!0}function c(t){if(null==t&&a.throwError("cannot convert null value to array",a.INVALID_ARGUMENT,{arg:"value",value:t}),i(t)&&(t=t.toHexString()),"string"!=typeof t)return u(t)?s(new Uint8Array(t)):(a.throwError("invalid arrayify value",null,{arg:"value",value:t,type:o(t)}),null);var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||a.throwError("invalid hexidecimal string",a.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&a.throwError("hex string must have 0x prefix",a.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var n=[],r=0;r<t.length;r+=2)n.push(parseInt(t.substr(r,2),16));return s(new Uint8Array(n))}function A(t){for(var e=[],n=0,r=0;r<t.length;r++){var a=c(t[r]);e.push(a),n+=a.length}var i=new Uint8Array(n),o=0;for(r=0;r<e.length;r++)i.set(e[r],o),o+=e[r].length;return s(i)}function d(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}n.isHexable=i,n.isArrayish=u,n.arrayify=c,n.concat=A,n.stripZeros=function(t){var e=c(t);if(0===e.length)return e;for(var n=0;0===e[n];)n++;return n&&(e=e.slice(n)),e},n.padZeros=function(t,e){if(e<(t=c(t)).length)throw new Error("cannot pad");var n=new Uint8Array(e);return n.set(t,e-t.length),s(n)},n.isHexString=d;var p="0123456789abcdef";function f(t){if(i(t))return t.toHexString();if("number"==typeof t){t<0&&a.throwError("cannot hexlify negative value",a.INVALID_ARGUMENT,{arg:"value",value:t}),9007199254740991<=t&&a.throwError("out-of-range",a.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var n=t.match(/^(0x)?[0-9a-fA-F]*$/);return n||a.throwError("invalid hexidecimal string",a.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==n[1]&&a.throwError("hex string must have 0x prefix",a.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(u(t)){for(var r=[],s=0;s<t.length;s++){var o=t[s];r.push(p[(240&o)>>4]+p[15&o])}return"0x"+r.join("")}return a.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function l(t,e){for(d(t)||a.throwError("invalid hex string",a.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function h(t){var e,n=0,r="0x",i="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&a.throwError("at least on of recoveryParam or v must be specified",a.INVALID_ARGUMENT,{argument:"signature",value:t}),r=l(t.r,32),i=l(t.s,32),"string"==typeof(n=t.v)&&(n=parseInt(n,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-n%2),n=27+s}else{var o=c(t);if(65!==o.length)throw new Error("invalid signature");r=f(o.slice(0,32)),i=f(o.slice(32,64)),27!==(n=o[64])&&28!==n&&(n=27+n%2)}return{r:r,s:i,recoveryParam:n-27,v:n}}n.hexlify=f,n.hexDataLength=function(t){return d(t)&&t.length%2==0?(t.length-2)/2:null},n.hexDataSlice=function(t,e,n){return d(t)||a.throwError("invalid hex data",a.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&a.throwError("hex data length must be even",a.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=n?"0x"+t.substring(e,2+2*n):"0x"+t.substring(e)},n.hexStripZeros=function(t){for(d(t)||a.throwError("invalid hex string",a.INVALID_ARGUMENT,{arg:"value",value:t});3<t.length&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},n.hexZeroPad=l,n.splitSignature=h,n.joinSignature=function(t){return f(A([(t=h(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},{"../errors":5}],65:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors")),i=t("./bytes"),s=t("./utf8"),o=t("./keccak256"),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),c=new RegExp("^((.*)\\.)?([^.]+)$"),A=new RegExp("^[a-z0-9.-]*$");n.namehash=function(t){"string"!=typeof t&&a.throwError("invalid address - "+String(t),a.INVALID_ARGUMENT,{argument:"name",value:t}),(t=t.toLowerCase()).match(A)||a.throwError("contains invalid UseSTD3ASCIIRules characters",a.INVALID_ARGUMENT,{argument:"name",value:t});for(var e=u;t.length;){var n=t.match(c),r=s.toUtf8Bytes(n[3]);e=o.keccak256(i.concat([e,o.keccak256(r)])),t=n[2]||""}return i.hexlify(e)},n.id=function(t){return o.keccak256(s.toUtf8Bytes(t))},n.hashMessage=function(t){return o.keccak256(i.concat([s.toUtf8Bytes("Ethereum Signed Message:\n"),s.toUtf8Bytes(String(t.length)),"string"==typeof t?s.toUtf8Bytes(t):t]))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./utf8":85}],66:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors")),i=t("../wordlists/lang-en"),s=t("./basex"),o=t("./bytes"),u=t("./bignumber"),c=t("./utf8"),A=t("./pbkdf2"),d=t("./hmac"),p=t("./properties"),f=t("./secp256k1"),l=t("./sha2"),h=u.bigNumberify("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=c.toUtf8Bytes("Bitcoin seed"),g=2147483648;function b(t){return(1<<t)-1<<8-t}function m(t){return o.hexZeroPad(o.hexlify(t),32)}function I(t){var e=o.hexDataSlice(l.sha256(l.sha256(t)),0,4);return s.Base58.encode(o.concat([t,e]))}var C={};n.defaultPath="m/44'/60'/0'/0/0";var v=(Object.defineProperty(w.prototype,"extendedKey",{get:function(){if(256<=this.depth)throw new Error("Depth too large!");return I(o.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",o.hexlify(this.depth),this.parentFingerprint,o.hexZeroPad(o.hexlify(this.index),4),this.chainCode,null!=this.privateKey?o.concat(["0x00",this.privateKey]):this.publicKey]))},enumerable:!0,configurable:!0}),w.prototype.neuter=function(){return new w(C,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,null,this.path)},w.prototype._derive=function(t){if(4294967295<t)throw new Error("invalid index - "+String(t));var e=this.path;e&&(e+="/"+(t&~g));var n=new Uint8Array(37);if(t&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(o.arrayify(this.privateKey),1),e&&(e+="'")}else n.set(o.arrayify(this.publicKey));for(var r=24;0<=r;r-=8)n[33+(r>>3)]=t>>24-r&255;var a=d.computeHmac(d.SupportedAlgorithms.sha512,this.chainCode,n),i=a.slice(0,32),s=a.slice(32),c=null,A=null;return this.privateKey?c=m(u.bigNumberify(i).add(this.privateKey).mod(h)):A=new f.KeyPair(o.hexlify(i))._addPoint(this.publicKey),new w(C,c,A,this.fingerprint,m(s),t,this.depth+1,this.mnemonic,e)},w.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var n=this,r=0;r<e.length;r++){var a=e[r];if(a.match(/^[0-9]+'$/)){var i=parseInt(a.substring(0,a.length-1));if(g<=i)throw new Error("invalid path index - "+a);n=n._derive(g+i)}else{if(!a.match(/^[0-9]+$/))throw new Error("invalid path component - "+a);if(i=parseInt(a),g<=i)throw new Error("invalid path index - "+a);n=n._derive(i)}}return n},w.isHDNode=function(t){return p.isType(t,"HDNode")},w);function w(t,e,n,r,i,s,u,c,A){if(a.checkNew(this,w),t!==C)throw new Error("HDNode constructor cannot be called directly");var d;e?(d=new f.KeyPair(e),p.defineReadOnly(this,"privateKey",d.privateKey),p.defineReadOnly(this,"publicKey",d.compressedPublicKey)):(p.defineReadOnly(this,"privateKey",null),p.defineReadOnly(this,"publicKey",o.hexlify(n))),p.defineReadOnly(this,"parentFingerprint",r),p.defineReadOnly(this,"fingerprint",o.hexDataSlice(l.ripemd160(l.sha256(this.publicKey)),0,4)),p.defineReadOnly(this,"address",f.computeAddress(this.publicKey)),p.defineReadOnly(this,"chainCode",i),p.defineReadOnly(this,"index",s),p.defineReadOnly(this,"depth",u),p.defineReadOnly(this,"mnemonic",c),p.defineReadOnly(this,"path",A),p.setType(this,"HDNode")}function E(t,e){var n=o.arrayify(t);if(n.length<16||64<n.length)throw new Error("invalid seed");var r=o.arrayify(d.computeHmac(d.SupportedAlgorithms.sha512,y,n));return new v(C,m(r.slice(0,32)),null,"0x00000000",m(r.slice(32)),0,0,e,"m")}function B(t,e){e=e||"";var n=c.toUtf8Bytes("mnemonic"+e,c.UnicodeNormalizationForm.NFKD);return o.hexlify(A.pbkdf2(c.toUtf8Bytes(t,c.UnicodeNormalizationForm.NFKD),n,2048,64,"sha512"))}function Q(t,e){e=e||i.langEn,a.checkNormalize();var n=e.split(t);if(n.length%3!=0)throw new Error("invalid mnemonic");for(var r=o.arrayify(new Uint8Array(Math.ceil(11*n.length/8))),s=0,u=0;u<n.length;u++){var c=e.getWordIndex(n[u].normalize("NFKD"));if(-1===c)throw new Error("invalid mnemonic");for(var A=0;A<11;A++)c&1<<10-A&&(r[s>>3]|=1<<7-s%8),s++}var d=32*n.length/3,p=b(n.length/3),f=o.arrayify(l.sha256(r.slice(0,d/8)))[0];if((f&=p)!=(r[r.length-1]&p))throw new Error("invalid checksum");return o.hexlify(r.slice(0,d/8))}function M(t,e){if((t=o.arrayify(t)).length%4!=0||t.length<16||32<t.length)throw new Error("invalid entropy");for(var n=[0],r=11,a=0;a<t.length;a++)8<r?(n[n.length-1]<<=8,n[n.length-1]|=t[a],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=t[a]>>8-r,n.push(t[a]&(1<<8-r)-1),r+=3);var s=o.arrayify(l.sha256(t))[0],u=t.length/4;return s&=b(u),n[n.length-1]<<=u,n[n.length-1]|=s>>8-u,(e=e||i.langEn).join(n.map((function(t){return e.getWord(t)})))}n.HDNode=v,n.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&I(e.slice(0,78))===t||a.throwError("invalid extended key",a.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var n=e[4],r=o.hexlify(e.slice(5,9)),i=parseInt(o.hexlify(e.slice(9,13)).substring(2),16),u=o.hexlify(e.slice(13,45)),c=e.slice(45,78);switch(o.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new v(C,null,o.hexlify(c),r,u,i,n,null,null);case"0x0488ade4":case"0x04358394":if(0!==c[0])break;return new v(C,o.hexlify(c.slice(1)),null,r,u,i,n,null,null)}return a.throwError("invalid extended key",a.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},n.fromMnemonic=function(t,e,n){return E(B(t=M(Q(t,e),e),n),t)},n.fromSeed=function(t){return E(t,null)},n.mnemonicToSeed=B,n.mnemonicToEntropy=Q,n.entropyToMnemonic=M,n.isValidMnemonic=function(t,e){try{return Q(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a,i,s=r(t("hash.js")),o=t("../utils/bytes"),u=r(t("../errors"));(i=a=n.SupportedAlgorithms||(n.SupportedAlgorithms={})).sha256="sha256",i.sha512="sha512",n.computeHmac=function(t,e,n){return a[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),o.arrayify(s.hmac(s[t],o.arrayify(e)).update(o.arrayify(n)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./abi-coder");n.AbiCoder=a.AbiCoder,n.defaultAbiCoder=a.defaultAbiCoder,n.formatSignature=a.formatSignature,n.formatParamType=a.formatParamType,n.parseSignature=a.parseSignature,n.parseParamType=a.parseParamType;var i=t("./address");n.getAddress=i.getAddress,n.getContractAddress=i.getContractAddress,n.getCreate2Address=i.getCreate2Address,n.getIcapAddress=i.getIcapAddress;var s=r(t("./base64"));n.base64=s;var o=t("./bignumber");n.BigNumber=o.BigNumber,n.bigNumberify=o.bigNumberify;var u=t("./bytes");n.arrayify=u.arrayify,n.concat=u.concat,n.hexDataSlice=u.hexDataSlice,n.hexDataLength=u.hexDataLength,n.hexlify=u.hexlify,n.hexStripZeros=u.hexStripZeros,n.hexZeroPad=u.hexZeroPad,n.isHexString=u.isHexString,n.joinSignature=u.joinSignature,n.padZeros=u.padZeros,n.splitSignature=u.splitSignature,n.stripZeros=u.stripZeros;var c=t("./hash");n.hashMessage=c.hashMessage,n.id=c.id,n.namehash=c.namehash;var A=r(t("./hdnode"));n.HDNode=A;var d=t("./interface");n.Interface=d.Interface;var p=t("./json-wallet");n.getJsonWalletAddress=p.getJsonWalletAddress;var f=t("./keccak256");n.keccak256=f.keccak256;var l=t("./sha2");n.sha256=l.sha256;var h=t("./solidity");n.solidityKeccak256=h.keccak256,n.solidityPack=h.pack,n.soliditySha256=h.sha256;var y=t("./random-bytes");n.randomBytes=y.randomBytes;var g=t("./networks");n.getNetwork=g.getNetwork;var b=t("./properties");n.checkProperties=b.checkProperties,n.deepCopy=b.deepCopy,n.defineReadOnly=b.defineReadOnly,n.resolveProperties=b.resolveProperties,n.shallowCopy=b.shallowCopy;var m=r(t("./rlp"));n.RLP=m;var I=t("./secp256k1");n.computeAddress=I.computeAddress,n.computePublicKey=I.computePublicKey,n.recoverAddress=I.recoverAddress,n.recoverPublicKey=I.recoverPublicKey,n.verifyMessage=I.verifyMessage;var C=t("./signing-key");n.SigningKey=C.SigningKey;var v=t("./transaction");n.populateTransaction=v.populateTransaction;var w=t("./transaction");n.parseTransaction=w.parse,n.serializeTransaction=w.serialize;var E=t("./utf8");n.formatBytes32String=E.formatBytes32String,n.parseBytes32String=E.parseBytes32String,n.toUtf8Bytes=E.toUtf8Bytes,n.toUtf8String=E.toUtf8String;var B=t("./units");n.commify=B.commify,n.formatEther=B.formatEther,n.parseEther=B.parseEther,n.formatUnits=B.formatUnits,n.parseUnits=B.parseUnits;var Q=t("./web");n.fetchJson=Q.fetchJson,n.poll=Q.poll;var M=t("./hmac");n.SupportedAlgorithms=M.SupportedAlgorithms;var _=t("./utf8");n.UnicodeNormalizationForm=_.UnicodeNormalizationForm;var x=t("./wordlist");n.Wordlist=x.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};function s(t){for(var e in l.setType(this,"Description"),t)l.defineReadOnly(this,e,l.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0});var o,u=t("./address"),c=t("./abi-coder"),A=t("./bignumber"),d=t("./bytes"),p=t("./hash"),f=t("./keccak256"),l=t("./properties"),h=i(t("../errors")),y=function(t){l.setType(this,"Indexed"),l.defineReadOnly(this,"hash",t)},g=(a(b,o=s),b.prototype.encode=function(t,e){d.isHexString(t)||h.throwError("invalid contract bytecode",h.INVALID_ARGUMENT,{arg:"bytecode",value:t}),h.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+c.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){h.throwError("invalid constructor argument",h.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},b);function b(){return null!==o&&o.apply(this,arguments)||this}var m,I=(a(C,m=s),C.prototype.encode=function(t){h.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+c.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){h.throwError("invalid input argument",h.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},C.prototype.decode=function(t){try{return c.defaultAbiCoder.decode(this.outputs,d.arrayify(t))}catch(e){h.throwError("invalid data for function output",h.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},C);function C(){return null!==m&&m.apply(this,arguments)||this}var v,w=(a(E,v=s),E);function E(){return null!==v&&v.apply(this,arguments)||this}var B,Q=(a(M,B=s),M.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&h.throwError("too many arguments for "+this.name,h.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var n=[];for(this.anonymous||n.push(this.topic),t.forEach((function(t,r){var a=e.inputs[r];a.indexed?null==t?n.push(null):"string"===a.type?n.push(p.id(t)):"bytes"===a.type?n.push(f.keccak256(t)):-1!==a.type.indexOf("[")||"tuple"===a.type.substring(0,5)?h.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",h.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===a.type&&u.getAddress(t),n.push(d.hexZeroPad(d.hexlify(t),32).toLowerCase())):null!=t&&h.throwError("cannot filter non-indexed parameters; must be null",h.INVALID_ARGUMENT,{argument:a.name||r,value:t})}));n.length&&null===n[n.length-1];)n.pop();return n},M.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var n,r=[],a=[],i=[];this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(a.push(t),i.push(!1))})),null!=e&&(n=c.defaultAbiCoder.decode(r,d.concat(e)));var s=c.defaultAbiCoder.decode(a,d.arrayify(t)),o={},u=0,A=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?o[r]=new y(null):i[r]?o[r]=new y(n[A++]):o[r]=n[A++]:o[r]=s[u++],t.name&&(o[t.name]=o[r])})),o.length=this.inputs.length,new w(o)},M);function M(){return null!==B&&B.apply(this,arguments)||this}var _,x=(a(k,_=s),k);function k(){return null!==_&&_.apply(this,arguments)||this}var S,D=(a(R,S=s),R);function R(){return null!==S&&S.apply(this,arguments)||this}function N(t){switch(t.type){case"constructor":var e=new g({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var n=c.formatSignature(t).replace(/tuple/g,""),r=p.id(n).substring(0,10),a=!1;null!=t.constant?a=t.constant:null!=t.stateMutability&&(a="view"==t.stateMutability||"pure"==t.stateMutability),e=new I({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:a?"call":"transaction",name:t.name,signature:n,sighash:r}),t.name&&(null==this.functions[t.name]?l.defineReadOnly(this.functions,t.name,e):h.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&l.defineReadOnly(this.functions,e.signature,e);break;case"event":n=c.formatSignature(t).replace(/tuple/g,""),e=new Q({name:t.name,signature:n,inputs:t.inputs,topic:p.id(n),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&l.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&l.defineReadOnly(this.events,e.signature,e);break;case"receive":case"fallback":break;default:h.warn("WARNING: unsupported ABI type - "+t.type)}}var T=(O.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var n in this.functions)if(-1!==n.indexOf("(")){var r=this.functions[n];if(r.sighash===e){var a=c.defaultAbiCoder.decode(r.inputs,"0x"+t.data.substring(10));return new x({args:a,decode:r.decode,name:r.name,signature:r.signature,sighash:r.sighash,value:A.bigNumberify(t.value||"0")})}}return null},O.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var n=this.events[e];if(!n.anonymous&&n.topic===t.topics[0])return new D({decode:n.decode,name:n.name,signature:n.signature,topic:n.topic,values:n.decode(t.data,t.topics)})}return null},O.isInterface=function(t){return l.isType(t,"Interface")},O.isIndexed=function(t){return l.isType(t,"Indexed")},O);function O(t){if(h.checkNew(this,O),"string"==typeof t){try{t=JSON.parse(t)}catch(e){h.throwError("could not parse ABI JSON",h.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return h.throwError("invalid abi",h.INVALID_ARGUMENT,{arg:"abi",value:t}),null}l.defineReadOnly(this,"functions",{}),l.defineReadOnly(this,"events",{});var e=[];t.forEach((function(t){"string"==typeof t&&(t=c.parseSignature(t)),e.push(t)})),l.defineReadOnly(this,"abi",l.deepCopy(e,!0)),e.forEach(N,this),this.deployFunction||N.call(this,{type:"constructor",inputs:[]}),l.setType(this,"Interface")}n.Interface=T},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./address");function a(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}n.isCrowdsaleWallet=a,n.isSecretStorageWallet=i,n.getJsonWalletAddress=function(t){if(a(t))try{return r.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(i(t))try{return r.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":60}],71:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("js-sha3"),a=t("./bytes");n.keccak256=function(t){return"0x"+r.keccak_256(a.arrayify(t))}},{"./bytes":64,"js-sha3":40}],72:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t){return function(e){var n=[];return e.InfuraProvider&&n.push(new e.InfuraProvider(t)),e.EtherscanProvider&&n.push(new e.EtherscanProvider(t)),0===n.length?null:e.FallbackProvider?new e.FallbackProvider(n):n[0]}}function s(t,e){return function(n){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null}}var o={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},c={unspecified:{chainId:0,name:"unspecified"},homestead:o,mainnet:o,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};n.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in c){var n=c[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var r=c[t];return null==r?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}var i=c[t.name];return i?(0!==t.chainId&&t.chainId!==i.chainId&&a.throwError("network chainId mismatch",a.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:i.chainId,ensAddress:t.ensAddress||i.ensAddress||null,_defaultProvider:t._defaultProvider||i._defaultProvider||null}):("number"!=typeof t.chainId&&a.throwError("invalid network chainId",a.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],73:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/bytes"),a=t("./hmac");n.pbkdf2=function(t,e,n,i,s){var o;t=r.arrayify(t),e=r.arrayify(e);var u,c,A=1,d=new Uint8Array(i),p=new Uint8Array(e.length+4);p.set(e);for(var f=1;f<=A;f++){p[e.length]=f>>24&255,p[e.length+1]=f>>16&255,p[e.length+2]=f>>8&255,p[e.length+3]=255&f;var l=a.computeHmac(s,t,p);o||(o=l.length,c=new Uint8Array(o),u=i-((A=Math.ceil(i/o))-1)*o),c.set(l);for(var h=1;h<n;h++){l=a.computeHmac(s,t,l);for(var y=0;y<o;y++)c[y]^=l[y]}var g=(f-1)*o,b=f===A?u:o;d.set(r.arrayify(c).slice(0,b),g)}return r.arrayify(d)}},{"../utils/bytes":64,"./hmac":67}],74:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t,e,n){Object.defineProperty(t,e,{enumerable:!0,value:n,writable:!1})}function s(t,e){return t&&t._ethersType===e}n.defineReadOnly=i,n.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},n.isType=s,n.resolveProperties=function(t){var e={},n=[];return Object.keys(t).forEach((function(r){var a=t[r];a instanceof Promise?n.push(a.then((function(t){return e[r]=t,null}))):e[r]=a})),Promise.all(n).then((function(){return e}))},n.checkProperties=function(t,e){t&&"object"==o(t)||a.throwError("invalid object",a.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(n){e[n]||a.throwError("invalid object key - "+n,a.INVALID_ARGUMENT,{argument:"transaction",value:t,key:n})}))},n.shallowCopy=function(t){var e={};for(var n in t)e[n]=t[n];return e};var u={boolean:!0,number:!0,string:!0};n.deepCopy=function t(e,n){if(null==e||u[o(e)])return e;if(Array.isArray(e)){var r=e.map((function(e){return t(e,n)}));return n&&Object.freeze(r),r}if("object"==o(e)){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var a in r={},e){var c=e[a];void 0!==c&&i(r,a,t(c,n))}return n&&Object.freeze(r),r}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+o(e))},n.inheritable=function t(e){return function(n){var r,a;a=e,(r=n).super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(n,"inherits",t(n))}}},{"../errors":5}],75:[function(t,e,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),a=t("../utils/properties"),i=e.crypto||e.msCrypto;function s(t){if(t<=0||1024<t||parseInt(String(t))!=t)throw new Error("invalid length");var e=new Uint8Array(t);return i.getRandomValues(e),n.arrayify(e)}i&&i.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),i={getRandomValues:function(t){for(var e=0;e<20;e++)for(var n=0;n<t.length;n++)e?t[n]^=Math.trunc(256*Math.random()):t[n]=Math.trunc(256*Math.random());return t},_weakCrypto:!0}),r.randomBytes=s,!0===i._weakCrypto&&a.defineReadOnly(s,"_weakCrypto",!0)}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/bytes":64,"../utils/properties":74}],76:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bytes");function a(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function i(t,e,n){for(var r=0,a=0;a<n;a++)r=256*r+t[e+a];return r}function s(t,e,n,r){for(var a=[];n<e+1+r;){var i=o(t,n);if(a.push(i.result),e+1+r<(n+=i.consumed))throw new Error("invalid rlp")}return{consumed:1+r,result:a}}function o(t,e){if(0===t.length)throw new Error("invalid rlp data");if(248<=t[e]){if(e+1+(n=t[e]-247)>t.length)throw new Error("too short");if(e+1+n+(a=i(t,e+1,n))>t.length)throw new Error("to short");return s(t,e,e+1+n,n+a)}if(192<=t[e]){if(e+1+(a=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,a)}if(184<=t[e]){var n;if(e+1+(n=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+n+(a=i(t,e+1,n))>t.length)throw new Error("invalid rlp data");return{consumed:1+n+a,result:r.hexlify(t.slice(e+1+n,e+1+n+a))}}if(128<=t[e]){var a;if(e+1+(a=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+a,result:r.hexlify(t.slice(e+1,e+1+a))}}return{consumed:1,result:r.hexlify(t[e])}}n.encode=function(t){return r.hexlify(function t(e){if(Array.isArray(e)){var n=[];return e.forEach((function(e){n=n.concat(t(e))})),n.length<=55?(n.unshift(192+n.length),n):((i=a(n.length)).unshift(247+i.length),i.concat(n))}var i,s=Array.prototype.slice.call(r.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((i=a(s.length)).unshift(183+i.length),i.concat(s))}(t))},n.decode=function(t){var e=r.arrayify(t),n=o(e,0);if(n.consumed!==e.length)throw new Error("invalid rlp data");return n.result}},{"./bytes":64}],77:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("elliptic"),i=t("./address"),s=t("./bytes"),o=t("./hash"),u=t("./keccak256"),c=t("./properties"),A=r(t("../errors")),d=null;function p(){return d=d||new a.ec("secp256k1")}var f=(l.prototype.sign=function(t){var e=p().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},l.prototype.computeSharedSecret=function(t){var e=p().keyFromPrivate(s.arrayify(this.privateKey)),n=p().keyFromPublic(s.arrayify(h(t)));return s.hexZeroPad("0x"+e.derive(n.getPublic()).toString(16),32)},l.prototype._addPoint=function(t){var e=p().keyFromPublic(s.arrayify(this.publicKey)),n=p().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")},l);function l(t){var e=p().keyFromPrivate(s.arrayify(t));c.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),c.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),c.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),c.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function h(t,e){var n=s.arrayify(t);if(32!==n.length)return 33===n.length?e?s.hexlify(n):"0x"+p().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+p().keyFromPublic(n).getPublic(!0,"hex"):s.hexlify(n):(A.throwError("invalid public or private key",A.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var r=new f(n);return e?r.compressedPublicKey:r.publicKey}function y(t){var e="0x"+h(t).slice(4);return i.getAddress("0x"+u.keccak256(e).substring(26))}function g(t,e){var n=s.splitSignature(e),r={r:s.arrayify(n.r),s:s.arrayify(n.s)};return"0x"+p().recoverPubKey(s.arrayify(t),r,n.recoveryParam).encode("hex",!1)}function b(t,e){return y(g(s.arrayify(t),e))}n.KeyPair=f,n.computePublicKey=h,n.computeAddress=y,n.recoverPublicKey=g,n.recoverAddress=b,n.verifyMessage=function(t,e){return b(o.hashMessage(t),e)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var i=r(t("aes-js")),s=r(t("scrypt-js")),o=r(t("uuid")),u=t("./signing-key"),c=a(t("./hdnode")),A=t("./address"),d=t("./bytes"),p=t("./pbkdf2"),f=t("./keccak256"),l=t("./utf8"),h=t("./random-bytes");function y(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),d.arrayify(t)}function g(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function b(t){return"string"==typeof t?l.toUtf8Bytes(t,l.UnicodeNormalizationForm.NFKC):d.arrayify(t)}function m(t,e){for(var n=t,r=e.toLowerCase().split("/"),a=0;a<r.length;a++){var i=null;for(var s in n)if(s.toLowerCase()===r[a]){i=n[s];break}if(null===i)return null;n=i}return n}n.decryptCrowdsale=function(t,e){var n=JSON.parse(t);e=b(e);var r=A.getAddress(m(n,"ethaddr")),a=y(m(n,"encseed"));if(!a||a.length%16!=0)throw new Error("invalid encseed");for(var s=p.pbkdf2(e,e,2e3,32,"sha256").slice(0,16),o=a.slice(0,16),c=a.slice(16),h=new i.default.ModeOfOperation.cbc(s,o),g=d.arrayify(h.decrypt(c)),I=(g=i.default.padding.pkcs7.strip(g),""),C=0;C<g.length;C++)I+=String.fromCharCode(g[C]);var v=l.toUtf8Bytes(I),w=new u.SigningKey(f.keccak256(v));if(w.address!==r)throw new Error("corrupt crowdsale wallet");return w},n.decrypt=function(t,e,n){function r(t,e){var n,r,s=y(m(a,"crypto/ciphertext"));if(d.hexlify((n=t.slice(16,32),r=s,f.keccak256(d.concat([n,r])))).substring(2)!==m(a,"crypto/mac").toLowerCase())return e(new Error("invalid password")),null;var o=function(t,e){if("aes-128-ctr"!==m(a,"crypto/cipher"))return null;var n=y(m(a,"crypto/cipherparams/iv")),r=new i.default.Counter(n),s=new i.default.ModeOfOperation.ctr(t,r);return d.arrayify(s.decrypt(e))}(t.slice(0,16),s),p=t.slice(32,64);if(!o)return e(new Error("unsupported cipher")),null;var l=new u.SigningKey(o);if(a.address&&l.address!==A.getAddress(a.address))return e(new Error("address mismatch")),null;var h=m(a,"x-ethers/locale");if("0.1"===m(a,"x-ethers/version")&&(null==h||"en"===h)){var g=y(m(a,"x-ethers/mnemonicCiphertext")),b=y(m(a,"x-ethers/mnemonicCounter")),I=new i.default.Counter(b),C=new i.default.ModeOfOperation.ctr(p,I),v=m(a,"x-ethers/path")||c.defaultPath,w=d.arrayify(C.decrypt(g)),E=c.entropyToMnemonic(w),B=c.fromMnemonic(E).derivePath(v);if(B.privateKey!=d.hexlify(o))return e(new Error("mnemonic mismatch")),null;l=new u.SigningKey(B)}return l}var a=JSON.parse(t),o=b(e);return new Promise((function(t,e){var i=m(a,"crypto/kdf");if(i&&"string"==typeof i)if("scrypt"===i.toLowerCase()){var u=y(m(a,"crypto/kdfparams/salt")),c=parseInt(m(a,"crypto/kdfparams/n")),A=parseInt(m(a,"crypto/kdfparams/r")),f=parseInt(m(a,"crypto/kdfparams/p"));if(!c||!A||!f)return void e(new Error("unsupported key-derivation function parameters"));if(0!=(c&c-1))return void e(new Error("unsupported key-derivation function parameter value for N"));if(32!==(g=parseInt(m(a,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));n&&n(0),s.default(o,u,c,A,f,64,(function(a,i,s){if(a)a.progress=i,e(a);else if(s){var o=r(s=d.arrayify(s),e);if(!o)return;n&&n(1),t(o)}else if(n)return n(i)}))}else if("pbkdf2"===i.toLowerCase()){u=y(m(a,"crypto/kdfparams/salt"));var l=null,h=m(a,"crypto/kdfparams/prf");if("hmac-sha256"===h)l="sha256";else{if("hmac-sha512"!==h)return void e(new Error("unsupported prf"));l="sha512"}var g,b=parseInt(m(a,"crypto/kdfparams/c"));if(32!==(g=parseInt(m(a,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));var I=r(p.pbkdf2(o,u,b,g,l),e);if(!I)return;t(I)}else e(new Error("unsupported key-derivation function"));else e(new Error("unsupported key-derivation function"))}))},n.encrypt=function(t,e,n,r){var a;if("function"!=typeof n||r||(r=n,n={}),n=n||{},32!==(a=u.SigningKey.isSigningKey(t)?d.arrayify(t.privateKey):d.arrayify(t)).length)throw new Error("invalid private key");var A=b(e),p=null;if(n.entropy&&(p=d.arrayify(n.entropy)),n.mnemonic)if(p){if(c.entropyToMnemonic(p)!==n.mnemonic)throw new Error("entropy and mnemonic mismatch")}else p=d.arrayify(c.mnemonicToEntropy(n.mnemonic,n.wordlist));var l=n.path;p&&!l&&(l=c.defaultPath);var y=(y=n.client)||"ethers.js",m=n.salt?d.arrayify(n.salt):h.randomBytes(32),I=null;if(n.iv){if(16!==(I=d.arrayify(n.iv)).length)throw new Error("invalid iv")}else I=h.randomBytes(16);var C=null;if(n.uuid){if(16!==(C=d.arrayify(n.uuid)).length)throw new Error("invalid uuid")}else C=h.randomBytes(16);var v=1<<17,w=8,E=1;return n.scrypt&&(n.scrypt.N&&(v=n.scrypt.N),n.scrypt.r&&(w=n.scrypt.r),n.scrypt.p&&(E=n.scrypt.p)),new Promise((function(t,e){r&&r(0),s.default(A,m,v,w,E,64,(function(s,c,A){if(s)s.progress=c,e(s);else if(A){var b,B,Q,M,_,x,k=(A=d.arrayify(A)).slice(0,16),S=A.slice(16,32),D=A.slice(32,64),R=new u.SigningKey(a).address,N=new i.default.Counter(I),T=new i.default.ModeOfOperation.ctr(k,N),O=d.arrayify(T.encrypt(a)),H=f.keccak256(d.concat([S,O])),L={address:R.substring(2).toLowerCase(),id:o.default.v4({random:C}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:d.hexlify(I).substring(2)},ciphertext:d.hexlify(O).substring(2),kdf:"scrypt",kdfparams:{salt:d.hexlify(m).substring(2),n:v,dklen:32,p:E,r:w},mac:H.substring(2)}};p&&(b=h.randomBytes(16),B=new i.default.Counter(b),Q=new i.default.ModeOfOperation.ctr(D,B),M=d.arrayify(Q.encrypt(p)),x=(_=new Date).getUTCFullYear()+"-"+g(_.getUTCMonth()+1,2)+"-"+g(_.getUTCDate(),2)+"T"+g(_.getUTCHours(),2)+"-"+g(_.getUTCMinutes(),2)+"-"+g(_.getUTCSeconds(),2)+".0Z",L["x-ethers"]={client:y,gethFilename:"UTC--"+x+"--"+L.address,mnemonicCounter:d.hexlify(b).substring(2),mnemonicCiphertext:d.hexlify(M).substring(2),path:l,version:"0.1"},n.wordlist&&"string"==typeof n.wordlist.locale&&(L["x-ethers"].locale=n.wordlist.locale)),r&&r(1),t(JSON.stringify(L))}else if(r)return r(c)}))}))}},{"./address":60,"./bytes":64,"./hdnode":66,"./keccak256":71,"./pbkdf2":73,"./random-bytes":75,"./signing-key":81,"./utf8":85,"aes-js":8,"scrypt-js":44,uuid:48}],79:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("hash.js")),i=t("./bytes");n.ripemd160=function(t){return"0x"+a.default.ripemd160().update(i.arrayify(t)).digest("hex")},n.sha256=function(t){return"0x"+a.default.sha256().update(i.arrayify(t)).digest("hex")},n.sha512=function(t){return"0x"+a.default.sha512().update(i.arrayify(t)).digest("hex")}},{"./bytes":64,"hash.js":26}],80:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t("setimmediate"),n.platform="browser"},{setimmediate:45}],81:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./hdnode"),i=t("./bytes"),s=t("./properties"),u=t("./secp256k1"),c=r(t("../errors")),A=(d.prototype.signDigest=function(t){return this.keyPair.sign(t)},d.prototype.computeSharedSecret=function(t){return this.keyPair.computeSharedSecret(i.arrayify(t))},d.isSigningKey=function(t){return s.isType(t,"SigningKey")},d);function d(t){c.checkNew(this,d);var e=a.HDNode.isHDNode(t)?(s.defineReadOnly(this,"mnemonic",t.mnemonic),s.defineReadOnly(this,"path",t.path),i.arrayify(t.privateKey)):("string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t),i.arrayify(t));try{32!==e.length&&c.throwError("exactly 32 bytes required",c.INVALID_ARGUMENT,{arg:"privateKey",value:"[REDACTED]"})}catch(t){var n={arg:"privateKey",reason:t.reason,value:"[REDACTED]"};t.value&&("number"==typeof t.value.length&&(n.length=t.value.length),n.type=o(t.value)),c.throwError("invalid private key",t.code,n)}s.defineReadOnly(this,"privateKey",i.hexlify(e)),s.defineReadOnly(this,"keyPair",new u.KeyPair(e)),s.defineReadOnly(this,"publicKey",this.keyPair.publicKey),s.defineReadOnly(this,"address",u.computeAddress(this.keyPair.publicKey)),s.setType(this,"SigningKey")}n.SigningKey=A},{"../errors":5,"./bytes":64,"./hdnode":66,"./properties":74,"./secp256k1":77}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bignumber"),a=t("./bytes"),i=t("./utf8"),s=t("./keccak256"),o=t("./sha2"),u=new RegExp("^bytes([0-9]+)$"),c=new RegExp("^(u?int)([0-9]*)$"),A=new RegExp("^(.*)\\[([0-9]*)\\]$");function d(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");var n=[];return t.forEach((function(t,s){n.push(function t(e,n,s){switch(e){case"address":return s?a.padZeros(n,32):a.arrayify(n);case"string":return i.toUtf8Bytes(n);case"bytes":return a.arrayify(n);case"bool":return n=n?"0x01":"0x00",s?a.padZeros(n,32):a.arrayify(n)}var o=e.match(c);if(o){if((d=parseInt(o[2]||"256"))%8!=0||0===d||256<d)throw new Error("invalid number type - "+e);return s&&(d=256),n=r.bigNumberify(n).toTwos(d),a.padZeros(n,d/8)}if(o=e.match(u)){var d=parseInt(o[1]);if(String(d)!=o[1]||0===d||32<d)throw new Error("invalid number type - "+e);if(a.arrayify(n).byteLength!==d)throw new Error("invalid value for "+e);return s?a.arrayify((n+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):n}if((o=e.match(A))&&Array.isArray(n)){var p=o[1];if(parseInt(o[2]||String(n.length))!=n.length)throw new Error("invalid value for "+e);var f=[];return n.forEach((function(e){f.push(t(p,e,!0))})),a.concat(f)}throw new Error("unknown type - "+e)}(t,e[s]))})),a.hexlify(a.concat(n))}n.pack=d,n.keccak256=function(t,e){return s.keccak256(d(t,e))},n.sha256=function(t,e){return o.sha256(d(t,e))}},{"./bignumber":63,"./bytes":64,"./keccak256":71,"./sha2":79,"./utf8":85}],83:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("../constants"),i=r(t("../errors")),s=t("./secp256k1"),o=t("./address"),u=t("./bignumber"),c=t("./bytes"),A=t("./keccak256"),d=t("./properties"),p=r(t("./rlp")),f=t("../providers/abstract-provider");function l(t){return"0x"===t?a.Zero:u.bigNumberify(t)}var h=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};n.serialize=function(t,e){d.checkProperties(t,y);var n=[];h.forEach((function(e){var r=t[e.name]||[];r=c.arrayify(c.hexlify(r)),e.length&&r.length!==e.length&&0<r.length&&i.throwError("invalid length for "+e.name,i.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:r}),e.maxLength&&(r=c.stripZeros(r)).length>e.maxLength&&i.throwError("invalid length for "+e.name,i.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:r}),n.push(c.hexlify(r))})),null!=t.chainId&&0!==t.chainId&&(n.push(c.hexlify(t.chainId)),n.push("0x"),n.push("0x"));var r=p.encode(n);if(!e)return r;var a=c.splitSignature(e),s=27+a.recoveryParam;return 9===n.length&&(n.pop(),n.pop(),n.pop(),s+=2*t.chainId+8),n.push(c.hexlify(s)),n.push(c.stripZeros(c.arrayify(a.r))),n.push(c.stripZeros(c.arrayify(a.s))),p.encode(n)},n.parse=function(t){var e=p.decode(t);9!==e.length&&6!==e.length&&i.throwError("invalid raw transaction",i.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var n,r={nonce:l(e[0]).toNumber(),gasPrice:l(e[1]),gasLimit:l(e[2]),to:"0x"===(n=e[3])?null:o.getAddress(n),value:l(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return i.info(t),r}if(r.r=c.hexZeroPad(e[7],32),r.s=c.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var a=r.v-27,d=e.slice(0,6);0!==r.chainId&&(d.push(c.hexlify(r.chainId)),d.push("0x"),d.push("0x"),a-=2*r.chainId+8);var f=A.keccak256(p.encode(d));try{r.from=s.recoverAddress(f,{r:c.hexlify(r.r),s:c.hexlify(r.s),recoveryParam:a})}catch(t){i.info(t)}r.hash=A.keccak256(t)}return r},n.populateTransaction=function(t,e,n){f.Provider.isProvider(e)||i.throwError("missing provider",i.INVALID_ARGUMENT,{argument:"provider",value:e}),d.checkProperties(t,y);var r,a=d.shallowCopy(t);return null!=a.to&&(a.to=e.resolveName(a.to)),null==a.gasPrice&&(a.gasPrice=e.getGasPrice()),null==a.nonce&&(a.nonce=e.getTransactionCount(n)),null==a.gasLimit&&((r=d.shallowCopy(a)).from=n,a.gasLimit=e.estimateGas(r)),null==a.chainId&&(a.chainId=e.getNetwork().then((function(t){return t.chainId}))),d.resolveProperties(a)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a,i=t("../constants"),s=r(t("../errors")),o=t("./bignumber"),u={};function c(t){return{decimals:t.length-1,tenPower:o.bigNumberify(t)}}function A(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var n="1",r=0;r<t;r++)n+="0";e=c(n)}return e||s.throwError("invalid unitType",s.INVALID_ARGUMENT,{argument:"name",value:t}),e}function d(t,e){var n=A(e),r=(t=o.bigNumberify(t)).lt(i.Zero);r&&(t=t.mul(i.NegativeOne));for(var a=t.mod(n.tenPower).toString();a.length<n.decimals;)a="0"+a;return a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1],t=t.div(n.tenPower).toString()+"."+a,r&&(t="-"+t),t}function p(t,e){null==e&&(e=18);var n=A(e);if("string"==typeof t&&t.match(/^-?[0-9.,]+$/)||s.throwError("invalid decimal value",s.INVALID_ARGUMENT,{arg:"value",value:t}),0===n.decimals)return o.bigNumberify(t);var r="-"===t.substring(0,1);r&&(t=t.substring(1)),"."===t&&s.throwError("missing value",s.INVALID_ARGUMENT,{arg:"value",value:t});var a=t.split(".");2<a.length&&s.throwError("too many decimal points",s.INVALID_ARGUMENT,{arg:"value",value:t});var u=a[0],c=a[1];for(u=u||"0",(c=c||"0").length>n.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});c.length<n.decimals;)c+="0";var d=o.bigNumberify(u),p=o.bigNumberify(c),f=d.mul(n.tenPower).add(p);return r&&(f=f.mul(i.NegativeOne)),f}a="1",["wei","kwei","Mwei","Gwei","szabo","finney","ether"].forEach((function(t){var e=c(a);u[t.toLowerCase()]=e,u[String(e.decimals)]=e,a+="000"})),n.commify=function(t){var e=String(t).split(".");(2<e.length||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&s.throwError("invalid value",s.INVALID_ARGUMENT,{argument:"value",value:t});var n=e[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");var a="";2===e.length&&(a="."+(e[1]||"0"));for(var i=[];n.length;){if(n.length<=3){i.unshift(n);break}var o=n.length-3;i.unshift(n.substring(o)),n=n.substring(0,o)}return r+i.join(",")+a},n.formatUnits=d,n.parseUnits=p,n.formatEther=function(t){return d(t,18)},n.parseEther=function(t){return p(t,18)}},{"../constants":3,"../errors":5,"./bignumber":63}],85:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,a,i=t("../constants"),s=t("../errors"),o=t("./bytes");function u(t,e){void 0===e&&(e=r.current),e!=r.current&&(s.checkNormalize(),t=t.normalize(e));for(var n=[],a=0;a<t.length;a++){var i=t.charCodeAt(a);if(i<128)n.push(i);else if(i<2048)n.push(i>>6|192),n.push(63&i|128);else if(55296==(64512&i)){a++;var u=t.charCodeAt(a);if(a>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");i=65536+((1023&i)<<10)+(1023&u),n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(63&i|128)}return o.arrayify(n)}function c(t,e){t=o.arrayify(t);for(var n="",r=0;r<t.length;){var a=t[r++];if(a>>7!=0){var i=null,s=null;if(192==(224&a))i=1,s=127;else if(224==(240&a))i=2,s=2047;else{if(240!=(248&a)){if(e)continue;if(128==(192&a))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}i=3,s=65535}if(r+i>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;r<t.length&&t[r]>>6==2;r++);}else{for(var u=a&(1<<8-i-1)-1,c=0;c<i;c++){var A=t[r];if(128!=(192&A)){u=null;break}u=u<<6|63&A,r++}if(null!==u)if(u<=s){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(1114111<u){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(55296<=u&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?n+=String.fromCharCode(u):(u-=65536,n+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else n+=String.fromCharCode(a)}return n}(a=r=n.UnicodeNormalizationForm||(n.UnicodeNormalizationForm={})).current="",a.NFC="NFC",a.NFD="NFD",a.NFKC="NFKC",a.NFKD="NFKD",n.toUtf8Bytes=u,n.toUtf8String=c,n.formatBytes32String=function(t){var e=u(t);if(31<e.length)throw new Error("bytes32 string must be less than 32 bytes");return o.hexlify(o.concat([e,i.HashZero]).slice(0,32))},n.parseBytes32String=function(t){var e=o.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var n=31;0===e[n-1];)n--;return c(e.slice(0,n))}},{"../constants":3,"../errors":5,"./bytes":64}],86:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("xmlhttprequest"),i=t("./base64"),s=t("./properties"),u=t("./utf8"),c=r(t("../errors"));n.fetchJson=function(t,e,n){var r,s={},A=null,d=12e4;if("string"==typeof t)A=t;else if("object"==o(t)){if(null==t.url&&c.throwError("missing URL",c.MISSING_ARGUMENT,{arg:"url"}),A=t.url,"number"==typeof t.timeout&&0<t.timeout&&(d=t.timeout),t.headers)for(var p in t.headers)s[p.toLowerCase()]={key:p,value:String(t.headers[p])};null!=t.user&&null!=t.password&&("https:"!==A.substring(0,6)&&!0!==t.allowInsecure&&c.throwError("basic authentication requires a secure https url",c.INVALID_ARGUMENT,{arg:"url",url:A,user:t.user,password:"[REDACTED]"}),r=t.user+":"+t.password,s.authorization={key:"Authorization",value:"Basic "+i.encode(u.toUtf8Bytes(r))})}return new Promise((function(t,r){function i(){null!=u&&(clearTimeout(u),u=null)}var o=new a.XMLHttpRequest,u=null;u=setTimeout((function(){null!=u&&(u=null,r(new Error("timeout")),setTimeout((function(){o.abort()}),0))}),d),e?(o.open("POST",A,!0),s["content-type"]={key:"Content-Type",value:"application/json"}):o.open("GET",A,!0),Object.keys(s).forEach((function(t){var e=s[t];o.setRequestHeader(e.key,e.value)})),o.onreadystatechange=function(){if(4===o.readyState){if(200!=o.status){i();var a=new Error("invalid response - "+o.status);return a.statusCode=o.status,o.responseText&&(a.responseText=o.responseText),void r(a)}var s=null;try{s=JSON.parse(o.responseText)}catch(a){i();var u=new Error("invalid json response");return u.orginialError=a,u.responseText=o.responseText,null!=e&&(u.requestBody=e),u.url=A,void r(u)}if(n)try{s=n(s)}catch(a){return i(),a.url=A,a.body=e,a.responseText=o.responseText,void r(a)}i(),t(s)}},o.onerror=function(t){i(),r(t)};try{null!=e?o.send(e):o.send()}catch(u){i();var c=new Error("connection error");c.error=u,r(c)}}))},n.poll=function(t,e){return e=e||{},null==(e=s.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){var a=null,i=!1,s=function(){return!i&&(i=!0,a&&clearTimeout(a),!0)};e.timeout&&(a=setTimeout((function(){s()&&r(new Error("timeout"))}),e.timeout));var o=e.fastRetry||null,u=0;!function a(){return t().then((function(t){var r;return void 0!==t?s()&&n(t):e.onceBlock?e.onceBlock.once("block",a):i||(u++,(r=e.interval*parseInt(String(Math.random()*Math.pow(2,u))))<e.floor&&(r=e.floor),r>e.ceiling&&(r=e.ceiling),o&&(u--,r=o,o=null),setTimeout(a,r)),null}),(function(t){s()&&r(t)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(t,e,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/hash"),a=t("../utils/properties");r.check=function(t){for(var e=[],r=0;r<2048;r++){var a=t.getWord(r);if(r!==t.getWordIndex(a))return"0x";e.push(a)}return n.id(e.join("\n")+"\n")};var i=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){a.defineReadOnly(this,"locale",t)}r.Wordlist=i,r.register=function(t,e){e=e||t.locale}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./utils/bytes"),u=t("./utils/hash"),c=t("./utils/hdnode"),A=t("./utils/json-wallet"),d=t("./utils/keccak256"),p=t("./utils/properties"),f=t("./utils/random-bytes"),l=i(t("./utils/secret-storage")),h=t("./utils/signing-key"),y=t("./utils/transaction"),g=t("./abstract-signer"),b=t("./providers/abstract-provider"),m=i(t("./errors")),I=(a(C,s=g.Signer),Object.defineProperty(C.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),C.prototype.connect=function(t){return b.Provider.isProvider(t)||m.throwError("invalid provider",m.INVALID_ARGUMENT,{argument:"provider",value:t}),new C(this.signingKey,t)},C.prototype.getAddress=function(){return Promise.resolve(this.address)},C.prototype.sign=function(t){var e=this;return p.resolveProperties(t).then((function(t){var n=y.serialize(t),r=e.signingKey.signDigest(d.keccak256(n));return y.serialize(t,r)}))},C.prototype.signMessage=function(t){return Promise.resolve(o.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},C.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},C.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},C.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=p.shallowCopy(t)).nonce=this.getTransactionCount("pending")),y.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},C.prototype.encrypt=function(t,e,n){if("function"!=typeof e||n||(n=e,e={}),n&&"function"!=typeof n)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=p.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),l.encrypt(this.privateKey,t,e,n)},C.createRandom=function(t){var e=f.randomBytes(16);(t=t||{}).extraEntropy&&(e=o.arrayify(d.keccak256(o.concat([e,t.extraEntropy])).substring(0,34)));var n=c.entropyToMnemonic(e,t.locale);return C.fromMnemonic(n,t.path,t.locale)},C.fromEncryptedJson=function(t,e,n){if(A.isCrowdsaleWallet(t))try{n&&n(0);var r=l.decryptCrowdsale(t,e);return n&&n(1),Promise.resolve(new C(r))}catch(t){return Promise.reject(t)}else if(A.isSecretStorageWallet(t))return l.decrypt(t,e,n).then((function(t){return new C(t)}));return Promise.reject("invalid wallet JSON")},C.fromMnemonic=function(t,e,n){return e=e||c.defaultPath,new C(c.fromMnemonic(t,n).derivePath(e))},C);function C(t,e){var n=s.call(this)||this;return m.checkNew(n,C),h.SigningKey.isSigningKey(t)?p.defineReadOnly(n,"signingKey",t):p.defineReadOnly(n,"signingKey",new h.SigningKey(t)),p.defineReadOnly(n,"provider",e),n}n.Wallet=I},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../wordlists/lang-en").langEn;n.en=r},{"../wordlists/lang-en":90}],90:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i,s=t("../utils/wordlist"),o=null;function u(t){if(null==o&&(o="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw o=null,new Error("BIP39 Wordlist for en (English) FAILED")}function c(){return i.call(this,"en")||this}var A=new(a(c,i=s.Wordlist),c.prototype.getWord=function(t){return u(this),o[t]},c.prototype.getWordIndex=function(t){return u(this),o.indexOf(t)},c);n.langEn=A,s.register(A)},{"../utils/wordlist":87}]},{},[7])(7)},"object"==o(e)&&void 0!==t?t.exports=s():(a=[],void 0===(i="function"==typeof(r=s)?r.apply(e,a):r)||(t.exports=i))}).call(this,n(5))},function(t,e,n){(function(e,r){var a=n(23),i=n(4),s=n(7),o=n(156),u=this;function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}void 0===e&&(e=n(2).Buffer);var A=n(81),d=n(161).default,p=n(162),f=n(52),l=n(82),h=n(14).utils,y=h.keccak256,g=h.getAddress,b={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new d("1000000000000000000"),ToBigNumber:function(t){return new d(t)},WeiToEther:function(t){return b.ToBigNumber(t).div(b.weiPerEther)},EtherToWei:function(t){return b.ToBigNumber(t).times(b.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+A.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var n=b.FromB58(t),r=n.slice(0,32),a=r.toString("hex");n=n.slice(32);for(var i=0;n[i]>=128;)i++;i++;var s=n.slice(0,i),o=p.decode(s);return n=n.slice(i),{digest:a,size:o,objectId:"iq__"+b.B58(n),partHash:"hqp_"+b.B58(e.concat([r,s]))}},DecodeSignedToken:function(t){var n=b.FromB58(t.slice(6)),r="0x".concat(n.slice(0,65).toString("hex")),a=JSON.parse(e.from(l.inflateRaw(n.slice(65))).toString("utf-8"));return a.adr=b.FormatAddress("0x".concat(e.from(a.adr,"base64").toString("hex"))),{payload:a,signature:r}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var n,r,a,i,s,o=b.FromB58(t);function u(t,e){var n,r,a=p.decode(o,0),i=p.decode.bytes;return r=t?0===(n=o.slice(i+1,a+i)).length?"":e+b.B58(n):"0x"+(n=o.slice(i,a+i)).toString("hex"),o=o.slice(a+i),r}switch(e){case"tqw_":case"tqpw":n="0x"+o.toString("hex");break;case"tlro":case"tq__":r=u(!0,"iq__"),a=u(!0,"inod"),n=u(!1,"");break;case"tqp_":if(o.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=o[0],s=o[1],o=o.slice(2),n=u(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:n,objectId:r,nodeId:a,scheme:i,flags:s}},AddressToHash:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(n?"0x04":"0x",""),A.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+b.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+b.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+b.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),b.FormatAddress((e?"0x04":"0x")+A.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&b.FormatAddress(t)===b.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&b.HashToAddress(t)===b.HashToAddress(e))},ValidAddress:function(t){try{return g(t),!0}catch(t){return u.Log(t),!1}},ValidHash:function(t){return b.ValidAddress(b.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},B64:function(t){return e.from(t,"utf-8").toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},FromB64URL:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return b.FromB64(t)},B58:function(t){return A.encode(e.from(t))},FromB58:function(t){return A.decode(t)},FromB58ToStr:function(t){return(new TextDecoder).decode(b.FromB58(t))},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),n=o(e,2),r=n[0],a=n[1];return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},r=JSON.parse(b.FromB64(r)),{signature:a})},LimitedMap:function(t,e,n){var r,s,o,u,c;return i.async((function(A){for(;;)switch(A.prev=A.next){case 0:return r=0,s=!1,o=function(){var t;return i.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s){e.next=5;break}return e.next=3,i.awrap(new Promise((function(t){return setTimeout(t,10)})));case 3:e.next=0;break;case 5:return s=!0,t=r,r+=1,s=!1,e.abrupt("return",t);case 10:case"end":return e.stop()}}))},u=[],c=0,A.abrupt("return",new Promise((function(r,s){a(Array(t||1)).forEach((function(){var t;return i.async((function(a){for(;;)switch(a.prev=a.next){case 0:return c+=1,a.next=3,i.awrap(o());case 3:t=a.sent;case 4:if(!(t<e.length)){a.next=19;break}return a.prev=5,a.next=8,i.awrap(n(e[t],t));case 8:u[t]=a.sent,a.next=14;break;case 11:a.prev=11,a.t0=a.catch(5),s(a.t0);case 14:return a.next=16,i.awrap(o());case 16:t=a.sent,a.next=4;break;case 19:0===(c-=1)&&r(u);case 21:case"end":return a.stop()}}),null,null,[[5,11]])}))})));case 6:case"end":return A.stop()}}))},ResponseToJson:function(t){return i.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",b.ResponseToFormat("json",t));case 1:case"end":return e.stop()}}))},ResponseToFormat:function(t,e){return i.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.awrap(e);case 2:e=n.sent,n.t0=t.toLowerCase(),n.next="json"===n.t0?6:"text"===n.t0?9:"blob"===n.t0?12:"arraybuffer"===n.t0?15:"formdata"===n.t0?18:"buffer"===n.t0?21:24;break;case 6:return n.next=8,i.awrap(e.json());case 8:return n.abrupt("return",n.sent);case 9:return n.next=11,i.awrap(e.text());case 11:return n.abrupt("return",n.sent);case 12:return n.next=14,i.awrap(e.blob());case 14:return n.abrupt("return",n.sent);case 15:return n.next=17,i.awrap(e.arrayBuffer());case 17:return n.abrupt("return",n.sent);case 18:return n.next=20,i.awrap(e.formData());case 20:return n.abrupt("return",n.sent);case 21:return n.next=23,i.awrap(e.buffer());case 23:return n.abrupt("return",n.sent);case 24:return n.abrupt("return",e);case 25:case"end":return n.stop()}}))},ResizeImage:function(t){var e=t.imageUrl,n=t.height;return!e||e&&!e.startsWith("http")?e:(e=f(e).removeSearch("height").removeSearch("header-x_image_height"),n&&!isNaN(parseInt(n))&&e.addSearch("height",parseInt(n)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(!t)return t;1===n.length&&Array.isArray(n[0])&&(n=n[0]);for(var a=t,i=0;i<n.length;i++)if(void 0===(a=a[n[i]]))return;return a},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return b.IsCloneable(t[e])}));case"Map":return a(t.keys()).every(b.IsCloneable)&&a(t.values()).every(b.IsCloneable);case"Set":return a(t.keys()).every(b.IsCloneable);default:return!1}},MakeClonable:function(t){if(b.IsCloneable(t))return t;if(e.isBuffer(t))return b.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return b.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return b.MakeClonable(t)})));case"Map":var n=new Map;return Array.from(t.keys()).forEach((function(e){var r=b.MakeClonable(t.get(e));r&&n.set(e,r)})),n;case"Error":return t.message;case"Object":var r={};return Object.keys(t).map((function(e){var n=b.MakeClonable(t[e]);n&&(r[e]=n)})),r;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var n=new Uint8Array(e.from(t.replace("0x04",""),"hex")),r="0x"+y(n).slice(26);return b.FormatAddress(r)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?b.PLATFORM_REACT_NATIVE:void 0!==r&&void 0!==r.versions&&void 0!==r.versions.node?b.PLATFORM_NODE:b.PLATFORM_WEB}};t.exports=b}).call(this,n(2).Buffer,n(6))},function(t,e,n){var r,a,i;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<t.length;r++){var a=t[r];if("string"!=typeof a)throw new TypeError("Url must be a string. Received "+a);""!==a&&(r>0&&(a=a.replace(/^[\/]+/,"")),a=r<t.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),e.push(a))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"===s(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(a="function"==typeof(r=i)?r.call(e,n,e,t):r)||(t.exports=a)},function(t,e,n){var r=n(15);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){if(!t)throw Error("Write token not specified");if(!t.toString().startsWith("t"))throw Error("Invalid write token: ".concat(t))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!t.toString().startsWith("hqp_")&&!t.toString().startsWith("hqpe"))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var n=t.libraryId,r=t.objectId,a=t.versionHash;a?e.ValidateVersion(a):(e.ValidateLibrary(n),e.ValidateObject(r))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return r.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e,n){var r=n(1).Buffer,a=n(45).Transform,i=n(34).StringDecoder;function s(t){a.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(0)(s,a),s.prototype.update=function(t,e,n){"string"==typeof t&&(t=r.from(t,e));var a=this._update(t);return this.hashMode?this:(n&&(a=this._toString(a,n)),a)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,n){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{n(r)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new i(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return n&&(r+=this._decoder.end()),r},t.exports=s},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(46),a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=d;var i=n(33);i.inherits=n(0);var s=n(101),o=n(60);i.inherits(d,s);for(var u=a(o.prototype),c=0;c<u.length;c++){var A=u[c];d.prototype[A]||(d.prototype[A]=o.prototype[A])}function d(t){if(!(this instanceof d))return new d(t);s.call(this,t),o.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),d.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";(function(e,r){var a=n(1).Buffer,i=e.crypto||e.msCrypto;i&&i.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s<t;s+=65536)i.getRandomValues(n.slice(s,s+65536));else i.getRandomValues(n);if("function"==typeof e)return r.nextTick((function(){e(null,n)}));return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(5),n(6))},function(t,e,n){var r=n(151),a=n(152),i=n(153);t.exports=function(t){return r(t)||a(t)||i()}},function(t,e,n){var r=n(4),a=n(12),i=n(13),s=n(52),o="undefined"!=typeof fetch?fetch:n(53).default,u=n(30).LogMessage,c=function(){"use strict";function t(e){var n=e.uris,r=e.debug;a(this,t),this.uris=n,this.uriIndex=0,this.debug=r,this.draftURIs={}}return i(t,[{key:"Log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u(this,t,e)}}]),i(t,[{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(t){this.draftURIs[t]=this.BaseURI()}},{key:"RequestHeaders",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.Accept||(e.Accept="application/json"),"JSON"===t?e["Content-type"]="application/json":"BINARY"===t&&(e["Content-type"]="application/octet-stream"),e}},{key:"Request",value:function(e){var n,a,i,s,o,u,c,A,d,p,f,l,h,y,g,b,m,I,C,v,w,E,B,Q;return r.async((function(M){for(;;)switch(M.prev=M.next){case 0:return n=e.method,a=e.path,i=e.queryParams,s=void 0===i?{}:i,o=e.body,u=e.bodyType,c=void 0===u?"JSON":u,A=e.headers,d=void 0===A?{}:A,p=e.attempts,f=void 0===p?0:p,l=e.failover,h=void 0===l||l,y=e.forceFailover,g=void 0!==y&&y,b=this.BaseURI(),m=a.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw_[a-zA-Z0-9]+)/),(I=m?m[2]:void 0)&&(this.draftURIs[I]?b=this.draftURIs[I]:this.draftURIs[I]=b),C=b.path(a).query(s).hash(""),v={method:n,headers:this.RequestHeaders(c,d)},"POST"!==n&&"PUT"!==n&&"DELETE"!==n||(o&&"JSON"===c?v.body=JSON.stringify(o):o&&(v.body=o)),M.prev=8,M.next=11,r.awrap(t.Fetch(C.toString(),v));case 11:w=M.sent,M.next=17;break;case 14:M.prev=14,M.t0=M.catch(8),w={ok:!1,status:500,statusText:"ElvClient Error: "+M.t0.message,url:C.toString(),stack:M.t0.stack};case 17:if(w.ok){M.next=40;break}if(!(!I&&(h&&parseInt(w.status)>=500||g)&&f<this.uris.length)){M.next=24;break}return this.Log("HttpClient failing over from ".concat(this.BaseURI(),": ").concat(f+1," attempts"),!0),this.uriIndex=(this.uriIndex+1)%this.uris.length,M.next=23,r.awrap(this.Request({method:n,path:a,queryParams:s,body:o,bodyType:c,headers:d,attempts:f+1,forceFailover:g}));case 23:return M.abrupt("return",M.sent);case 24:if(E=w.headers&&w.headers.get("content-type")||"",B="",!w.text||!w.json){M.next=37;break}if(!E.includes("application/json")){M.next=33;break}return M.next=30,r.awrap(w.json());case 30:M.t1=M.sent,M.next=36;break;case 33:return M.next=35,r.awrap(w.text());case 35:M.t1=M.sent;case 36:B=M.t1;case 37:throw Q={name:"ElvHttpClientError",status:w.status,statusText:w.statusText,message:w.statusText,url:C.toString(),body:B,requestParams:v},this.Log(JSON.stringify(Q,null,2),!0),Q;case 40:return this.Log("".concat(w.status," - ").concat(n," ").concat(C.toString())),M.abrupt("return",w);case 42:case"end":return M.stop()}}),null,this,[[8,14]])}},{key:"URL",value:function(t){var e=t.path,n=t.queryParams,r=void 0===n?{}:n;return this.BaseURI().path(e).query(r).hash("").toString()}}],[{key:"Fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(t,e)}}]),t}();t.exports=c},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=n(87),i="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,s=a||i||Function("return this")();t.exports=s},function(t,e,n){"use strict";var r=n(0),a=n(61),i=n(62),s=n(63),o=n(19);function u(t){o.call(this,"digest"),this._hash=t}r(u,o),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new a:"rmd160"===t||"ripemd160"===t?new i:new u(s(t))}},function(t,e,n){var r=n(1).Buffer;function a(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,a=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var u=s%a,c=Math.min(i-o,a-u),A=0;A<c;A++)n[u+A]=t[o+A];o+=c,(s+=c)%a==0&&this._update(n)}return this._len+=i,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,a=(n-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return t?i.toString(t):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a={};function i(t,e,n){n||(n=Error);var r=function(t){var n,r;function a(n,r,a){return t.call(this,function(t,n,r){return"string"==typeof e?e:e(t,n,r)}(n,r,a))||this}return r=t,(n=a).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,a}(n);r.prototype.name=n.name,r.prototype.code=t,a[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var a,i,o,u;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(a="must not be",e=e.replace(/^not /,"")):a="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))u="The ".concat(t," ").concat(a," ").concat(s(e,"type"));else{var c=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(c," ").concat(a," ").concat(s(e,"type"))}return u+=". Received type ".concat(r(n))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=a},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var a=n(144),i=n(148);n(0)(c,a);for(var s=r(i.prototype),o=0;o<s.length;o++){var u=s[o];c.prototype[u]||(c.prototype[u]=i.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);a.call(this,t),i.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||e.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,n(6))},function(t,e,n){var r=n(18),a=function(t,e){return"object"===r(e)&&"function"==typeof e[t]?e[t]:null},i=function(t){return"object"===r(t)?JSON.stringify(t):t};t.exports={LogMessage:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.debug){var r=a("log",t.debugOptions),s=a("error",t.debugOptions),o="(elv-client-js#".concat(t.constructor.name,")"),u="\n".concat(o," ").concat(i(e),"\n");n?s?s(o,e):console.error(u):r?r(o,e):console.log(u)}}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==n(t)}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a,i="object"===("undefined"==typeof Reflect?"undefined":r(Reflect))?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};a=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function A(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function d(t,e,n,a){var i,s,o,u;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(n));if(void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),(i=A(t))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function p(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,t))}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=p.bind(r);return a.listener=n,r.wrapFn=a,a}function l(t,e,n){var r=t._events;if(void 0===r)return[];var a=r[e];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(a):y(a,a.length)}function h(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return A(this)},u.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,a=this._events;if(void 0!==a)r=r&&void 0===a.error;else if(!r)return!1;if(r){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var u=a[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var c=u.length,A=y(u,c);for(n=0;n<c;++n)s(A[n],this,e)}return!0},u.prototype.addListener=function(t,e){return d(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return d(this,t,e,!0)},u.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));return this.on(t,f(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));return this.prependListener(t,f(this,t,e)),this},u.prototype.removeListener=function(t,e){var n,a,i,s,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));if(void 0===(a=this._events))return this;if(void 0===(n=a[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(a[t]=n[0]),void 0!==a.removeListener&&this.emit("removeListener",t,o||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var a,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(a=i[r])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return l(this,t,!0)},u.prototype.rawListeners=function(t){return l(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},u.prototype.listenerCount=h,u.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(t,e,n){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"===n(t)&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(2).Buffer)},function(t,e,n){"use strict";var r=n(1).Buffer,a=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=A,this.end=d,e=3;break;default:return this.write=p,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function A(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function d(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=i,i.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},i.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},i.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var a=s(e[r]);if(a>=0)return a>0&&(t.lastNeed=a-1),a;if(--r<n||-2===a)return 0;if((a=s(e[r]))>=0)return a>0&&(t.lastNeed=a-2),a;if(--r<n||-2===a)return 0;if((a=s(e[r]))>=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){(function(e){t.exports=function(t,n){for(var r=Math.min(t.length,n.length),a=new e(r),i=0;i<r;++i)a[i]=t[i]^n[i];return a}}).call(this,n(2).Buffer)},function(t,e,n){"use strict";var r=n(11),a=n(8);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=t>>>24&255,r[a++]=t>>>16&255,r[a++]=t>>>8&255,r[a++]=255&t}else for(r[a++]=255&t,r[a++]=t>>>8&255,r[a++]=t>>>16&255,r[a++]=t>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r}},function(t,e,n){var r=e;r.bignum=n(3),r.define=n(317).define,r.base=n(38),r.constants=n(133),r.decoders=n(322),r.encoders=n(324)},function(t,e,n){var r=e;r.Reporter=n(319).Reporter,r.DecoderBuffer=n(132).DecoderBuffer,r.EncoderBuffer=n(132).EncoderBuffer,r.Node=n(320)},function(t,e,n){var r=n(191),a=n(192),i=n(193),s=n(194),o=n(195);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=a,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,t.exports=u},function(t,e,n){var r=n(41);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(86),a=n(202),i=n(203),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?a(t):i(t)}},function(t,e,n){var r=n(54)(Object,"create");t.exports=r},function(t,e,n){var r=n(217);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){t.exports=a;var r=n(32).EventEmitter;function a(){r.call(this)}n(0)(a,r),a.Readable=n(58),a.Writable=n(268),a.Duplex=n(269),a.Transform=n(270),a.PassThrough=n(271),a.Stream=a,a.prototype.pipe=function(t,e){var n=this;function a(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",a),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",o),n.on("close",u));var s=!1;function o(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(A(),0===r.listenerCount(this,"error"))throw t}function A(){n.removeListener("data",a),t.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",u),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",A),n.removeListener("close",A),t.removeListener("close",A)}return n.on("error",c),t.on("error",c),n.on("end",A),n.on("close",A),t.on("close",A),t.emit("pipe",n),t}},function(t,e,n){"use strict";(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,a){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,a)}));default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return e.nextTick((function(){t.apply(null,i)}))}}}:t.exports=e}).call(this,n(6))},function(t,e,n){var r=n(1).Buffer;function a(t){r.isBuffer(t)||(t=r.from(t));for(var e=t.length/4|0,n=new Array(e),a=0;a<e;a++)n[a]=t.readUInt32BE(4*a);return n}function i(t){for(;0<t.length;t++)t[0]=0}function s(t,e,n,r,a){for(var i,s,o,u,c=n[0],A=n[1],d=n[2],p=n[3],f=t[0]^e[0],l=t[1]^e[1],h=t[2]^e[2],y=t[3]^e[3],g=4,b=1;b<a;b++)i=c[f>>>24]^A[l>>>16&255]^d[h>>>8&255]^p[255&y]^e[g++],s=c[l>>>24]^A[h>>>16&255]^d[y>>>8&255]^p[255&f]^e[g++],o=c[h>>>24]^A[y>>>16&255]^d[f>>>8&255]^p[255&l]^e[g++],u=c[y>>>24]^A[f>>>16&255]^d[l>>>8&255]^p[255&h]^e[g++],f=i,l=s,h=o,y=u;return i=(r[f>>>24]<<24|r[l>>>16&255]<<16|r[h>>>8&255]<<8|r[255&y])^e[g++],s=(r[l>>>24]<<24|r[h>>>16&255]<<16|r[y>>>8&255]<<8|r[255&f])^e[g++],o=(r[h>>>24]<<24|r[y>>>16&255]<<16|r[f>>>8&255]<<8|r[255&l])^e[g++],u=(r[y>>>24]<<24|r[f>>>16&255]<<16|r[l>>>8&255]<<8|r[255&h])^e[g++],[i>>>=0,s>>>=0,o>>>=0,u>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var n=[],r=[],a=[[],[],[],[]],i=[[],[],[],[]],s=0,o=0,u=0;u<256;++u){var c=o^o<<1^o<<2^o<<3^o<<4;c=c>>>8^255&c^99,n[s]=c,r[c]=s;var A=t[s],d=t[A],p=t[d],f=257*t[c]^16843008*c;a[0][s]=f<<24|f>>>8,a[1][s]=f<<16|f>>>16,a[2][s]=f<<8|f>>>24,a[3][s]=f,f=16843009*p^65537*d^257*A^16843008*s,i[0][c]=f<<24|f>>>8,i[1][c]=f<<16|f>>>16,i[2][c]=f<<8|f>>>24,i[3][c]=f,0===s?s=o=1:(s=A^t[t[t[p^A]]],o^=t[t[o]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:a,INV_SUB_MIX:i}}();function c(t){this._key=a(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,n=e+6,r=4*(n+1),a=[],i=0;i<e;i++)a[i]=t[i];for(i=e;i<r;i++){var s=a[i-1];i%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=o[i/e|0]<<24):e>6&&i%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),a[i]=a[i-e]^s}for(var c=[],A=0;A<r;A++){var d=r-A,p=a[d-(A%4?0:4)];c[A]=A<4||d<=4?p:u.INV_SUB_MIX[0][u.SBOX[p>>>24]]^u.INV_SUB_MIX[1][u.SBOX[p>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[p>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&p]]}this._nRounds=n,this._keySchedule=a,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return s(t=a(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),n=r.allocUnsafe(16);return n.writeUInt32BE(e[0],0),n.writeUInt32BE(e[1],4),n.writeUInt32BE(e[2],8),n.writeUInt32BE(e[3],12),n},c.prototype.decryptBlock=function(t){var e=(t=a(t))[1];t[1]=t[3],t[3]=e;var n=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},c.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=c},function(t,e,n){var r=n(1).Buffer,a=n(61);t.exports=function(t,e,n,i){if(r.isBuffer(t)||(t=r.from(t,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=n/8,o=r.alloc(s),u=r.alloc(i||0),c=r.alloc(0);s>0||i>0;){var A=new a;A.update(c),A.update(t),e&&A.update(e),c=A.digest();var d=0;if(s>0){var p=o.length-s;d=Math.min(s,c.length),c.copy(o,p,0,d),s-=d}if(d<c.length&&i>0){var f=u.length-i,l=Math.min(i,c.length-d);c.copy(u,f,d,d+l),i-=l}}return c.fill(0),{key:o,iv:u}}},function(t,e,n){"use strict";var r=n(3),a=n(9),i=a.getNAF,s=a.getJSF,o=a.assert;function u(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){o(t.precomputed);var n=t._getDoubles(),r=i(e,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;var s,u,c=[];for(s=0;s<r.length;s+=n.step){u=0;for(var A=s+n.step-1;A>=s;A--)u=(u<<1)+r[A];c.push(u)}for(var d=this.jpoint(null,null,null),p=this.jpoint(null,null,null),f=a;f>0;f--){for(s=0;s<c.length;s++)(u=c[s])===f?p=p.mixedAdd(n.points[s]):u===-f&&(p=p.mixedAdd(n.points[s].neg()));d=d.add(p)}return d.toP()},u.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var a=r.points,s=i(e,n,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var A=0;c>=0&&0===s[c];c--)A++;if(c>=0&&A++,u=u.dblp(A),c<0)break;var d=s[c];o(0!==d),u="affine"===t.type?d>0?u.mixedAdd(a[d-1>>1]):u.mixedAdd(a[-d-1>>1].neg()):d>0?u.add(a[d-1>>1]):u.add(a[-d-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,n,r,a){var o,u,c,A=this._wnafT1,d=this._wnafT2,p=this._wnafT3,f=0;for(o=0;o<r;o++){var l=(c=e[o])._getNAFPoints(t);A[o]=l.wnd,d[o]=l.points}for(o=r-1;o>=1;o-=2){var h=o-1,y=o;if(1===A[h]&&1===A[y]){var g=[e[h],null,null,e[y]];0===e[h].y.cmp(e[y].y)?(g[1]=e[h].add(e[y]),g[2]=e[h].toJ().mixedAdd(e[y].neg())):0===e[h].y.cmp(e[y].y.redNeg())?(g[1]=e[h].toJ().mixedAdd(e[y]),g[2]=e[h].add(e[y].neg())):(g[1]=e[h].toJ().mixedAdd(e[y]),g[2]=e[h].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],m=s(n[h],n[y]);for(f=Math.max(m[0].length,f),p[h]=new Array(f),p[y]=new Array(f),u=0;u<f;u++){var I=0|m[0][u],C=0|m[1][u];p[h][u]=b[3*(I+1)+(C+1)],p[y][u]=0,d[h]=g}}else p[h]=i(n[h],A[h],this._bitLength),p[y]=i(n[y],A[y],this._bitLength),f=Math.max(p[h].length,f),f=Math.max(p[y].length,f)}var v=this.jpoint(null,null,null),w=this._wnafT4;for(o=f;o>=0;o--){for(var E=0;o>=0;){var B=!0;for(u=0;u<r;u++)w[u]=0|p[u][o],0!==w[u]&&(B=!1);if(!B)break;E++,o--}if(o>=0&&E++,v=v.dblp(E),o<0)break;for(u=0;u<r;u++){var Q=w[u];0!==Q&&(Q>0?c=d[u][Q-1>>1]:Q<0&&(c=d[u][-Q-1>>1].neg()),v="affine"===c.type?v.mixedAdd(c):v.add(c))}}for(o=0;o<r;o++)d[o]=null;return a?v:v.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=a.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?o(t[t.length-1]%2==0):7===t[0]&&o(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return a.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a<e;a+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),a=1;a<n;a++)e[a]=e[a-1].add(r);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=n(316),i=n(327),s=n(328),o=n(67),u=n(65),c=n(1).Buffer;function A(t){var e;"object"!==r(t)||c.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=c.from(t));var n,A,d=s(t,e),p=d.tag,f=d.data;switch(p){case"CERTIFICATE":A=a.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=a.PublicKey.decode(f,"der")),n=A.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=a.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+p);case"ENCRYPTED PRIVATE KEY":f=function(t,e){var n=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,A=t.subjectPrivateKey,d=parseInt(a.split("-")[1],10)/8,p=u.pbkdf2Sync(e,n,r,d,"sha1"),f=o.createDecipheriv(a,p,s),l=[];return l.push(f.update(A)),l.push(f.final()),c.concat(l)}(f=a.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(n=(A=a.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:a.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=a.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+p);case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=a.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+p)}}t.exports=A,A.signature=a.signature},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(t){var r,a,i;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
8
+ var r=n(75),a=n(76),i=n(51);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return d(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|l(e,n),a=(t=o(t,r)).write(e,n);a!==r&&(t=t.slice(0,a));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|f(e.length);return 0===(t=o(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?o(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function A(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function d(t,e){if(A(e),t=o(t,e<0?0:0|f(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|f(e.length);t=o(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function l(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function h(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,n);case"utf8":case"utf-8":return Q(this,e,n);case"ascii":return M(this,e,n);case"latin1":case"binary":return _(this,e,n);case"base64":return B(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,a){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:b(t,e,n,r,a);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,r,a){var i,s=1,o=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,o/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(a){var A=-1;for(i=n;i<o;i++)if(c(t,i)===c(e,-1===A?0:i-A)){if(-1===A&&(A=i),i-A+1===u)return A*s}else-1!==A&&(i-=i-A),A=-1}else for(n+u>o&&(n=o-u),i=n;i>=0;i--){for(var d=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){d=!1;break}if(d)return i}return-1}function m(t,e,n,r){n=Number(n)||0;var a=t.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var o=parseInt(e.substr(2*s,2),16);if(isNaN(o))return s;t[n+s]=o}return s}function I(t,e,n,r){return P(j(e,t.length-n),t,n,r)}function C(t,e,n,r){return P(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function v(t,e,n,r){return C(t,e,n,r)}function w(t,e,n,r){return P(F(e),t,n,r)}function E(t,e,n,r){return P(function(t,e){for(var n,r,a,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(e,t.length-n),t,n,r)}function B(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Q(t,e,n){n=Math.min(t.length,n);for(var r=[],a=e;a<n;){var i,s,o,u,c=t[a],A=null,d=c>239?4:c>223?3:c>191?2:1;if(a+d<=n)switch(d){case 1:c<128&&(A=c);break;case 2:128==(192&(i=t[a+1]))&&(u=(31&c)<<6|63&i)>127&&(A=u);break;case 3:i=t[a+1],s=t[a+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(A=u);break;case 4:i=t[a+1],s=t[a+2],o=t[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(A=u)}null===A?(A=65533,d=1):A>65535&&(A-=65536,r.push(A>>>10&1023|55296),A=56320|1023&A),r.push(A),a+=d}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},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(t,e,n){return function(t,e,n,r){return A(e),e<=0?o(t,e):void 0!==n?"string"==typeof r?o(t,e).fill(n,r):o(t,e).fill(n):o(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return d(null,t)},u.allocUnsafeSlow=function(t){return d(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,a=0,i=Math.min(n,r);a<i;++a)if(t[a]!==e[a]){n=t[a],r=e[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var s=t[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,a),a+=s.length}return r},u.byteLength=l,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Q(this,0,t):h.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,a){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||n>t.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=n)return 0;if(r>=a)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(a>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),o=Math.min(i,s),c=this.slice(r,a),A=t.slice(e,n),d=0;d<o;++d)if(c[d]!==A[d]){i=c[d],s=A[d];break}return i<s?-1:s<i?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return m(this,t,e,n);case"utf8":case"utf-8":return I(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return v(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function M(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(127&t[a]);return r}function _(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(t[a]);return r}function x(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=e;i<n;++i)a+=U(t[i]);return a}function k(t,e,n){for(var r=t.slice(e,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function S(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,a,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(t.length-n,2);a<i;++a)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(t.length-n,4);a<i;++a)t[n+a]=e>>>8*(r?a:3-a)&255}function T(t,e,n,r,a,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(t,e,n,r,i){return i||T(t,0,n,4),a.write(t,e,n,r,23,4),n+4}function H(t,e,n,r,i){return i||T(t,0,n,8),a.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var a=e-t;n=new u(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t+--e],a=1;e>0&&(a*=256);)r+=this[t+--e]*a;return r},u.prototype.readUInt8=function(t,e){return e||S(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||S(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||S(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=e,a=1,i=this[t+--r];r>0&&(a*=256);)i+=this[t+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||S(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||S(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||S(t,4,this.length),a.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||S(t,4,this.length),a.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||S(t,8,this.length),a.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||S(t,8,this.length),a.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[e]=255&t;++i<n&&(a*=256);)this[e+i]=t/a&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||D(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);D(this,t,e,n,a-1,-a)}var i=0,s=1,o=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===o&&0!==this[e+i-1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);D(this,t,e,n,a-1,-a)}var i=n-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return O(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return O(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return H(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return H(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var a,i=r-n;if(this===t&&n<e&&e<r)for(a=i-1;a>=0;--a)t[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=u.isBuffer(t)?t:j(new u(t,r).toString()),o=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%o]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var n;e=e||1/0;for(var r=t.length,a=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=t.length);++a)e[a+n]=t[a];return a}}).call(this,n(5))},function(t,e,n){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,r){"use strict";function a(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function s(t,e,n){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var o;"object"===e(t)?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;try{o=n(293).Buffer}catch(t){}function u(t,e,n){for(var r=0,i=Math.min(t.length,n),s=0,o=e;o<i;o++){var u,c=t.charCodeAt(o)-48;r<<=4,r|=u=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,s|=u}return a(!(240&s),"Invalid character in "+t),r}function c(t,e,n,r){for(var i=0,s=0,o=Math.min(t.length,n),u=e;u<o;u++){var c=t.charCodeAt(u)-48;i*=r,s=c>=49?c-49+10:c>=17?c-17+10:c,a(c>=0&&s<r,"Invalid character"),i+=s}return i}function A(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}s.isBN=function(t){return t instanceof s||null!==t&&"object"===e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,n,r){if("number"==typeof t)return this._initNumber(t,n,r);if("object"===e(t))return this._initArray(t,n,r);"hex"===n&&(n=16),a(n===(0|n)&&n>=2&&n<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===n?this._parseHex(t,i):this._parseBase(t,n,i),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),n,r)},s.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(a(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},s.prototype._initArray=function(t,e,n){if(a("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,s,o=0;if("be"===n)for(r=t.length-1,i=0;r>=0;r-=3)s=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===n)for(r=0,i=0;r<t.length;r+=3)s=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this._strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,a,i=0;for(n=t.length-6,r=0;n>=e;n-=6)a=u(t,n,n+6),this.words[r]|=a<<i&67108863,this.words[r+1]|=a>>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);n+6!==e&&(a=u(t,e,n+6),this.words[r]|=a<<i&67108863,this.words[r+1]|=a>>>26-i&4194303),this._strip()},s.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=t.length-n,s=i%r,o=Math.min(i,i-s)+n,u=0,A=n;A<o;A+=r)u=c(t,A,A+r,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(t,A,t.length,e),A=0;A<s;A++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){A(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?s.prototype[Symbol.for("nodejs.util.inspect.custom")]=d:s.prototype.inspect=d;var p=["","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"],f=[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],l=[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];s.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,i=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<r|i)).toString(16);n=0!==(i=o>>>24-r&16777215)||s!==this.length-1?p[6-u.length]+u+n:u+n,(r+=2)>=26&&(r-=26,s--)}for(0!==i&&(n=i.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],A=l[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modrn(A).toString(t);n=(d=d.idivn(A)).isZero()?h+n:p[c-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}a(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function h(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var a=0|t.words[0],i=0|e.words[0],s=a*i,o=67108863&s,u=s/67108864|0;n.words[0]=o;for(var c=1;c<r;c++){for(var A=u>>>26,d=67108863&u,p=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=p;f++){var l=c-f|0;A+=(s=(a=0|t.words[l])*(i=0|e.words[f])+d)/67108864|0,d=67108863&s}n.words[c]=0|d,u=0|A}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}s.prototype.toArrayLike=function(t,e,n){this._strip();var r=this.byteLength(),i=n||Math.max(1,r);a(r<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,r),s},s.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|r;t[n++]=255&s,n<t.length&&(t[n++]=s>>8&255),n<t.length&&(t[n++]=s>>16&255),6===i?(n<t.length&&(t[n++]=s>>24&255),r=0,i=0):(r=s>>>24,i+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|r;t[n--]=255&s,n>=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===i?(n>=0&&(t[n--]=s>>24&255),r=0,i=0):(r=s>>>24,i+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return a(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return a(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return a(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){a("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){a("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<r:this.words[n]&~(1<<r),this._strip()},s.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var a=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<n.length;i++)e=(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var y=function(t,e,n){var r,a,i,s=t.words,o=e.words,u=n.words,c=0,A=0|s[0],d=8191&A,p=A>>>13,f=0|s[1],l=8191&f,h=f>>>13,y=0|s[2],g=8191&y,b=y>>>13,m=0|s[3],I=8191&m,C=m>>>13,v=0|s[4],w=8191&v,E=v>>>13,B=0|s[5],Q=8191&B,M=B>>>13,_=0|s[6],x=8191&_,k=_>>>13,S=0|s[7],D=8191&S,R=S>>>13,N=0|s[8],T=8191&N,O=N>>>13,H=0|s[9],L=8191&H,U=H>>>13,j=0|o[0],F=8191&j,P=j>>>13,G=0|o[1],q=8191&G,Y=G>>>13,K=0|o[2],z=8191&K,J=K>>>13,V=0|o[3],W=8191&V,Z=V>>>13,X=0|o[4],$=8191&X,tt=X>>>13,et=0|o[5],nt=8191&et,rt=et>>>13,at=0|o[6],it=8191&at,st=at>>>13,ot=0|o[7],ut=8191&ot,ct=ot>>>13,At=0|o[8],dt=8191&At,pt=At>>>13,ft=0|o[9],lt=8191&ft,ht=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var yt=(c+(r=Math.imul(d,F))|0)+((8191&(a=(a=Math.imul(d,P))+Math.imul(p,F)|0))<<13)|0;c=((i=Math.imul(p,P))+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(l,F),a=(a=Math.imul(l,P))+Math.imul(h,F)|0,i=Math.imul(h,P);var gt=(c+(r=r+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(p,q)|0))<<13)|0;c=((i=i+Math.imul(p,Y)|0)+(a>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,F),a=(a=Math.imul(g,P))+Math.imul(b,F)|0,i=Math.imul(b,P),r=r+Math.imul(l,q)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(h,q)|0,i=i+Math.imul(h,Y)|0;var bt=(c+(r=r+Math.imul(d,z)|0)|0)+((8191&(a=(a=a+Math.imul(d,J)|0)+Math.imul(p,z)|0))<<13)|0;c=((i=i+Math.imul(p,J)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(I,F),a=(a=Math.imul(I,P))+Math.imul(C,F)|0,i=Math.imul(C,P),r=r+Math.imul(g,q)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,Y)|0,r=r+Math.imul(l,z)|0,a=(a=a+Math.imul(l,J)|0)+Math.imul(h,z)|0,i=i+Math.imul(h,J)|0;var mt=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(p,W)|0))<<13)|0;c=((i=i+Math.imul(p,Z)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(w,F),a=(a=Math.imul(w,P))+Math.imul(E,F)|0,i=Math.imul(E,P),r=r+Math.imul(I,q)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(C,q)|0,i=i+Math.imul(C,Y)|0,r=r+Math.imul(g,z)|0,a=(a=a+Math.imul(g,J)|0)+Math.imul(b,z)|0,i=i+Math.imul(b,J)|0,r=r+Math.imul(l,W)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(h,W)|0,i=i+Math.imul(h,Z)|0;var It=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,tt)|0)+Math.imul(p,$)|0))<<13)|0;c=((i=i+Math.imul(p,tt)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(Q,F),a=(a=Math.imul(Q,P))+Math.imul(M,F)|0,i=Math.imul(M,P),r=r+Math.imul(w,q)|0,a=(a=a+Math.imul(w,Y)|0)+Math.imul(E,q)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(I,z)|0,a=(a=a+Math.imul(I,J)|0)+Math.imul(C,z)|0,i=i+Math.imul(C,J)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(b,W)|0,i=i+Math.imul(b,Z)|0,r=r+Math.imul(l,$)|0,a=(a=a+Math.imul(l,tt)|0)+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0;var Ct=(c+(r=r+Math.imul(d,nt)|0)|0)+((8191&(a=(a=a+Math.imul(d,rt)|0)+Math.imul(p,nt)|0))<<13)|0;c=((i=i+Math.imul(p,rt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(x,F),a=(a=Math.imul(x,P))+Math.imul(k,F)|0,i=Math.imul(k,P),r=r+Math.imul(Q,q)|0,a=(a=a+Math.imul(Q,Y)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(w,z)|0,a=(a=a+Math.imul(w,J)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,J)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,Z)|0,r=r+Math.imul(g,$)|0,a=(a=a+Math.imul(g,tt)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,tt)|0,r=r+Math.imul(l,nt)|0,a=(a=a+Math.imul(l,rt)|0)+Math.imul(h,nt)|0,i=i+Math.imul(h,rt)|0;var vt=(c+(r=r+Math.imul(d,it)|0)|0)+((8191&(a=(a=a+Math.imul(d,st)|0)+Math.imul(p,it)|0))<<13)|0;c=((i=i+Math.imul(p,st)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(D,F),a=(a=Math.imul(D,P))+Math.imul(R,F)|0,i=Math.imul(R,P),r=r+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(Q,z)|0,a=(a=a+Math.imul(Q,J)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,J)|0,r=r+Math.imul(w,W)|0,a=(a=a+Math.imul(w,Z)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(I,$)|0,a=(a=a+Math.imul(I,tt)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,tt)|0,r=r+Math.imul(g,nt)|0,a=(a=a+Math.imul(g,rt)|0)+Math.imul(b,nt)|0,i=i+Math.imul(b,rt)|0,r=r+Math.imul(l,it)|0,a=(a=a+Math.imul(l,st)|0)+Math.imul(h,it)|0,i=i+Math.imul(h,st)|0;var wt=(c+(r=r+Math.imul(d,ut)|0)|0)+((8191&(a=(a=a+Math.imul(d,ct)|0)+Math.imul(p,ut)|0))<<13)|0;c=((i=i+Math.imul(p,ct)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(T,F),a=(a=Math.imul(T,P))+Math.imul(O,F)|0,i=Math.imul(O,P),r=r+Math.imul(D,q)|0,a=(a=a+Math.imul(D,Y)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(x,z)|0,a=(a=a+Math.imul(x,J)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,J)|0,r=r+Math.imul(Q,W)|0,a=(a=a+Math.imul(Q,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(w,$)|0,a=(a=a+Math.imul(w,tt)|0)+Math.imul(E,$)|0,i=i+Math.imul(E,tt)|0,r=r+Math.imul(I,nt)|0,a=(a=a+Math.imul(I,rt)|0)+Math.imul(C,nt)|0,i=i+Math.imul(C,rt)|0,r=r+Math.imul(g,it)|0,a=(a=a+Math.imul(g,st)|0)+Math.imul(b,it)|0,i=i+Math.imul(b,st)|0,r=r+Math.imul(l,ut)|0,a=(a=a+Math.imul(l,ct)|0)+Math.imul(h,ut)|0,i=i+Math.imul(h,ct)|0;var Et=(c+(r=r+Math.imul(d,dt)|0)|0)+((8191&(a=(a=a+Math.imul(d,pt)|0)+Math.imul(p,dt)|0))<<13)|0;c=((i=i+Math.imul(p,pt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,F),a=(a=Math.imul(L,P))+Math.imul(U,F)|0,i=Math.imul(U,P),r=r+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(O,q)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(D,z)|0,a=(a=a+Math.imul(D,J)|0)+Math.imul(R,z)|0,i=i+Math.imul(R,J)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(Q,$)|0,a=(a=a+Math.imul(Q,tt)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,r=r+Math.imul(w,nt)|0,a=(a=a+Math.imul(w,rt)|0)+Math.imul(E,nt)|0,i=i+Math.imul(E,rt)|0,r=r+Math.imul(I,it)|0,a=(a=a+Math.imul(I,st)|0)+Math.imul(C,it)|0,i=i+Math.imul(C,st)|0,r=r+Math.imul(g,ut)|0,a=(a=a+Math.imul(g,ct)|0)+Math.imul(b,ut)|0,i=i+Math.imul(b,ct)|0,r=r+Math.imul(l,dt)|0,a=(a=a+Math.imul(l,pt)|0)+Math.imul(h,dt)|0,i=i+Math.imul(h,pt)|0;var Bt=(c+(r=r+Math.imul(d,lt)|0)|0)+((8191&(a=(a=a+Math.imul(d,ht)|0)+Math.imul(p,lt)|0))<<13)|0;c=((i=i+Math.imul(p,ht)|0)+(a>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(L,q),a=(a=Math.imul(L,Y))+Math.imul(U,q)|0,i=Math.imul(U,Y),r=r+Math.imul(T,z)|0,a=(a=a+Math.imul(T,J)|0)+Math.imul(O,z)|0,i=i+Math.imul(O,J)|0,r=r+Math.imul(D,W)|0,a=(a=a+Math.imul(D,Z)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(x,$)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,tt)|0,r=r+Math.imul(Q,nt)|0,a=(a=a+Math.imul(Q,rt)|0)+Math.imul(M,nt)|0,i=i+Math.imul(M,rt)|0,r=r+Math.imul(w,it)|0,a=(a=a+Math.imul(w,st)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,st)|0,r=r+Math.imul(I,ut)|0,a=(a=a+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,i=i+Math.imul(C,ct)|0,r=r+Math.imul(g,dt)|0,a=(a=a+Math.imul(g,pt)|0)+Math.imul(b,dt)|0,i=i+Math.imul(b,pt)|0;var Qt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(a=(a=a+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((i=i+Math.imul(h,ht)|0)+(a>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,r=Math.imul(L,z),a=(a=Math.imul(L,J))+Math.imul(U,z)|0,i=Math.imul(U,J),r=r+Math.imul(T,W)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(D,$)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,r=r+Math.imul(x,nt)|0,a=(a=a+Math.imul(x,rt)|0)+Math.imul(k,nt)|0,i=i+Math.imul(k,rt)|0,r=r+Math.imul(Q,it)|0,a=(a=a+Math.imul(Q,st)|0)+Math.imul(M,it)|0,i=i+Math.imul(M,st)|0,r=r+Math.imul(w,ut)|0,a=(a=a+Math.imul(w,ct)|0)+Math.imul(E,ut)|0,i=i+Math.imul(E,ct)|0,r=r+Math.imul(I,dt)|0,a=(a=a+Math.imul(I,pt)|0)+Math.imul(C,dt)|0,i=i+Math.imul(C,pt)|0;var Mt=(c+(r=r+Math.imul(g,lt)|0)|0)+((8191&(a=(a=a+Math.imul(g,ht)|0)+Math.imul(b,lt)|0))<<13)|0;c=((i=i+Math.imul(b,ht)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,W),a=(a=Math.imul(L,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(T,$)|0,a=(a=a+Math.imul(T,tt)|0)+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,r=r+Math.imul(D,nt)|0,a=(a=a+Math.imul(D,rt)|0)+Math.imul(R,nt)|0,i=i+Math.imul(R,rt)|0,r=r+Math.imul(x,it)|0,a=(a=a+Math.imul(x,st)|0)+Math.imul(k,it)|0,i=i+Math.imul(k,st)|0,r=r+Math.imul(Q,ut)|0,a=(a=a+Math.imul(Q,ct)|0)+Math.imul(M,ut)|0,i=i+Math.imul(M,ct)|0,r=r+Math.imul(w,dt)|0,a=(a=a+Math.imul(w,pt)|0)+Math.imul(E,dt)|0,i=i+Math.imul(E,pt)|0;var _t=(c+(r=r+Math.imul(I,lt)|0)|0)+((8191&(a=(a=a+Math.imul(I,ht)|0)+Math.imul(C,lt)|0))<<13)|0;c=((i=i+Math.imul(C,ht)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(L,$),a=(a=Math.imul(L,tt))+Math.imul(U,$)|0,i=Math.imul(U,tt),r=r+Math.imul(T,nt)|0,a=(a=a+Math.imul(T,rt)|0)+Math.imul(O,nt)|0,i=i+Math.imul(O,rt)|0,r=r+Math.imul(D,it)|0,a=(a=a+Math.imul(D,st)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,st)|0,r=r+Math.imul(x,ut)|0,a=(a=a+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,i=i+Math.imul(k,ct)|0,r=r+Math.imul(Q,dt)|0,a=(a=a+Math.imul(Q,pt)|0)+Math.imul(M,dt)|0,i=i+Math.imul(M,pt)|0;var xt=(c+(r=r+Math.imul(w,lt)|0)|0)+((8191&(a=(a=a+Math.imul(w,ht)|0)+Math.imul(E,lt)|0))<<13)|0;c=((i=i+Math.imul(E,ht)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,nt),a=(a=Math.imul(L,rt))+Math.imul(U,nt)|0,i=Math.imul(U,rt),r=r+Math.imul(T,it)|0,a=(a=a+Math.imul(T,st)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,st)|0,r=r+Math.imul(D,ut)|0,a=(a=a+Math.imul(D,ct)|0)+Math.imul(R,ut)|0,i=i+Math.imul(R,ct)|0,r=r+Math.imul(x,dt)|0,a=(a=a+Math.imul(x,pt)|0)+Math.imul(k,dt)|0,i=i+Math.imul(k,pt)|0;var kt=(c+(r=r+Math.imul(Q,lt)|0)|0)+((8191&(a=(a=a+Math.imul(Q,ht)|0)+Math.imul(M,lt)|0))<<13)|0;c=((i=i+Math.imul(M,ht)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,it),a=(a=Math.imul(L,st))+Math.imul(U,it)|0,i=Math.imul(U,st),r=r+Math.imul(T,ut)|0,a=(a=a+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,i=i+Math.imul(O,ct)|0,r=r+Math.imul(D,dt)|0,a=(a=a+Math.imul(D,pt)|0)+Math.imul(R,dt)|0,i=i+Math.imul(R,pt)|0;var St=(c+(r=r+Math.imul(x,lt)|0)|0)+((8191&(a=(a=a+Math.imul(x,ht)|0)+Math.imul(k,lt)|0))<<13)|0;c=((i=i+Math.imul(k,ht)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(L,ut),a=(a=Math.imul(L,ct))+Math.imul(U,ut)|0,i=Math.imul(U,ct),r=r+Math.imul(T,dt)|0,a=(a=a+Math.imul(T,pt)|0)+Math.imul(O,dt)|0,i=i+Math.imul(O,pt)|0;var Dt=(c+(r=r+Math.imul(D,lt)|0)|0)+((8191&(a=(a=a+Math.imul(D,ht)|0)+Math.imul(R,lt)|0))<<13)|0;c=((i=i+Math.imul(R,ht)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(L,dt),a=(a=Math.imul(L,pt))+Math.imul(U,dt)|0,i=Math.imul(U,pt);var Rt=(c+(r=r+Math.imul(T,lt)|0)|0)+((8191&(a=(a=a+Math.imul(T,ht)|0)+Math.imul(O,lt)|0))<<13)|0;c=((i=i+Math.imul(O,ht)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(c+(r=Math.imul(L,lt))|0)+((8191&(a=(a=Math.imul(L,ht))+Math.imul(U,lt)|0))<<13)|0;return c=((i=Math.imul(U,ht))+(a>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=yt,u[1]=gt,u[2]=bt,u[3]=mt,u[4]=It,u[5]=Ct,u[6]=vt,u[7]=wt,u[8]=Et,u[9]=Bt,u[10]=Qt,u[11]=Mt,u[12]=_t,u[13]=xt,u[14]=kt,u[15]=St,u[16]=Dt,u[17]=Rt,u[18]=Nt,0!==c&&(u[19]=c,n.length++),n};function g(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,a=0,i=0;i<n.length-1;i++){var s=a;a=0;for(var o=67108863&r,u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var A=i-c,d=(0|t.words[A])*(0|e.words[c]),p=67108863&d;o=67108863&(p=p+o|0),a+=(s=(s=s+(d/67108864|0)|0)+(p>>>26)|0)>>>26,s&=67108863}n.words[i]=o,r=s,s=a}return 0!==r?n.words[i]=r:n.length--,n._strip()}function b(t,e,n){return g(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(y=h),s.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):n<63?h(this,t,e):n<1024?g(this,t,e):b(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},m.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,a=0;a<e;a++)r|=(1&t)<<e-a-1,t>>=1;return r},m.prototype.permute=function(t,e,n,r,a,i){for(var s=0;s<i;s++)r[s]=e[t[s]],a[s]=n[t[s]]},m.prototype.transform=function(t,e,n,r,a,i){this.permute(i,t,e,n,r,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),A=0;A<a;A+=o)for(var d=u,p=c,f=0;f<s;f++){var l=n[A+f],h=r[A+f],y=n[A+f+s],g=r[A+f+s],b=d*y-p*g;g=d*g+p*y,y=b,n[A+f]=l+y,r[A+f]=h+g,n[A+f+s]=l-y,r[A+f+s]=h-g,f!==o&&(b=u*d-c*p,p=u*p+c*d,d=b)}},m.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,a=0;for(n=n/2|0;n;n>>>=1)a++;return 1<<a+1+r},m.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var a=t[r];t[r]=t[n-r-1],t[n-r-1]=a,a=e[r],e[r]=-e[n-r-1],e[n-r-1]=-a}},m.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var a=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&a,n=a<67108864?0:a/67108864|0}return t},m.prototype.convert13b=function(t,e,n,r){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<r;++s)n[s]=0;a(0===i),a(0==(-8192&i))},m.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},m.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(r),i=this.stub(r),s=new Array(r),o=new Array(r),u=new Array(r),c=new Array(r),A=new Array(r),d=new Array(r),p=n.words;p.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,o,u,r,a),this.transform(c,i,A,d,r,a);for(var f=0;f<r;f++){var l=o[f]*A[f]-u[f]*d[f];u[f]=o[f]*d[f]+u[f]*A[f],o[f]=l}return this.conjugate(o,u,r),this.transform(o,u,p,i,r,a),this.conjugate(p,i,r),this.normalize13b(p,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),b(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),a("number"==typeof t),a(t<67108864);for(var n=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[r]=67108863&s}return 0!==n&&(this.words[r]=n,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,a=n%26;e[n]=t.words[r]>>>a&1}return e}(t);if(0===e.length)return new s(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var a=n.sqr();r<e.length;r++,a=a.sqr())0!==e[r]&&(n=n.mul(a));return n},s.prototype.iushln=function(t){a("number"==typeof t&&t>=0);var e,n=t%26,r=(t-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var o=this.words[e]&i,u=(0|this.words[e])-o<<n;this.words[e]=u|s,s=o>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this._strip()},s.prototype.ishln=function(t){return a(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,n){var r;a("number"==typeof t&&t>=0),r=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<<i,u=n;if(r-=s,r=Math.max(0,r),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var A=0;for(c=this.length-1;c>=0&&(0!==A||c>=r);c--){var d=0|this.words[c];this.words[c]=A<<26-i|d>>>i,A=d&o}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,n){return a(0===this.negative),this.iushrn(t,e,n)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){a("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,r=1<<e;return!(this.length<=n)&&!!(this.words[n]&r)},s.prototype.imaskn=function(t){a("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return a("number"==typeof t),a(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(a("number"==typeof t),a(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,n){var r,i,s=t.length+n;this._expand(s);var o=0;for(r=0;r<t.length;r++){i=(0|this.words[r+n])+o;var u=(0|t.words[r])*e;o=((i-=67108863&u)>>26)-(u/67108864|0),this.words[r+n]=67108863&i}for(;r<this.length-n;r++)o=(i=(0|this.words[r+n])+o)>>26,this.words[r+n]=67108863&i;if(0===o)return this._strip();for(a(-1===o),o=0,r=0;r<this.length;r++)o=(i=-(0|this.words[r])+o)>>26,this.words[r]=67108863&i;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),a=t,i=0|a.words[a.length-1];0!==(n=26-this._countBits(i))&&(a=a.ushln(n),r.iushln(n),i=0|a.words[a.length-1]);var o,u=r.length-a.length;if("mod"!==e){(o=new s(null)).length=u+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var A=r.clone()._ishlnsubmul(a,1,u);0===A.negative&&(r=A,o&&(o.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(p=Math.min(p/i|0,67108863),r._ishlnsubmul(a,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=p)}return o&&o._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:o||null,mod:r}},s.prototype.divmod=function(t,e,n){return a(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(r=o.div.neg()),"div"!==e&&(i=o.mod.neg(),n&&0!==i.negative&&i.iadd(t)),{div:r,mod:i}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(i=o.mod.neg(),n&&0!==i.negative&&i.isub(t)),{div:o.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var r,i,o},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),a=t.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),a(t<=67108863);for(var n=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(n*r+(0|this.words[i]))%t;return e?-r:r},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),a(t<=67108863);for(var n=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*n;this.words[r]=i/t|0,n=i%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){a(0===t.negative),a(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new s(1),i=new s(0),o=new s(0),u=new s(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var A=n.clone(),d=e.clone();!e.isZero();){for(var p=0,f=1;0==(e.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(A),i.isub(d)),r.iushrn(1),i.iushrn(1);for(var l=0,h=1;0==(n.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(n.iushrn(l);l-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(A),u.isub(d)),o.iushrn(1),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),r.isub(o),i.isub(u)):(n.isub(e),o.isub(r),u.isub(i))}return{a:o,b:u,gcd:n.iushln(c)}},s.prototype._invmp=function(t){a(0===t.negative),a(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,i=new s(1),o=new s(0),u=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,A=1;0==(e.words[0]&A)&&c<26;++c,A<<=1);if(c>0)for(e.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(u),i.iushrn(1);for(var d=0,p=1;0==(n.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(n.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(o)):(n.isub(e),o.isub(i))}return(r=0===e.cmpn(1)?i:o).cmpn(0)<0&&r.iadd(t),r},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var a=e.cmp(n);if(a<0){var i=e;e=n,n=i}else if(0===a||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){a("number"==typeof t);var e=t%26,n=(t-e)/26,r=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var i=r,s=n;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),a(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],a=0|t.words[n];if(r!==a){r<a?e=-1:r>a&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new Q(t)},s.prototype.toRed=function(t){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return a(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return a(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var I={k256:null,p224:null,p192:null,p25519:null};function C(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Q(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else a(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){Q.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}C.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},C.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n._strip(),n},C.prototype.split=function(t,e){t.iushrn(this.n,0,e)},C.prototype.imulK=function(t){return t.imul(this.k)},i(v,C),v.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,t.words[r-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,C),i(E,C),i(B,C),B.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,a=67108863&r;r>>>=26,t.words[n]=a,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(I[t])return I[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new B}return I[t]=e,e},Q.prototype._verify1=function(t){a(0===t.negative,"red works only with positives"),a(t.red,"red works only with red numbers")},Q.prototype._verify2=function(t,e){a(0==(t.negative|e.negative),"red works only with positives"),a(t.red&&t.red===e.red,"red works only with red numbers")},Q.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(A(t,t.umod(this.m)._forceRed(this)),t)},Q.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Q.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},Q.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},Q.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},Q.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},Q.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},Q.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},Q.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},Q.prototype.isqr=function(t){return this.imul(t,t.clone())},Q.prototype.sqr=function(t){return this.mul(t,t)},Q.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(a(e%2==1),3===e){var n=this.m.add(new s(1)).iushrn(2);return this.pow(t,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);a(!r.isZero());var o=new s(1).toRed(this),u=o.redNeg(),c=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new s(2*A*A).toRed(this);0!==this.pow(A,c).cmp(u);)A.redIAdd(u);for(var d=this.pow(A,r),p=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),l=i;0!==f.cmp(o);){for(var h=f,y=0;0!==h.cmp(o);y++)h=h.redSqr();a(y<l);var g=this.pow(d,new s(1).iushln(l-y-1));p=p.redMul(g),d=g.redSqr(),f=f.redMul(d),l=y}return p},Q.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},Q.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new s(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var a=n[0],i=0,o=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],A=u-1;A>=0;A--){var d=c>>A&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==i?(i<<=1,i|=d,(4===++o||0===r&&0===A)&&(a=this.mul(a,n[i]),o=0,i=0)):o=0}u=26}return a},Q.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},Q.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new M(t)},i(M,Q),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(10)(t))},function(t,e,n){t.exports=n(154)},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){var n,r,a=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],A=!1,d=-1;function p(){A&&u&&(A=!1,u.length?c=u.concat(c):d=-1,c.length&&f())}function f(){if(!A){var t=o(p);A=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,A=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function h(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new l(t,e)),1!==c.length||A||o(f)},l.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=h,a.addListener=h,a.once=h,a.off=h,a.removeListener=h,a.removeAllListeners=h,a.emit=h,a.prependListener=h,a.prependOnceListener=h,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=n,n.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},function(t,e,n){"use strict";var r=e,a=n(3),i=n(8),s=n(127);r.assert=i,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var a=1<<e+1,i=t.clone(),s=0;s<r.length;s++){var o,u=i.andln(a-1);i.isOdd()?(o=u>(a>>1)-1?(a>>1)-u:u,i.isubn(o)):o=0,r[s]=o,i.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,a=0,i=0;t.cmpn(-a)>0||e.cmpn(-i)>0;){var s,o,u=t.andln(3)+a&3,c=e.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==c?u:-u,n[0].push(s),o=0==(1&c)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c,n[1].push(o),2*a===s+1&&(a=1-a),2*i===o+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new a(t,"hex","le")}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(8),a=n(0);function i(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=a,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),a=0;a<t.length;a+=2)n.push(parseInt(t[a]+t[a+1],16))}else for(var r=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(t,a)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++a)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(a=0;a<t.length;a++)n[a]=0|t[a];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=o(t[n].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var a=t[r];"little"===e&&(a=s(a)),n+=u(a.toString(16))}return n},e.zero2=o,e.zero8=u,e.join32=function(t,e,n,a){var i=n-e;r(i%4==0);for(var s=new Array(i/4),o=0,u=e;o<s.length;o++,u+=4){var c;c="big"===a?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[o]=c>>>0}return s},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,a=0;r<t.length;r++,a+=4){var i=t[r];"big"===e?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,a){return t+e+n+r+a>>>0},e.sum64=function(t,e,n,r){var a=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+a;t[e]=s>>>0,t[e+1]=i},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,a,i,s,o){var u=0,c=e;return u+=(c=c+r>>>0)<e?1:0,u+=(c=c+i>>>0)<i?1:0,t+n+a+s+(u+=(c=c+o>>>0)<o?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,a,i,s,o){return e+r+i+o>>>0},e.sum64_5_hi=function(t,e,n,r,a,i,s,o,u,c){var A=0,d=e;return A+=(d=d+r>>>0)<e?1:0,A+=(d=d+i>>>0)<i?1:0,A+=(d=d+o>>>0)<o?1:0,t+n+a+s+u+(A+=(d=d+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,a,i,s,o,u,c){return e+r+i+o+c>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){(function(n){var r,a,i,s;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}s=function(){return function t(e,n,r){function a(s,o){if(!n[s]){if(!e[s]){if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,(function(t){return a(e[s][1][t]||t)}),c,c.exports,t,e,n,r)}return n[s].exports}for(var i=!1,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.version="4.0.48"},{}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./utils/properties"),a=(i.isSigner=function(t){return r.isType(t,"Signer")},i);function i(){r.setType(this,"Signer")}n.Signer=a},{"./utils/properties":74}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./utils/bignumber");n.AddressZero="0x0000000000000000000000000000000000000000",n.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",n.EtherSymbol="Ξ";var a=r.bigNumberify(-1);n.NegativeOne=a;var i=r.bigNumberify(0);n.Zero=i;var s=r.bigNumberify(1);n.One=s;var o=r.bigNumberify(2);n.Two=o;var u=r.bigNumberify("1000000000000000000");n.WeiPerEther=u;var c=r.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");n.MaxUint256=c},{"./utils/bignumber":63}],4:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,u=t("./constants"),c=i(t("./errors")),A=t("./utils/abi-coder"),d=t("./utils/address"),p=t("./utils/bignumber"),f=t("./utils/bytes"),l=t("./utils/interface"),h=t("./utils/properties"),y=t("./providers/abstract-provider"),g=t("./abstract-signer"),b=(a(m,s=g.Signer),m.prototype.getAddress=function(){return Promise.resolve(this.address)},m.prototype._fail=function(t,e){return Promise.resolve().then((function(){c.throwError(t,c.UNSUPPORTED_OPERATION,{operation:e})}))},m.prototype.signMessage=function(t){return this._fail("VoidSigner cannot sign messages","signMessage")},m.prototype.sendTransaction=function(t){return this._fail("VoidSigner cannot sign transactions","sendTransaction")},m.prototype.connect=function(t){return new m(this.address,t)},m);function m(t,e){var n=s.call(this)||this;return h.defineReadOnly(n,"address",t),h.defineReadOnly(n,"provider",e),n}n.VoidSigner=b;var I={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function C(t,e,n){var r=t.interface.functions[e];return function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];var i={},s=null;if(e.length===r.inputs.length+1&&"object"==o(e[e.length-1]))for(var d in null!=(i=h.shallowCopy(e.pop())).blockTag&&(s=i.blockTag),delete i.blockTag,i)if(!I[d])throw new Error("unknown transaction override "+d);if(e.length!=r.inputs.length)throw new Error("incorrect number of arguments");return["data","to"].forEach((function(t){null!=i[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),i.to=t._deployed(s).then((function(){return t.addressPromise})),function t(e,n,r){if(Array.isArray(r)){var a=[];return r.forEach((function(r,i){var s=Array.isArray(n)?n[i]:n[r.name];a.push(t(e,s,r))})),Promise.all(a)}if("address"===r.type)return e.resolveName(n);if("tuple"===r.type)return t(e,n,r.components);var i=r.type.match(/(.*)(\[[0-9]*\]$)/);if(i){if(!Array.isArray(n))throw new Error("invalid value for array");var s=[],o={components:r.components,type:i[1]};return n.forEach((function(n){s.push(t(e,n,o))})),Promise.all(s)}return Promise.resolve(n)}(t.provider,e,r.inputs).then((function(e){if(i.data=r.encode(e),"call"===r.type)return n?Promise.resolve(u.Zero):(t.provider||c.throwError("call (constant functions) require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach((function(t){if(null!=i[t])throw new Error("call cannot override "+t)})),null==i.from&&t.signer&&(i.from=t.signer.getAddress()),t.provider.call(i,s).then((function(n){var a;f.hexDataLength(n)%32==4&&"0x08c379a0"===f.hexDataSlice(n,0,4)&&(a=A.defaultAbiCoder.decode(["string"],f.hexDataSlice(n,4)),c.throwError("call revert exception",c.CALL_EXCEPTION,{address:t.address,args:e,method:r.signature,errorSignature:"Error(string)",errorArgs:[a],reason:a,transaction:i}));try{var s=r.decode(n);return 1===r.outputs.length&&(s=s[0]),s}catch(a){throw"0x"===n&&0<r.outputs.length&&c.throwError("call exception",c.CALL_EXCEPTION,{address:t.address,method:r.signature,args:e}),a}})));if("transaction"===r.type)return n?(t.provider||c.throwError("estimate gas require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),null==i.from&&t.signer&&(i.from=t.signer.getAddress()),t.provider.estimateGas(i)):(null==i.gasLimit&&null!=r.gas&&(i.gasLimit=p.bigNumberify(r.gas).add(21e3)),t.signer||c.throwError("sending a transaction requires a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=i.from&&c.throwError("cannot override from in a transaction",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.signer.sendTransaction(i).then((function(e){var n=e.wait.bind(e);return e.wait=function(e){return n(e).then((function(e){return e.events=e.logs.map((function(n){var r=h.deepCopy(n),a=t.interface.parseLog(n);return a&&(r.args=a.values,r.decode=a.decode,r.event=a.name,r.eventSignature=a.signature),r.removeListener=function(){return t.provider},r.getBlock=function(){return t.provider.getBlock(e.blockHash)},r.getTransaction=function(){return t.provider.getTransaction(e.transactionHash)},r.getTransactionReceipt=function(){return Promise.resolve(e)},r})),e}))},e})));throw new Error("invalid type - "+r.type)}))}}function v(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.join(":"):""):"*"}var w=(E.prototype.deployed=function(){return this._deployed()},E.prototype._deployed=function(t){var e=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return e})):this._deployedPromise=this.provider.getCode(this.address,t).then((function(t){return"0x"===t&&c.throwError("contract not deployed",c.UNSUPPORTED_OPERATION,{contractAddress:e.address,operation:"getDeployed"}),e}))),this._deployedPromise},E.prototype.fallback=function(t){var e=this;this.signer||c.throwError("sending a transaction requires a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var n=h.shallowCopy(t||{});return["from","to"].forEach((function(t){null!=n[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),n.to=this.addressPromise,this.deployed().then((function(){return e.signer.sendTransaction(n)}))},E.prototype.connect=function(t){"string"==typeof t&&(t=new b(t,this.provider));var e=new E(this.address,this.interface,t);return this.deployTransaction&&h.defineReadOnly(e,"deployTransaction",this.deployTransaction),e},E.prototype.attach=function(t){return new E(t,this.interface,this.signer||this.provider)},E.isIndexed=function(t){return l.Interface.isIndexed(t)},E.prototype._getEventFilter=function(t){var e=this;if("string"==typeof t){if("*"===t)return{prepareEvent:function(t){var n=e.interface.parseLog(t);return n&&(t.args=n.values,t.decode=n.decode,t.event=n.name,t.eventSignature=n.signature),[t]},eventTag:"*",filter:{address:this.address}};-1!==t.indexOf("(")&&(t=A.formatSignature(A.parseSignature("event "+t)));var n=this.interface.events[t];n||c.throwError("unknown event - "+t,c.INVALID_ARGUMENT,{argumnet:"eventName",value:t});var r={address:this.address,topics:[n.topic]};return{prepareEvent:function(t){var e=n.decode(t.data,t.topics);t.args=e;var r=Array.prototype.slice.call(e);return r.push(t),r},event:n,eventTag:v(r),filter:r}}var a={address:this.address},i=null;if(t.topics&&t.topics[0])for(var s in a.topics=t.topics,this.interface.events)if(-1!==s.indexOf("(")){var o=this.interface.events[s];if(o.topic===t.topics[0].toLowerCase()){i=o;break}}return{prepareEvent:function(t){if(!i)return[t];var e=i.decode(t.data,t.topics);t.args=e;var n=Array.prototype.slice.call(e);return n.push(t),n},event:i,eventTag:v(a),filter:a}},E.prototype._addEventListener=function(t,e,n){var r=this;function a(n){var a=h.deepCopy(n),i=t.prepareEvent(a);t.event&&(a.decode=t.event.decode,a.event=t.event.name,a.eventSignature=t.event.signature),a.removeListener=function(){r.removeListener(t.filter,e)},a.getBlock=function(){return r.provider.getBlock(n.blockHash)},a.getTransaction=function(){return r.provider.getTransaction(n.transactionHash)},a.getTransactionReceipt=function(){return r.provider.getTransactionReceipt(n.transactionHash)},r.emit.apply(r,[t.filter].concat(i))}this.provider||c.throwError("events require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"once"}),this.provider.on(t.filter,a),this._events.push({eventFilter:t,listener:e,wrappedListener:a,once:n})},E.prototype.on=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!1),this},E.prototype.once=function(t,e){return this._addEventListener(this._getEventFilter(t),e,!0),this},E.prototype.addListener=function(t,e){return this.on(t,e)},E.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this.provider)return!1;var a=!1,i=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==i.eventTag||(setTimeout((function(){t.listener.apply(e,n)}),0),a=!0,!t.once)})),a},E.prototype.listenerCount=function(t){if(!this.provider)return 0;var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).length},E.prototype.listeners=function(t){if(!this.provider)return[];var e=this._getEventFilter(t);return this._events.filter((function(t){return t.eventFilter.eventTag===e.eventTag})).map((function(t){return t.listener}))},E.prototype.removeAllListeners=function(t){var e=this;if(!this.provider)return this;var n=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==n.eventTag||(e.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!1)})),this},E.prototype.removeListener=function(t,e){var n=this;if(!this.provider)return this;var r=!1,a=this._getEventFilter(t);return this._events=this._events.filter((function(t){return t.eventFilter.eventTag!==a.eventTag||t.listener!==e||(n.provider.removeListener(t.eventFilter.filter,t.wrappedListener),!!r||!(r=!0))})),this},E);function E(t,e,n){var r=this;if(c.checkNew(this,E),l.Interface.isInterface(e)?h.defineReadOnly(this,"interface",e):h.defineReadOnly(this,"interface",new l.Interface(e)),g.Signer.isSigner(n)?(h.defineReadOnly(this,"provider",n.provider),h.defineReadOnly(this,"signer",n)):y.Provider.isProvider(n)?(h.defineReadOnly(this,"provider",n),h.defineReadOnly(this,"signer",null)):c.throwError("invalid signer or provider",c.INVALID_ARGUMENT,{arg:"signerOrProvider",value:n}),h.defineReadOnly(this,"estimate",{}),h.defineReadOnly(this,"functions",{}),h.defineReadOnly(this,"filters",{}),Object.keys(this.interface.events).forEach((function(t){var e=r.interface.events[t];h.defineReadOnly(r.filters,t,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{address:r.address,topics:e.encodeTopics(t)}}))})),this._events=[],h.defineReadOnly(this,"address",t),this.provider)h.defineReadOnly(this,"addressPromise",this.provider.resolveName(t).then((function(t){if(null==t)throw new Error("name not found");return t})).catch((function(t){throw t})));else try{h.defineReadOnly(this,"addressPromise",Promise.resolve(d.getAddress(t)))}catch(e){c.throwError("provider is required to use non-address contract address",c.INVALID_ARGUMENT,{argument:"addressOrName",value:t})}Object.keys(this.interface.functions).forEach((function(t){var e=C(r,t,!1);null==r[t]?h.defineReadOnly(r,t,e):c.warn("WARNING: Multiple definitions for "+t),null==r.functions[t]&&(h.defineReadOnly(r.functions,t,e),h.defineReadOnly(r.estimate,t,C(r,t,!0)))}))}n.Contract=w;var B=(Q.prototype.getDeployTransaction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={};if(t.length===this.interface.deployFunction.inputs.length+1)for(var r in n=h.shallowCopy(t.pop()))if(!I[r])throw new Error("unknown transaction override "+r);return["data","from","to"].forEach((function(t){null!=n[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})})),c.checkArgumentCount(t.length,this.interface.deployFunction.inputs.length," in Contract constructor"),n.data=this.interface.deployFunction.encode(this.bytecode,t),n},Q.prototype.deploy=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.getDeployTransaction.apply(this,e);return this.signer.sendTransaction(r).then((function(e){var n=new w(d.getContractAddress(e),t.interface,t.signer);return h.defineReadOnly(n,"deployTransaction",e),n}))},Q.prototype.attach=function(t){return new w(t,this.interface,this.signer)},Q.prototype.connect=function(t){return new Q(this.interface,this.bytecode,t)},Q.fromSolidity=function(t,e){null==t&&c.throwError("missing compiler output",c.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));var n=t.abi,r=null;return t.bytecode?r=t.bytecode:t.evm&&t.evm.bytecode&&(r=t.evm.bytecode),new Q(n,r,e)},Q);function Q(t,e,n){var r=null;"string"==typeof e?r=e:f.isArrayish(e)?r=f.hexlify(e):"string"==typeof e.object?r=e.object:c.throwError("bytecode must be a valid hex string",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),"0x"!==r.substring(0,2)&&(r="0x"+r),f.isHexString(r)||c.throwError("bytecode must be a valid hex string",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),r.length%2!=0&&c.throwError("bytecode must be valid data (even length)",c.INVALID_ARGUMENT,{arg:"bytecode",value:e}),h.defineReadOnly(this,"bytecode",r),l.Interface.isInterface(t)?h.defineReadOnly(this,"interface",t):h.defineReadOnly(this,"interface",new l.Interface(t)),n&&!g.Signer.isSigner(n)&&c.throwError("invalid signer",c.INVALID_ARGUMENT,{arg:"signer",value:null}),h.defineReadOnly(this,"signer",n||null)}n.ContractFactory=B},{"./abstract-signer":2,"./constants":3,"./errors":5,"./providers/abstract-provider":50,"./utils/abi-coder":59,"./utils/address":60,"./utils/bignumber":63,"./utils/bytes":64,"./utils/interface":69,"./utils/properties":74}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./_version");n.UNKNOWN_ERROR="UNKNOWN_ERROR",n.NOT_IMPLEMENTED="NOT_IMPLEMENTED",n.MISSING_NEW="MISSING_NEW",n.CALL_EXCEPTION="CALL_EXCEPTION",n.INVALID_ARGUMENT="INVALID_ARGUMENT",n.MISSING_ARGUMENT="MISSING_ARGUMENT",n.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",n.NUMERIC_FAULT="NUMERIC_FAULT",n.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",n.NONCE_EXPIRED="NONCE_EXPIRED",n.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED";var a=!(n.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION"),i=!1;function s(t,e,a){if(i)throw new Error("unknown error");e=e||n.UNKNOWN_ERROR,a=a||{};var s=[];Object.keys(a).forEach((function(t){try{s.push(t+"="+JSON.stringify(a[t]))}catch(e){s.push(t+"="+JSON.stringify(a[t].toString()))}})),s.push("version="+r.version);var o=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=o,u.code=e,Object.keys(a).forEach((function(t){u[t]=a[t]})),u}n.throwError=s,n.checkNew=function(t,e){t instanceof e||s("missing new",n.MISSING_NEW,{name:e.name})},n.checkArgumentCount=function(t,e,r){r=r||"",t<e&&s("missing argument"+r,n.MISSING_ARGUMENT,{count:t,expectedCount:e}),e<t&&s("too many arguments"+r,n.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})},n.setCensorship=function(t,e){a&&s("error censorship permanent",n.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i=!!t,a=!!e},n.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",n.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var o={debug:1,default:2,info:2,warn:3,error:4,off:5},u=o.default;function c(t,e){u>o[t]||console.log.apply(console,e)}function A(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c("warn",t)}n.setLogLevel=function(t){var e=o[t];null!=e?u=e:A("invliad log level - "+t)},n.warn=A,n.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c("info",t)}},{"./_version":1}],6:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./contract");n.Contract=a.Contract,n.ContractFactory=a.ContractFactory,n.VoidSigner=a.VoidSigner;var i=t("./abstract-signer");n.Signer=i.Signer;var s=t("./wallet");n.Wallet=s.Wallet;var o=r(t("./constants"));n.constants=o;var u=r(t("./errors"));n.errors=u;var c=r(t("./providers"));n.providers=c;var A=r(t("./utils"));n.utils=A;var d=r(t("./wordlists"));n.wordlists=d;var p=t("./utils/shims");n.platform=p.platform;var f=t("./_version");n.version=f.version,n.getDefaultProvider=function(t){null==t&&(t="homestead");var e=A.getNetwork(t);return e&&e._defaultProvider||u.throwError("unsupported getDefaultProvider network",u.UNSUPPORTED_OPERATION,{operation:"getDefaultProvider",network:t}),e._defaultProvider(c)}},{"./_version":1,"./abstract-signer":2,"./constants":3,"./contract":4,"./errors":5,"./providers":54,"./utils":68,"./utils/shims":80,"./wallet":88,"./wordlists":89}],7:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("./ethers"));n.ethers=a,function(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}(t("./ethers"))},{"./ethers":6}],8:[function(t,e,n){"use strict";!function(t){function r(t){return parseInt(t)===t}function a(t){if(r(t.length)){for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||255<t[e])return;return 1}}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!a(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&a(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function s(t){return new Uint8Array(t)}function o(t,e,n,r,a){null==r&&null==a||(t=t.slice?t.slice(r,a):Array.prototype.slice.call(t,r,a)),e.set(t,n)}var u,c={toBytes:function(t){var e=[],n=0;for(t=encodeURI(t);n<t.length;){var r=t.charCodeAt(n++);37===r?(e.push(parseInt(t.substr(n,2),16)),n+=2):e.push(r)}return i(e)},fromBytes:function(t){for(var e=[],n=0;n<t.length;){var r=t[n];r<128?(e.push(String.fromCharCode(r)),n++):191<r&&r<224?(e.push(String.fromCharCode((31&r)<<6|63&t[n+1])),n+=2):(e.push(String.fromCharCode((15&r)<<12|(63&t[n+1])<<6|63&t[n+2])),n+=3)}return e.join("")}},A=(u="0123456789abcdef",{toBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},fromBytes:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(u[(240&r)>>4]+u[15&r])}return e.join("")}}),d={16:10,24:12,32:14},p=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],h=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],I=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],C=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],v=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],B=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Q=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(t){for(var e=[],n=0;n<t.length;n+=4)e.push(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);return e}var _=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};_.prototype._prepare=function(){var t=d[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var n,r=4*(t+1),a=this.key.length/4,i=M(this.key);for(e=0;e<a;e++)n=e>>2,this._Ke[n][e%4]=i[e],this._Kd[t-n][e%4]=i[e];for(var s,o=0,u=a;u<r;){if(s=i[a-1],i[0]^=f[s>>16&255]<<24^f[s>>8&255]<<16^f[255&s]<<8^f[s>>24&255]^p[o]<<24,o+=1,8!=a)for(e=1;e<a;e++)i[e]^=i[e-1];else{for(e=1;e<a/2;e++)i[e]^=i[e-1];for(s=i[a/2-1],i[a/2]^=f[255&s]^f[s>>8&255]<<8^f[s>>16&255]<<16^f[s>>24&255]<<24,e=a/2+1;e<a;e++)i[e]^=i[e-1]}for(e=0;e<a&&u<r;)c=u>>2,A=u%4,this._Ke[c][A]=i[e],this._Kd[t-c][A]=i[e++],u++}for(var c=1;c<t;c++)for(var A=0;A<4;A++)s=this._Kd[c][A],this._Kd[c][A]=w[s>>24&255]^E[s>>16&255]^B[s>>8&255]^Q[255&s]},_.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,n=[0,0,0,0],r=M(t),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var i=1;i<e;i++){for(a=0;a<4;a++)n[a]=h[r[a]>>24&255]^y[r[(a+1)%4]>>16&255]^g[r[(a+2)%4]>>8&255]^b[255&r[(a+3)%4]]^this._Ke[i][a];r=n.slice()}var o,u=s(16);for(a=0;a<4;a++)o=this._Ke[e][a],u[4*a]=255&(f[r[a]>>24&255]^o>>24),u[4*a+1]=255&(f[r[(a+1)%4]>>16&255]^o>>16),u[4*a+2]=255&(f[r[(a+2)%4]>>8&255]^o>>8),u[4*a+3]=255&(f[255&r[(a+3)%4]]^o);return u},_.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,n=[0,0,0,0],r=M(t),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var i=1;i<e;i++){for(a=0;a<4;a++)n[a]=m[r[a]>>24&255]^I[r[(a+3)%4]>>16&255]^C[r[(a+2)%4]>>8&255]^v[255&r[(a+1)%4]]^this._Kd[i][a];r=n.slice()}var o,u=s(16);for(a=0;a<4;a++)o=this._Kd[e][a],u[4*a]=255&(l[r[a]>>24&255]^o>>24),u[4*a+1]=255&(l[r[(a+3)%4]>>16&255]^o>>16),u[4*a+2]=255&(l[r[(a+2)%4]>>8&255]^o>>8),u[4*a+3]=255&(l[255&r[(a+1)%4]]^o);return u};var x=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new _(e)};x.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16)o(t,n,0,r,r+16),o(n=this._aes.encrypt(n),e,r);return e},x.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16)o(t,n,0,r,r+16),o(n=this._aes.decrypt(n),e,r);return e};var k=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=s(16);this._lastCipherblock=i(n,!0),this._aes=new _(e)};k.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16){o(t,n,0,r,r+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),o(this._lastCipherblock,e,r)}return e},k.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=s(t.length),n=s(16),r=0;r<t.length;r+=16){o(t,n,0,r,r+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)e[r+a]=n[a]^this._lastCipherblock[a];o(t,this._lastCipherblock,0,r,r+16)}return e};var S=function t(e,n,r){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 size)")}else n=s(16);r=r||1,this.segmentSize=r,this._shiftRegister=i(n,!0),this._aes=new _(e)};S.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,n=i(t,!0),r=0;r<n.length;r+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)n[r+a]^=e[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(n,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return n},S.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,n=i(t,!0),r=0;r<n.length;r+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)n[r+a]^=e[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(t,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return n};var D=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=s(16);this._lastPrecipher=i(n,!0),this._lastPrecipherIndex=16,this._aes=new _(e)};D.prototype.encrypt=function(t){for(var e=i(t,!0),n=0;n<e.length;n++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[n]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},D.prototype.decrypt=D.prototype.encrypt;var R=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=s(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;0<=e;--e)this._counter[e]=t%256,t>>=8},R.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var N=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof R||(n=new R(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new _(e)};N.prototype.encrypt=function(t){for(var e=i(t,!0),n=0;n<e.length;n++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[n]^=this._remainingCounter[this._remainingCounterIndex++];return e},N.prototype.decrypt=N.prototype.encrypt;var T={AES:_,Counter:R,ModeOfOperation:{ecb:x,cbc:k,cfb:S,ofb:D,ctr:N},utils:{hex:A,utf8:c},padding:{pkcs7:{pad:function(t){var e=16-(t=i(t,!0)).length%16,n=s(t.length+e);o(t,n);for(var r=t.length;r<n.length;r++)n[r]=e;return n},strip:function(t){if((t=i(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(16<e)throw new Error("PKCS#7 padding byte out of range");for(var n=t.length-e,r=0;r<e;r++)if(t[n+r]!==e)throw new Error("PKCS#7 invalid padding byte");var a=s(n);return o(t,a,0,0,n),a}}},_arrayTest:{coerceArray:i,createArray:s,copyArray:o}};void 0!==n?e.exports=T:(t.aesjs&&(T._aesjs=t.aesjs),t.aesjs=T)}(this)},{}],9:[function(t,e,n){!function(e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){function n(){}t.super_=e,n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==o(e)?e.exports=i:n.BN=i,(i.BN=i).wordSize=26;try{s=t("buffer").Buffer}catch(e){}function u(t,e,n){for(var r=0,a=Math.min(t.length,n),i=e;i<a;i++){var s=t.charCodeAt(i)-48;r<<=4,r|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return r}function c(t,e,n,r){for(var a=0,i=Math.min(t.length,n),s=e;s<i;s++){var o=t.charCodeAt(s)-48;a*=r,a+=49<=o?o-49+10:17<=o?o-17+10:o}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==o(t)&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return 0<t.cmp(e)?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==o(t))return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&2<=e&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a,i,s=0;s<this.length;s++)this.words[s]=0;var o=0;if("be"===n)for(s=t.length-1,a=0;0<=s;s-=3)i=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[a]|=i<<o&67108863,this.words[a+1]=i>>>26-o&67108863,26<=(o+=24)&&(o-=26,a++);else if("le"===n)for(a=s=0;s<t.length;s+=3)i=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[a]|=i<<o&67108863,this.words[a+1]=i>>>26-o&67108863,26<=(o+=24)&&(o-=26,a++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n,r=0;r<this.length;r++)this.words[r]=0;for(var a=0,i=(r=t.length-6,0);e<=r;r-=6)n=u(t,r,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303,26<=(a+=24)&&(a-=26,i++);r+6!==e&&(n=u(t,e,r+6),this.words[i]|=n<<a&67108863,this.words[i+1]|=n>>>26-a&4194303),this.strip()},i.prototype._parseBase=function(t,e,n){this.words=[0];for(var r=0,a=this.length=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=t.length-n,s=i%r,o=Math.min(i,i-s)+n,u=0,A=n;A<o;A+=r)u=c(t,A,A+r,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!=s){var d=1;for(u=c(t,A,t.length,e),A=0;A<s;A++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var A=["","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"],d=[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];function f(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0,a=(r=(n.length=r)-1|0,67108863&(d=(0|t.words[0])*(0|e.words[0]))),i=d/67108864|0;n.words[0]=a;for(var s=1;s<r;s++){for(var o=i>>>26,u=67108863&i,c=Math.min(s,e.length-1),A=Math.max(0,s-t.length+1);A<=c;A++){var d,p=s-A|0;o+=(d=(0|t.words[p])*(0|e.words[A])+u)/67108864|0,u=67108863&d}n.words[s]=0|u,i=0|o}return 0!==i?n.words[s]=0|i:n.length--,n.strip()}i.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){u="";for(var n=0,a=0,i=0;i<this.length;i++){var s=this.words[i],o=(16777215&(s<<n|a)).toString(16),u=0!=(a=s>>>24-n&16777215)||i!==this.length-1?A[6-o.length]+o+u:o+u;26<=(n+=2)&&(n-=26,i--)}for(0!==a&&(u=a.toString(16)+u);u.length%e!=0;)u="0"+u;return 0!==this.negative&&(u="-"+u),u}if(t===(0|t)&&2<=t&&t<=36){var c=d[t],f=p[t];for(u="",(l=this.clone()).negative=0;!l.isZero();){var l,h=l.modn(f).toString(t);u=(l=l.idivn(f)).isZero()?h+u:A[c-h.length]+h+u}for(this.isZero()&&(u="0"+u);u.length%e!=0;)u="0"+u;return 0!==this.negative&&(u="-"+u),u}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return r(void 0!==s),this.toArrayLike(s,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,n){var a=this.byteLength(),i=n||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(0<i,"Requested array length <= 0"),this.strip();var s,o,u="le"===e,c=new t(i),A=this.clone();if(u){for(o=0;!A.isZero();o++)s=A.andln(255),A.iushrn(8),c[o]=s;for(;o<i;o++)c[o]=0}else{for(o=0;o<i-a;o++)c[o]=0;for(o=0;!A.isZero();o++)s=A.andln(255),A.iushrn(8),c[i-o-1]=s}return c},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return 4096<=e&&(n+=13,e>>>=13),64<=e&&(n+=7,e>>>=7),8<=e&&(n+=4,e>>>=4),2<=e&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){for(var e=this.length>t.length?t:this,n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){for(var e,n=this.length>t.length?(e=this,t):(e=t,this),r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){r("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),0<n&&e--;for(var a=0;a<e;a++)this.words[a]=67108863&~this.words[a];return 0<n&&(this.words[a]=~this.words[a]&67108863>>26-n),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){r("number"==typeof t&&0<=t);var n=t/26|0,a=t%26;return this._expand(1+n),this.words[n]=e?this.words[n]|1<<a:this.words[n]&~(1<<a),this.strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();r=this.length>t.length?(n=this,t):(n=t,this);for(var a=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<n.length;i++)e=(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=n.length,0!==a)this.words[this.length]=a,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;r=0<a?(n=this,t):(n=t,this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,n){var r,a,i,s=t.words,o=e.words,u=n.words,c=0|s[0],A=8191&c,d=c>>>13,p=0|s[1],f=8191&p,l=p>>>13,h=0|s[2],y=8191&h,g=h>>>13,b=0|s[3],m=8191&b,I=b>>>13,C=0|s[4],v=8191&C,w=C>>>13,E=0|s[5],B=8191&E,Q=E>>>13,M=0|s[6],_=8191&M,x=M>>>13,k=0|s[7],S=8191&k,D=k>>>13,R=0|s[8],N=8191&R,T=R>>>13,O=0|s[9],H=8191&O,L=O>>>13,U=0|o[0],j=8191&U,F=U>>>13,P=0|o[1],G=8191&P,q=P>>>13,Y=0|o[2],K=8191&Y,z=Y>>>13,J=0|o[3],V=8191&J,W=J>>>13,Z=0|o[4],X=8191&Z,$=Z>>>13,tt=0|o[5],et=8191&tt,nt=tt>>>13,rt=0|o[6],at=8191&rt,it=rt>>>13,st=0|o[7],ot=8191&st,ut=st>>>13,ct=0|o[8],At=8191&ct,dt=ct>>>13,pt=0|o[9],ft=8191&pt,lt=pt>>>13;n.negative=t.negative^e.negative,n.length=19;var ht=(0+Math.imul(A,j)|0)+((8191&(a=Math.imul(A,F)+Math.imul(d,j)|0))<<13)|0,yt=(Math.imul(d,F)+(a>>>13)|0)+(ht>>>26)|0;ht&=67108863,r=Math.imul(f,j),a=Math.imul(f,F)+Math.imul(l,j)|0,i=Math.imul(l,F);var gt=(yt+(r+Math.imul(A,G)|0)|0)+((8191&(a=(a+Math.imul(A,q)|0)+Math.imul(d,G)|0))<<13)|0;yt=((i+Math.imul(d,q)|0)+(a>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(y,j),a=Math.imul(y,F)+Math.imul(g,j)|0,i=Math.imul(g,F),r=r+Math.imul(f,G)|0,a=(a+Math.imul(f,q)|0)+Math.imul(l,G)|0,i=i+Math.imul(l,q)|0;var bt=(yt+(r+Math.imul(A,K)|0)|0)+((8191&(a=(a+Math.imul(A,z)|0)+Math.imul(d,K)|0))<<13)|0;yt=((i+Math.imul(d,z)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(m,j),a=Math.imul(m,F)+Math.imul(I,j)|0,i=Math.imul(I,F),r=r+Math.imul(y,G)|0,a=(a+Math.imul(y,q)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,q)|0,r=r+Math.imul(f,K)|0,a=(a+Math.imul(f,z)|0)+Math.imul(l,K)|0,i=i+Math.imul(l,z)|0;var mt=(yt+(r+Math.imul(A,V)|0)|0)+((8191&(a=(a+Math.imul(A,W)|0)+Math.imul(d,V)|0))<<13)|0;yt=((i+Math.imul(d,W)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(v,j),a=Math.imul(v,F)+Math.imul(w,j)|0,i=Math.imul(w,F),r=r+Math.imul(m,G)|0,a=(a+Math.imul(m,q)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,q)|0,r=r+Math.imul(y,K)|0,a=(a+Math.imul(y,z)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,z)|0,r=r+Math.imul(f,V)|0,a=(a+Math.imul(f,W)|0)+Math.imul(l,V)|0,i=i+Math.imul(l,W)|0;var It=(yt+(r+Math.imul(A,X)|0)|0)+((8191&(a=(a+Math.imul(A,$)|0)+Math.imul(d,X)|0))<<13)|0;yt=((i+Math.imul(d,$)|0)+(a>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,j),a=Math.imul(B,F)+Math.imul(Q,j)|0,i=Math.imul(Q,F),r=r+Math.imul(v,G)|0,a=(a+Math.imul(v,q)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,q)|0,r=r+Math.imul(m,K)|0,a=(a+Math.imul(m,z)|0)+Math.imul(I,K)|0,i=i+Math.imul(I,z)|0,r=r+Math.imul(y,V)|0,a=(a+Math.imul(y,W)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(f,X)|0,a=(a+Math.imul(f,$)|0)+Math.imul(l,X)|0,i=i+Math.imul(l,$)|0;var Ct=(yt+(r+Math.imul(A,et)|0)|0)+((8191&(a=(a+Math.imul(A,nt)|0)+Math.imul(d,et)|0))<<13)|0;yt=((i+Math.imul(d,nt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(_,j),a=Math.imul(_,F)+Math.imul(x,j)|0,i=Math.imul(x,F),r=r+Math.imul(B,G)|0,a=(a+Math.imul(B,q)|0)+Math.imul(Q,G)|0,i=i+Math.imul(Q,q)|0,r=r+Math.imul(v,K)|0,a=(a+Math.imul(v,z)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,z)|0,r=r+Math.imul(m,V)|0,a=(a+Math.imul(m,W)|0)+Math.imul(I,V)|0,i=i+Math.imul(I,W)|0,r=r+Math.imul(y,X)|0,a=(a+Math.imul(y,$)|0)+Math.imul(g,X)|0,i=i+Math.imul(g,$)|0,r=r+Math.imul(f,et)|0,a=(a+Math.imul(f,nt)|0)+Math.imul(l,et)|0,i=i+Math.imul(l,nt)|0;var vt=(yt+(r+Math.imul(A,at)|0)|0)+((8191&(a=(a+Math.imul(A,it)|0)+Math.imul(d,at)|0))<<13)|0;yt=((i+Math.imul(d,it)|0)+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(S,j),a=Math.imul(S,F)+Math.imul(D,j)|0,i=Math.imul(D,F),r=r+Math.imul(_,G)|0,a=(a+Math.imul(_,q)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,q)|0,r=r+Math.imul(B,K)|0,a=(a+Math.imul(B,z)|0)+Math.imul(Q,K)|0,i=i+Math.imul(Q,z)|0,r=r+Math.imul(v,V)|0,a=(a+Math.imul(v,W)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,a=(a+Math.imul(m,$)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(y,et)|0,a=(a+Math.imul(y,nt)|0)+Math.imul(g,et)|0,i=i+Math.imul(g,nt)|0,r=r+Math.imul(f,at)|0,a=(a+Math.imul(f,it)|0)+Math.imul(l,at)|0,i=i+Math.imul(l,it)|0;var wt=(yt+(r+Math.imul(A,ot)|0)|0)+((8191&(a=(a+Math.imul(A,ut)|0)+Math.imul(d,ot)|0))<<13)|0;yt=((i+Math.imul(d,ut)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(N,j),a=Math.imul(N,F)+Math.imul(T,j)|0,i=Math.imul(T,F),r=r+Math.imul(S,G)|0,a=(a+Math.imul(S,q)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,q)|0,r=r+Math.imul(_,K)|0,a=(a+Math.imul(_,z)|0)+Math.imul(x,K)|0,i=i+Math.imul(x,z)|0,r=r+Math.imul(B,V)|0,a=(a+Math.imul(B,W)|0)+Math.imul(Q,V)|0,i=i+Math.imul(Q,W)|0,r=r+Math.imul(v,X)|0,a=(a+Math.imul(v,$)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,$)|0,r=r+Math.imul(m,et)|0,a=(a+Math.imul(m,nt)|0)+Math.imul(I,et)|0,i=i+Math.imul(I,nt)|0,r=r+Math.imul(y,at)|0,a=(a+Math.imul(y,it)|0)+Math.imul(g,at)|0,i=i+Math.imul(g,it)|0,r=r+Math.imul(f,ot)|0,a=(a+Math.imul(f,ut)|0)+Math.imul(l,ot)|0,i=i+Math.imul(l,ut)|0;var Et=(yt+(r+Math.imul(A,At)|0)|0)+((8191&(a=(a+Math.imul(A,dt)|0)+Math.imul(d,At)|0))<<13)|0;yt=((i+Math.imul(d,dt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(H,j),a=Math.imul(H,F)+Math.imul(L,j)|0,i=Math.imul(L,F),r=r+Math.imul(N,G)|0,a=(a+Math.imul(N,q)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,q)|0,r=r+Math.imul(S,K)|0,a=(a+Math.imul(S,z)|0)+Math.imul(D,K)|0,i=i+Math.imul(D,z)|0,r=r+Math.imul(_,V)|0,a=(a+Math.imul(_,W)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,W)|0,r=r+Math.imul(B,X)|0,a=(a+Math.imul(B,$)|0)+Math.imul(Q,X)|0,i=i+Math.imul(Q,$)|0,r=r+Math.imul(v,et)|0,a=(a+Math.imul(v,nt)|0)+Math.imul(w,et)|0,i=i+Math.imul(w,nt)|0,r=r+Math.imul(m,at)|0,a=(a+Math.imul(m,it)|0)+Math.imul(I,at)|0,i=i+Math.imul(I,it)|0,r=r+Math.imul(y,ot)|0,a=(a+Math.imul(y,ut)|0)+Math.imul(g,ot)|0,i=i+Math.imul(g,ut)|0,r=r+Math.imul(f,At)|0,a=(a+Math.imul(f,dt)|0)+Math.imul(l,At)|0,i=i+Math.imul(l,dt)|0;var Bt=(yt+(r+Math.imul(A,ft)|0)|0)+((8191&(a=(a+Math.imul(A,lt)|0)+Math.imul(d,ft)|0))<<13)|0;yt=((i+Math.imul(d,lt)|0)+(a>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(H,G),a=Math.imul(H,q)+Math.imul(L,G)|0,i=Math.imul(L,q),r=r+Math.imul(N,K)|0,a=(a+Math.imul(N,z)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,z)|0,r=r+Math.imul(S,V)|0,a=(a+Math.imul(S,W)|0)+Math.imul(D,V)|0,i=i+Math.imul(D,W)|0,r=r+Math.imul(_,X)|0,a=(a+Math.imul(_,$)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,$)|0,r=r+Math.imul(B,et)|0,a=(a+Math.imul(B,nt)|0)+Math.imul(Q,et)|0,i=i+Math.imul(Q,nt)|0,r=r+Math.imul(v,at)|0,a=(a+Math.imul(v,it)|0)+Math.imul(w,at)|0,i=i+Math.imul(w,it)|0,r=r+Math.imul(m,ot)|0,a=(a+Math.imul(m,ut)|0)+Math.imul(I,ot)|0,i=i+Math.imul(I,ut)|0,r=r+Math.imul(y,At)|0,a=(a+Math.imul(y,dt)|0)+Math.imul(g,At)|0,i=i+Math.imul(g,dt)|0;var Qt=(yt+(r+Math.imul(f,ft)|0)|0)+((8191&(a=(a+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;yt=((i+Math.imul(l,lt)|0)+(a>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,r=Math.imul(H,K),a=Math.imul(H,z)+Math.imul(L,K)|0,i=Math.imul(L,z),r=r+Math.imul(N,V)|0,a=(a+Math.imul(N,W)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,W)|0,r=r+Math.imul(S,X)|0,a=(a+Math.imul(S,$)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(_,et)|0,a=(a+Math.imul(_,nt)|0)+Math.imul(x,et)|0,i=i+Math.imul(x,nt)|0,r=r+Math.imul(B,at)|0,a=(a+Math.imul(B,it)|0)+Math.imul(Q,at)|0,i=i+Math.imul(Q,it)|0,r=r+Math.imul(v,ot)|0,a=(a+Math.imul(v,ut)|0)+Math.imul(w,ot)|0,i=i+Math.imul(w,ut)|0,r=r+Math.imul(m,At)|0,a=(a+Math.imul(m,dt)|0)+Math.imul(I,At)|0,i=i+Math.imul(I,dt)|0;var Mt=(yt+(r+Math.imul(y,ft)|0)|0)+((8191&(a=(a+Math.imul(y,lt)|0)+Math.imul(g,ft)|0))<<13)|0;yt=((i+Math.imul(g,lt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(H,V),a=Math.imul(H,W)+Math.imul(L,V)|0,i=Math.imul(L,W),r=r+Math.imul(N,X)|0,a=(a+Math.imul(N,$)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,$)|0,r=r+Math.imul(S,et)|0,a=(a+Math.imul(S,nt)|0)+Math.imul(D,et)|0,i=i+Math.imul(D,nt)|0,r=r+Math.imul(_,at)|0,a=(a+Math.imul(_,it)|0)+Math.imul(x,at)|0,i=i+Math.imul(x,it)|0,r=r+Math.imul(B,ot)|0,a=(a+Math.imul(B,ut)|0)+Math.imul(Q,ot)|0,i=i+Math.imul(Q,ut)|0,r=r+Math.imul(v,At)|0,a=(a+Math.imul(v,dt)|0)+Math.imul(w,At)|0,i=i+Math.imul(w,dt)|0;var _t=(yt+(r+Math.imul(m,ft)|0)|0)+((8191&(a=(a+Math.imul(m,lt)|0)+Math.imul(I,ft)|0))<<13)|0;yt=((i+Math.imul(I,lt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(H,X),a=Math.imul(H,$)+Math.imul(L,X)|0,i=Math.imul(L,$),r=r+Math.imul(N,et)|0,a=(a+Math.imul(N,nt)|0)+Math.imul(T,et)|0,i=i+Math.imul(T,nt)|0,r=r+Math.imul(S,at)|0,a=(a+Math.imul(S,it)|0)+Math.imul(D,at)|0,i=i+Math.imul(D,it)|0,r=r+Math.imul(_,ot)|0,a=(a+Math.imul(_,ut)|0)+Math.imul(x,ot)|0,i=i+Math.imul(x,ut)|0,r=r+Math.imul(B,At)|0,a=(a+Math.imul(B,dt)|0)+Math.imul(Q,At)|0,i=i+Math.imul(Q,dt)|0;var xt=(yt+(r+Math.imul(v,ft)|0)|0)+((8191&(a=(a+Math.imul(v,lt)|0)+Math.imul(w,ft)|0))<<13)|0;yt=((i+Math.imul(w,lt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(H,et),a=Math.imul(H,nt)+Math.imul(L,et)|0,i=Math.imul(L,nt),r=r+Math.imul(N,at)|0,a=(a+Math.imul(N,it)|0)+Math.imul(T,at)|0,i=i+Math.imul(T,it)|0,r=r+Math.imul(S,ot)|0,a=(a+Math.imul(S,ut)|0)+Math.imul(D,ot)|0,i=i+Math.imul(D,ut)|0,r=r+Math.imul(_,At)|0,a=(a+Math.imul(_,dt)|0)+Math.imul(x,At)|0,i=i+Math.imul(x,dt)|0;var kt=(yt+(r+Math.imul(B,ft)|0)|0)+((8191&(a=(a+Math.imul(B,lt)|0)+Math.imul(Q,ft)|0))<<13)|0;yt=((i+Math.imul(Q,lt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(H,at),a=Math.imul(H,it)+Math.imul(L,at)|0,i=Math.imul(L,it),r=r+Math.imul(N,ot)|0,a=(a+Math.imul(N,ut)|0)+Math.imul(T,ot)|0,i=i+Math.imul(T,ut)|0,r=r+Math.imul(S,At)|0,a=(a+Math.imul(S,dt)|0)+Math.imul(D,At)|0,i=i+Math.imul(D,dt)|0;var St=(yt+(r+Math.imul(_,ft)|0)|0)+((8191&(a=(a+Math.imul(_,lt)|0)+Math.imul(x,ft)|0))<<13)|0;yt=((i+Math.imul(x,lt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(H,ot),a=Math.imul(H,ut)+Math.imul(L,ot)|0,i=Math.imul(L,ut),r=r+Math.imul(N,At)|0,a=(a+Math.imul(N,dt)|0)+Math.imul(T,At)|0,i=i+Math.imul(T,dt)|0;var Dt=(yt+(r+Math.imul(S,ft)|0)|0)+((8191&(a=(a+Math.imul(S,lt)|0)+Math.imul(D,ft)|0))<<13)|0;yt=((i+Math.imul(D,lt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(H,At),a=Math.imul(H,dt)+Math.imul(L,At)|0,i=Math.imul(L,dt);var Rt=(yt+(r+Math.imul(N,ft)|0)|0)+((8191&(a=(a+Math.imul(N,lt)|0)+Math.imul(T,ft)|0))<<13)|0;yt=((i+Math.imul(T,lt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Nt=(yt+Math.imul(H,ft)|0)+((8191&(a=Math.imul(H,lt)+Math.imul(L,ft)|0))<<13)|0;return yt=(Math.imul(L,lt)+(a>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=ht,u[1]=gt,u[2]=bt,u[3]=mt,u[4]=It,u[5]=Ct,u[6]=vt,u[7]=wt,u[8]=Et,u[9]=Bt,u[10]=Qt,u[11]=Mt,u[12]=_t,u[13]=xt,u[14]=kt,u[15]=St,u[16]=Dt,u[17]=Rt,u[18]=Nt,0!=yt&&(u[19]=yt,n.length++),n};function h(t,e,n){return(new y).mulp(t,e,n)}function y(t,e){this.x=t,this.y=e}Math.imul||(l=f),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return(10===this.length&&10===t.length?l:n<63?f:n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,a=0,i=0;i<n.length-1;i++){for(var s=a,o=(a=0,67108863&r),u=Math.min(i,e.length-1),c=Math.max(0,i-t.length+1);c<=u;c++){var A=i-c,d=(0|t.words[A])*(0|e.words[c]),p=67108863&d;o=67108863&(p=p+o|0),a+=(s=(s=s+(d/67108864|0)|0)+(p>>>26)|0)>>>26,s&=67108863}n.words[i]=o,r=s,s=a}return 0!==r?n.words[i]=r:n.length--,n.strip()}:h)(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),n=i.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},y.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,a=0;a<e;a++)r|=(1&t)<<e-a-1,t>>=1;return r},y.prototype.permute=function(t,e,n,r,a,i){for(var s=0;s<i;s++)r[s]=e[t[s]],a[s]=n[t[s]]},y.prototype.transform=function(t,e,n,r,a,i){this.permute(i,t,e,n,r,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),A=0;A<a;A+=o)for(var d=u,p=c,f=0;f<s;f++){var l=n[A+f],h=r[A+f],y=d*(b=n[A+f+s])-p*(g=r[A+f+s]),g=d*g+p*b,b=y;n[A+f]=l+b,r[A+f]=h+g,n[A+f+s]=l-b,r[A+f+s]=h-g,f!==o&&(y=u*d-c*p,p=u*p+c*d,d=y)}},y.prototype.guessLen13b=function(t,e){for(var n=1&(a=1|Math.max(e,t)),r=0,a=a/2|0;a;a>>>=1)r++;return 1<<r+1+n},y.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var a=t[r];t[r]=t[n-r-1],t[n-r-1]=a,a=e[r],e[r]=-e[n-r-1],e[n-r-1]=-a}},y.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var a=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&a,n=a<67108864?0:a/67108864|0}return t},y.prototype.convert13b=function(t,e,n,a){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<a;++s)n[s]=0;r(0===i),r(0==(-8192&i))},y.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},y.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(r),i=this.stub(r),s=new Array(r),o=new Array(r),u=new Array(r),c=new Array(r),A=new Array(r),d=new Array(r),p=n.words;p.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,c,r),this.transform(s,i,o,u,r,a),this.transform(c,i,A,d,r,a);for(var f=0;f<r;f++){var l=o[f]*A[f]-u[f]*d[f];u[f]=o[f]*d[f]+u[f]*A[f],o[f]=l}return this.conjugate(o,u,r),this.transform(o,u,p,i,r,a),this.conjugate(p,i,r),this.normalize13b(p,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),h(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){r("number"==typeof t),r(t<67108864);for(var e=0,n=0;n<this.length;n++){var a=(0|this.words[n])*t,i=(67108863&a)+(67108863&e);e>>=26,e+=a/67108864|0,e+=i>>>26,this.words[n]=67108863&i}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,a=n%26;e[n]=(t.words[r]&1<<a)>>>a}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var a=n.sqr();r<e.length;r++,a=a.sqr())0!==e[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,a=67108863>>>26-e<<26-e;if(0!=e){for(var i=0,s=0;s<this.length;s++){var o=this.words[s]&a,u=(0|this.words[s])-o<<e;this.words[s]=u|i,i=o>>>26-e}i&&(this.words[s]=i,this.length++)}if(0!=n){for(s=this.length-1;0<=s;s--)this.words[s+n]=this.words[s];for(s=0;s<n;s++)this.words[s]=0;this.length+=n}return this.strip()},i.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var a;r("number"==typeof t&&0<=t),a=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),o=67108863^67108863>>>i<<i,u=n;if(a-=s,a=Math.max(0,a),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0!==s)if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var A=0;for(c=this.length-1;0<=c&&(0!==A||a<=c);c--){var d=0|this.words[c];this.words[c]=A<<26-i|d>>>i,A=d&o}return u&&0!==A&&(u.words[u.length++]=A),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,a=1<<e;return!(this.length<=n||!(this.words[n]&a))},i.prototype.imaskn=function(t){r("number"==typeof t&&0<=t);var e,n=t%26,a=(t-n)/26;return r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a?this:(0!=n&&a++,this.length=Math.min(a,this.length),0!=n&&(e=67108863^67108863>>>n<<n,this.words[this.length-1]&=e),this.strip())},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,--this.words[e+1];return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var a,i=t.length+n;this._expand(i);for(var s=0,o=0;o<t.length;o++){a=(0|this.words[o+n])+s;var u=(0|t.words[o])*e;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[o+n]=67108863&a}for(;o<this.length-n;o++)s=(a=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),o=s=0;o<this.length;o++)s=(a=-(0|this.words[o])+s)>>26,this.words[o]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),a=t,s=0|a.words[a.length-1];0!=(n=26-this._countBits(s))&&(a=a.ushln(n),r.iushln(n),s=0|a.words[a.length-1]);var o,u=r.length-a.length;if("mod"!==e){(o=new i(null)).length=1+u,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var A=r.clone()._ishlnsubmul(a,1,u);0===A.negative&&(r=A,o&&(o.words[u]=1));for(var d=u-1;0<=d;d--){var p=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(p=Math.min(p/s|0,67108863),r._ishlnsubmul(a,p,d);0!==r.negative;)p--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=p)}return o&&o.strip(),r.strip(),"div"!==e&&0!=n&&r.iushrn(n),{div:o||null,mod:r}},i.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:a,mod:s}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(s=o.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:o.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,s,o},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),a=t.andln(1),i=n.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,a=this.length-1;0<=a;a--)n=(e*n+(0|this.words[a]))%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;0<=n;n--){var a=(0|this.words[n])+67108864*e;this.words[n]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());for(var e=this,n=t.clone(),a=(e=0!==e.negative?e.umod(t):e.clone(),new i(1)),s=new i(0),o=new i(0),u=new i(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var A=n.clone(),d=e.clone();!e.isZero();){for(var p=0,f=1;0==(e.words[0]&f)&&p<26;++p,f<<=1);if(0<p)for(e.iushrn(p);0<p--;)(a.isOdd()||s.isOdd())&&(a.iadd(A),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var l=0,h=1;0==(n.words[0]&h)&&l<26;++l,h<<=1);if(0<l)for(n.iushrn(l);0<l--;)(o.isOdd()||u.isOdd())&&(o.iadd(A),u.isub(d)),o.iushrn(1),u.iushrn(1);0<=e.cmp(n)?(e.isub(n),a.isub(o),s.isub(u)):(n.isub(e),o.isub(a),u.isub(s))}return{a:o,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());for(var e,n=this,a=t.clone(),s=(n=0!==n.negative?n.umod(t):n.clone(),new i(1)),o=new i(0),u=a.clone();0<n.cmpn(1)&&0<a.cmpn(1);){for(var c=0,A=1;0==(n.words[0]&A)&&c<26;++c,A<<=1);if(0<c)for(n.iushrn(c);0<c--;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,p=1;0==(a.words[0]&p)&&d<26;++d,p<<=1);if(0<d)for(a.iushrn(d);0<d--;)o.isOdd()&&o.iadd(u),o.iushrn(1);0<=n.cmp(a)?(n.isub(a),s.isub(o)):(a.isub(n),o.isub(s))}return(e=0===n.cmpn(1)?s:o).cmpn(0)<0&&e.iadd(t),e},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0;for(var r=n.negative=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var a=e.cmp(n);if(a<0){var i=e;e=n,n=i}else if(0===a||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,a=1<<e;if(this.length<=n)return this._expand(1+n),this.words[n]|=a,this;for(var i=a,s=n;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,n,a=t<0;return 0===this.negative||a?0===this.negative&&a?1:(this.strip(),n=1<this.length?1:(a&&(t=-t),r(t<=67108863,"Number is too big"),(e=0|this.words[0])===t?0:e<t?-1:1),0!==this.negative?0|-n:n):-1},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;0<=n;n--){var r=0|this.words[n],a=0|t.words[n];if(r!=a){r<a?e=-1:a<r&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return 0<=this.cmpn(t)},i.prototype.gte=function(t){return 0<=this.cmp(t)},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function I(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){var e;"string"==typeof t?(e=i._prime(t),this.m=e.p,this.prime=e):(r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null)}function E(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){for(var e,n=t;this.split(n,this.tmp),(e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength())>this.n;);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):0<r?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},a(m,b),m.prototype.split=function(t,e){for(var n=Math.min(t.length,9),r=0;r<n;r++)e.words[r]=t.words[r];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,r=10;r<t.length;r++){var i=0|t.words[r];t.words[r-10]=(4194303&i)<<4|a>>>22,a=i}a>>>=22,0===(t.words[r-10]=a)&&10<t.length?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},a(I,b),a(C,b),a(v,b),v.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,a=67108863&r;r>>>=26,t.words[n]=a,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new I;else if("p192"===t)e=new C;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return g[t]=e},w.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return 0<=n.cmp(this.m)&&n.isub(this.m),n._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return 0<=n.cmp(this.m)&&n.isub(this.m),n},w.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());for(var o=new i(1).toRed(this),u=o.redNeg(),c=this.m.subn(1).iushrn(1),A=new i(2*(A=this.m.bitLength())*A).toRed(this);0!==this.pow(A,c).cmp(u);)A.redIAdd(u);for(var d=this.pow(A,a),p=this.pow(t,a.addn(1).iushrn(1)),f=this.pow(t,a),l=s;0!==f.cmp(o);){for(var h=f,y=0;0!==h.cmp(o);y++)h=h.redSqr();r(y<l);var g=this.pow(d,new i(1).iushln(l-y-1));p=p.redMul(g),d=g.redSqr(),f=f.redMul(d),l=y}return p},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var a=n[0],s=0,o=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;0<=r;r--){for(var c=e.words[r],A=u-1;0<=A;A--){var d=c>>A&1;a!==n[0]&&(a=this.sqr(a)),0!=d||0!==s?(s<<=1,s|=d,(4==++o||0===r&&0===A)&&(a=this.mul(a,n[s]),s=o=0)):o=0}u=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new E(t)},a(E,w),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),i=a;return 0<=a.cmp(this.m)?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),s=a;return 0<=a.cmp(this.m)?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:11}],10:[function(t,e,r){(function(t){e.exports=function(e){var n=new Uint8Array(e);return(t.crypto||t.msCrypto).getRandomValues(n),n}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,n){},{}],12:[function(t,e,n){"use strict";var r=n;r.version=t("../package.json").version,r.utils=t("./elliptic/utils"),r.rand=t("brorand"),r.curve=t("./elliptic/curve"),r.curves=t("./elliptic/curves"),r.ec=t("./elliptic/ec"),r.eddsa=t("./elliptic/eddsa")},{"../package.json":25,"./elliptic/curve":15,"./elliptic/curves":18,"./elliptic/ec":19,"./elliptic/eddsa":22,"./elliptic/utils":24,brorand:10}],13:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils"),i=a.getNAF,s=a.getJSF,o=a.assert;function u(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||0<n.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=u).prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){o(t.precomputed);var n=t._getDoubles(),r=i(e,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;for(var s=[],u=0;u<r.length;u+=n.step){var c=0;for(e=u+n.step-1;u<=e;e--)c=(c<<1)+r[e];s.push(c)}for(var A=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=a;0<p;p--){for(u=0;u<s.length;u++)(c=s[u])===p?d=d.mixedAdd(n.points[u]):c===-p&&(d=d.mixedAdd(n.points[u].neg()));A=A.add(d)}return A.toP()},u.prototype._wnafMul=function(t,e){for(var n=t._getNAFPoints(4),r=n.wnd,a=n.points,s=i(e,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;0<=c;c--){for(e=0;0<=c&&0===s[c];c--)e++;if(0<=c&&e++,u=u.dblp(e),c<0)break;var A=s[c];o(0!==A),u="affine"===t.type?0<A?u.mixedAdd(a[A-1>>1]):u.mixedAdd(a[-A-1>>1].neg()):0<A?u.add(a[A-1>>1]):u.add(a[-A-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,n,r,a){for(var o=this._wnafT1,u=this._wnafT2,c=this._wnafT3,A=0,d=0;d<r;d++){var p=(B=e[d])._getNAFPoints(t);o[d]=p.wnd,u[d]=p.points}for(d=r-1;1<=d;d-=2){var f=d-1,l=d;if(1===o[f]&&1===o[l]){var h=[e[f],null,null,e[l]];0===e[f].y.cmp(e[l].y)?(h[1]=e[f].add(e[l]),h[2]=e[f].toJ().mixedAdd(e[l].neg())):0===e[f].y.cmp(e[l].y.redNeg())?(h[1]=e[f].toJ().mixedAdd(e[l]),h[2]=e[f].add(e[l].neg())):(h[1]=e[f].toJ().mixedAdd(e[l]),h[2]=e[f].toJ().mixedAdd(e[l].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=s(n[f],n[l]);A=Math.max(g[0].length,A),c[f]=new Array(A),c[l]=new Array(A);for(var b=0;b<A;b++){var m=0|g[0][b],I=0|g[1][b];c[f][b]=y[3*(1+m)+(1+I)],c[l][b]=0,u[f]=h}}else c[f]=i(n[f],o[f],this._bitLength),c[l]=i(n[l],o[l],this._bitLength),A=Math.max(c[f].length,A),A=Math.max(c[l].length,A)}var C=this.jpoint(null,null,null),v=this._wnafT4;for(d=A;0<=d;d--){for(var w=0;0<=d;){var E=!0;for(b=0;b<r;b++)v[b]=0|c[b][d],0!==v[b]&&(E=!1);if(!E)break;w++,d--}if(0<=d&&w++,C=C.dblp(w),d<0)break;for(b=0;b<r;b++){var B,Q=v[b];0!==Q&&(0<Q?B=u[b][Q-1>>1]:Q<0&&(B=u[b][-Q-1>>1].neg()),C="affine"===B.type?C.mixedAdd(B):C.add(B))}}for(d=0;d<r;d++)u[d]=null;return a?C:C.toP()},(u.BasePoint=c).prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=a.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?o(t[t.length-1]%2==0):7===t[0]&&o(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return a.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a<e;a+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1==n?null:this.dbl(),a=1;a<n;a++)e[a]=e[a-1].add(r);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},{"../utils":24,"bn.js":9}],14:[function(t,e,n){e.exports={}},{}],15:[function(t,e,n){"use strict";var r=n;r.base=t("./base"),r.short=t("./short"),r.mont=t("./mont"),r.edwards=t("./edwards")},{"./base":13,"./edwards":14,"./mont":16,"./short":17}],16:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],17:[function(t,e,n){"use strict";var r=t("../utils"),a=t("bn.js"),i=t("inherits"),s=t("./base"),o=r.assert;function u(t){s.call(this,"short",t),this.a=new a(t.a,16).toRed(this.red),this.b=new a(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,n,r){s.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(e,16),this.y=new a(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function A(t,e,n,r){s.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(e,16),this.y=new a(n,16),this.z=new a(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(u,s),(e.exports=u).prototype._getEndomorphism=function(t){var e,n,r,i;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return r=t.beta?new a(t.beta,16).toRed(this.red):(r=(n=this._getEndoRoots(this.p))[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red),t.lambda?e=new a(t.lambda,16):(i=this._getEndoRoots(this.n),0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?e=i[0]:(e=i[1],o(0===this.g.mul(e).x.cmp(this.g.x.redMul(r))))),{beta:r,lambda:e,basis:t.basis?t.basis.map((function(t){return{a:new a(t.a,16),b:new a(t.b,16)}})):this._getEndoBasis(e)}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:a.mont(t),n=new a(2).toRed(e).redInvm(),r=n.redNeg(),i=new a(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,n,r,i,s,o,u,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),A=t,d=this.n.clone(),p=new a(1),f=new a(0),l=new a(0),h=new a(1),y=0;0!==A.cmpn(0);){var g=d.div(A),b=d.sub(g.mul(A)),m=l.sub(g.mul(p)),I=h.sub(g.mul(f));if(!r&&b.cmp(c)<0)e=u.neg(),n=p,r=b.neg(),i=m;else if(r&&2==++y)break;d=A,A=u=b,l=p,p=m,h=f,f=I}s=b.neg(),o=m;var C=r.sqr().add(i.sqr());return 0<=s.sqr().add(o.sqr()).cmp(C)&&(s=e,o=n),r.negative&&(r=r.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:r,b:i},{a:s,b:o}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],a=r.b.mul(t).divRound(this.n),i=n.b.neg().mul(t).divRound(this.n),s=a.mul(n.a),o=i.mul(r.a),u=a.mul(n.b),c=i.mul(r.b);return{k1:t.sub(s).sub(o),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new a(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(e&&!i||!e&&i)&&(r=r.redNeg()),this.point(t,r)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),a=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(a).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,a=this._endoWnafT2,i=0;i<t.length;i++){var s=this._endoSplit(e[i]),o=t[i],u=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),r[2*i]=o,r[2*i+1]=u,a[2*i]=s.k1,a[2*i+1]=s.k2}for(var c=this._wnafMulAdd(1,r,a,2*i,n),A=0;A<2*i;A++)r[A]=null,a[A]=null;return c},i(c,s.BasePoint),u.prototype.point=function(t,e,n){return new c(this,t,e,n)},u.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e,n,r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);return t&&(e=this.curve,n=function(t){return e.point(t.x.redMul(e.endo.beta),t.y)},(t.beta=r).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}),r}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,n){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],n);if(!e[2])return r;function a(e){return t.point(e[0],e[1],n)}var i=e[2];return r.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[r].concat(i.doubles.points.map(a))},naf:i.naf&&{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(a))}},r},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),i=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new a(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,n){var r=[this,e],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a):this.curve._wnafMulAdd(1,r,a,2)},c.prototype.jmulAdd=function(t,e,n){var r=[this,e],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,a,!0):this.curve._wnafMulAdd(1,r,a,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e,n,r=this.curve.point(this.x,this.y.redNeg());return t&&this.precomputed&&(e=this.precomputed,n=function(t){return t.neg()},r.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}),r},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(A,s.BasePoint),u.prototype.jpoint=function(t,e,n){return new A(this,t,e,n)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),a=t.x.redMul(n),i=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),o=r.redSub(a),u=i.redSub(s);if(0===o.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),A=c.redMul(o),d=r.redMul(c),p=u.redSqr().redIAdd(A).redISub(d).redISub(d),f=u.redMul(d.redISub(p)).redISub(i.redMul(A)),l=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(p,f,l)},A.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),a=this.y,i=t.y.redMul(e).redMul(this.z),s=n.redSub(r),o=a.redSub(i);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),A=n.redMul(u),d=o.redSqr().redIAdd(c).redISub(A).redISub(A),p=o.redMul(A.redISub(d)).redISub(a.redMul(c)),f=this.z.redMul(s);return this.curve.jpoint(d,p,f)},A.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}var r=this.curve.a,a=this.curve.tinv,i=this.x,s=this.y,o=this.z,u=o.redSqr().redSqr(),c=s.redAdd(s);for(n=0;n<t;n++){var A=i.redSqr(),d=c.redSqr(),p=d.redSqr(),f=A.redAdd(A).redIAdd(A).redIAdd(r.redMul(u)),l=i.redMul(d),h=f.redSqr().redISub(l.redAdd(l)),y=l.redISub(h),g=(g=f.redMul(y)).redIAdd(g).redISub(p),b=c.redMul(o);n+1<t&&(u=u.redMul(p)),i=h,o=b,c=g}return this.curve.jpoint(i,c.redMul(a),o)},A.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},A.prototype._zeroDbl=function(){var t,e,n,r,a,i,s,o,u,c,A,d,p,f,l,h,y=this.zOne?(n=this.x.redSqr(),a=(r=this.y.redSqr()).redSqr(),i=(i=this.x.redAdd(r).redSqr().redISub(n).redISub(a)).redIAdd(i),o=(s=n.redAdd(n).redIAdd(n)).redSqr().redISub(i).redISub(i),u=(u=(u=a.redIAdd(a)).redIAdd(u)).redIAdd(u),t=o,e=s.redMul(i.redISub(o)).redISub(u),this.y.redAdd(this.y)):(c=this.x.redSqr(),d=(A=this.y.redSqr()).redSqr(),p=(p=this.x.redAdd(A).redSqr().redISub(c).redISub(d)).redIAdd(p),l=(f=c.redAdd(c).redIAdd(c)).redSqr(),h=(h=(h=d.redIAdd(d)).redIAdd(h)).redIAdd(h),t=l.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(h),(y=this.y.redMul(this.z)).redIAdd(y));return this.curve.jpoint(t,e,y)},A.prototype._threeDbl=function(){var t,e,n,r,a,i,s,o,u,c,A,d,p,f,l,h,y;return this.zOne?(n=this.x.redSqr(),a=(r=this.y.redSqr()).redSqr(),i=(i=this.x.redAdd(r).redSqr().redISub(n).redISub(a)).redIAdd(i),u=o=(s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a)).redSqr().redISub(i).redISub(i),c=(c=(c=a.redIAdd(a)).redIAdd(c)).redIAdd(c),t=s.redMul(i.redISub(o)).redISub(c),e=this.y.redAdd(this.y)):(A=this.z.redSqr(),d=this.y.redSqr(),p=this.x.redMul(d),f=(f=this.x.redSub(A).redMul(this.x.redAdd(A))).redAdd(f).redIAdd(f),h=(l=(l=p.redIAdd(p)).redIAdd(l)).redAdd(l),u=f.redSqr().redISub(h),e=this.y.redAdd(this.z).redSqr().redISub(d).redISub(A),y=(y=(y=(y=d.redSqr()).redIAdd(y)).redIAdd(y)).redIAdd(y),t=f.redMul(l.redISub(u)).redISub(y)),this.curve.jpoint(u,t,e)},A.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,a=r.redSqr().redSqr(),i=e.redSqr(),s=n.redSqr(),o=i.redAdd(i).redIAdd(i).redIAdd(t.redMul(a)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),A=o.redSqr().redISub(c.redAdd(c)),d=c.redISub(A),p=s.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=o.redMul(d).redISub(p),l=n.redAdd(n).redMul(r);return this.curve.jpoint(A,f,l)},A.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),a=t.redAdd(t).redIAdd(t),i=a.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(r),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=a.redIAdd(s).redSqr().redISub(i).redISub(o).redISub(u),A=e.redMul(c);A=(A=A.redIAdd(A)).redIAdd(A);var d=this.x.redMul(o).redISub(A);d=(d=d.redIAdd(d)).redIAdd(d);var p=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(o)));p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=this.z.redAdd(s).redSqr().redISub(n).redISub(o);return this.curve.jpoint(d,p,f)},A.prototype.mul=function(t,e){return t=new a(t,e),this.curve._wnafMul(this,t)},A.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),a=n.redMul(t.z);return 0===this.y.redMul(a).redISub(t.y.redMul(r)).cmpn(0)},A.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),a=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(n.redIAdd(a),0===this.x.cmp(n))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":24,"./base":13,"bn.js":9,inherits:39}],18:[function(t,e,n){"use strict";var r,a=n,i=t("hash.js"),s=t("./curve"),o=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:function(){var n=new u(e);return Object.defineProperty(a,t,{configurable:!0,enumerable:!0,value:n}),n}})}a.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=t("./precomputed/secp256k1")}catch(t){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},{"./curve":15,"./precomputed/secp256k1":23,"./utils":24,"hash.js":26}],19:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("hmac-drbg"),i=t("../utils"),s=t("../curves"),u=t("brorand"),c=i.assert,A=t("./key"),d=t("./signature");function p(t){if(!(this instanceof p))return new p(t);"string"==typeof t&&(c(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=p).prototype.keyPair=function(t){return new A(this,t)},p.prototype.keyFromPrivate=function(t,e){return A.fromPrivate(this,t,e)},p.prototype.keyFromPublic=function(t,e){return A.fromPublic(this,t,e)},p.prototype.genKeyPair=function(t){t=t||{};for(var e=new a({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||u(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new r(2));;){var s=new r(e.generate(n));if(!(0<s.cmp(i)))return s.iaddn(1),this.keyFromPrivate(s)}},p.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return 0<n&&(t=t.ushrn(n)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},p.prototype.sign=function(t,e,n,i){"object"==o(n)&&(i=n,n=null),i=i||{},e=this.keyFromPrivate(e,n),t=this._truncateToN(new r(t,16));for(var s=this.n.byteLength(),u=e.getPrivate().toArray("be",s),c=t.toArray("be",s),A=new a({hash:this.hash,entropy:u,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new r(1)),f=0;;f++){var l=i.k?i.k(f):new r(A.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||0<=l.cmp(p))){var h=this.g.mul(l);if(!h.isInfinity()){var y=h.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var b=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return i.canonical&&0<b.cmp(this.nh)&&(b=this.n.sub(b),m^=1),new d({r:g,s:b,recoveryParam:m})}}}}}},p.prototype.verify=function(t,e,n,a){t=this._truncateToN(new r(t,16)),n=this.keyFromPublic(n,a);var i=(e=new d(e,"hex")).r,s=e.s;if(i.cmpn(1)<0||0<=i.cmp(this.n))return!1;if(s.cmpn(1)<0||0<=s.cmp(this.n))return!1;var o,u=s.invm(this.n),c=u.mul(t).umod(this.n),A=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(c,n.getPublic(),A)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(c,n.getPublic(),A)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},p.prototype.recoverPubKey=function(t,e,n,a){c((3&n)===n,"The recovery param is more than two bits"),e=new d(e,a);var i=this.n,s=new r(t),o=e.r,u=e.s,A=1&n,p=n>>1;if(0<=o.cmp(this.curve.p.umod(this.curve.n))&&p)throw new Error("Unable to find sencond key candinate");o=p?this.curve.pointFromX(o.add(this.curve.n),A):this.curve.pointFromX(o,A);var f=e.r.invm(i),l=i.sub(s).mul(f).umod(i),h=u.mul(f).umod(i);return this.g.mulAdd(l,o,h)},p.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new d(e,r)).recoveryParam)return e.recoveryParam;for(var a,i=0;i<4;i++){try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":18,"../utils":24,"./key":20,"./signature":21,"bn.js":9,brorand:10,"hmac-drbg":38}],20:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils").assert;function i(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=i).fromPublic=function(t,e,n){return e instanceof i?e:new i(t,{pub:e,pubEnc:n})},i.fromPrivate=function(t,e,n){return e instanceof i?e:new i(t,{priv:e,privEnc:n})},i.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},i.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},i.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(t,e){this.priv=new r(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?a(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},i.prototype.derive=function(t){return t.mul(this.priv).getX()},i.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},i.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":24,"bn.js":9}],21:[function(t,e,n){"use strict";var r=t("bn.js"),a=t("../utils"),i=a.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(i(t.r&&t.s,"Signature without r or s"),this.r=new r(t.r,16),this.s=new r(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function o(){this.place=0}function u(t,e){var n=t[e.place++];if(!(128&n))return n;var r=15&n;if(0==r||4<r)return!1;for(var a=0,i=0,s=e.place;i<r;i++,s++)a<<=8,a|=t[s],a>>>=0;return!(a<=127)&&(e.place=s,a)}function c(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function A(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}(e.exports=s).prototype._importDER=function(t,e){t=a.toArray(t,e);var n=new o;if(48!==t[n.place++])return!1;var i=u(t,n);if(!1===i)return!1;if(i+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var s=u(t,n);if(!1===s)return!1;var c=t.slice(n.place,s+n.place);if(n.place+=s,2!==t[n.place++])return!1;var A=u(t,n);if(!1===A)return!1;if(t.length!==A+n.place)return!1;var d=t.slice(n.place,A+n.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new r(c),this.s=new r(d),!(this.recoveryParam=null)},s.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=c(e),n=c(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];A(r,e.length),(r=r.concat(e)).push(2),A(r,n.length);var i=r.concat(n),s=[48];return A(s,i.length),s=s.concat(i),a.encode(s,t)}},{"../utils":24,"bn.js":9}],22:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],23:[function(t,e,n){e.exports=void 0},{}],24:[function(t,e,n){"use strict";var r=n,a=t("bn.js"),i=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");r.assert=i,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var a=1<<e+1,i=t.clone(),s=0;s<r.length;s++){var o,u=i.andln(a-1);i.isOdd()?(o=(a>>1)-1<u?(a>>1)-u:u,i.isubn(o)):o=0,r[s]=o,i.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r=0,a=0;0<t.cmpn(-r)||0<e.cmpn(-a);){var i,s,o,u=t.andln(3)+r&3,c=e.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),i=0==(1&u)?0:3!=(s=t.andln(7)+r&7)&&5!==s||2!==c?u:-u,n[0].push(i),o=0==(1&c)?0:3!=(s=e.andln(7)+a&7)&&5!==s||2!==u?c:-c,n[1].push(o),2*r===i+1&&(r=1-r),2*a===o+1&&(a=1-a),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new a(t,"hex","le")}},{"bn.js":9,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],25:[function(t,e,n){e.exports={version:"6.5.3"}},{}],26:[function(t,e,n){var r=n;r.utils=t("./hash/utils"),r.common=t("./hash/common"),r.sha=t("./hash/sha"),r.ripemd=t("./hash/ripemd"),r.hmac=t("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":27,"./hash/hmac":28,"./hash/ripemd":29,"./hash/sha":30,"./hash/utils":37}],27:[function(t,e,n){"use strict";var r=t("./utils"),a=t("minimalistic-assert");function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(n.BlockHash=i).prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=t>>>24&255,r[a++]=t>>>16&255,r[a++]=t>>>8&255,r[a++]=255&t}else for(r[a++]=255&t,r[a++]=t>>>8&255,r[a++]=t>>>16&255,r[a++]=t>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r}},{"./utils":37,"minimalistic-assert":41}],28:[function(t,e,n){"use strict";var r=t("./utils"),a=t("minimalistic-assert");function i(t,e,n){if(!(this instanceof i))return new i(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,n))}(e.exports=i).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),a(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},i.prototype.update=function(t,e){return this.inner.update(t,e),this},i.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":37,"minimalistic-assert":41}],29:[function(t,e,n){"use strict";var r=t("./utils"),a=t("./common"),i=r.rotl32,s=r.sum32,o=r.sum32_3,u=r.sum32_4,c=a.BlockHash;function A(){if(!(this instanceof A))return new A;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}r.inherits(A,c),(n.ripemd160=A).blockSize=512,A.outSize=160,A.hmacStrength=192,A.padLength=64,A.prototype._update=function(t,e){for(var n,r,a=I=this.h[0],c=E=this.h[1],A=w=this.h[2],y=v=this.h[3],g=C=this.h[4],b=0;b<80;b++){var m=s(i(u(I,d(b,E,w,v),t[p[b]+e],(r=b)<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838),l[b]),C),I=C,C=v,v=i(w,10),w=E,E=m;m=s(i(u(a,d(79-b,c,A,y),t[f[b]+e],(n=b)<=15?1352829926:n<=31?1548603684:n<=47?1836072691:n<=63?2053994217:0),h[b]),g),a=g,g=y,y=i(A,10),A=c,c=m}m=o(this.h[1],w,y),this.h[1]=o(this.h[2],v,g),this.h[2]=o(this.h[3],C,a),this.h[3]=o(this.h[4],I,c),this.h[4]=o(this.h[0],E,A),this.h[0]=m},A.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.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],f=[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],l=[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],h=[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]},{"./common":27,"./utils":37}],30:[function(t,e,n){"use strict";n.sha1=t("./sha/1"),n.sha224=t("./sha/224"),n.sha256=t("./sha/256"),n.sha384=t("./sha/384"),n.sha512=t("./sha/512")},{"./sha/1":31,"./sha/224":32,"./sha/256":33,"./sha/384":34,"./sha/512":35}],31:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],32:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],33:[function(t,e,n){"use strict";var r=t("../utils"),a=t("../common"),i=t("./common"),s=t("minimalistic-assert"),o=r.sum32,u=r.sum32_4,c=r.sum32_5,A=i.ch32,d=i.maj32,p=i.s0_256,f=i.s1_256,l=i.g0_256,h=i.g1_256,y=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}r.inherits(b,y),(e.exports=b).blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=u(h(n[r-2]),n[r-7],l(n[r-15]),n[r-16]);var a=this.h[0],i=this.h[1],y=this.h[2],g=this.h[3],b=this.h[4],m=this.h[5],I=this.h[6],C=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var v=c(C,f(b),A(b,m,I),this.k[r],n[r]),w=o(p(a),d(a,i,y));C=I,I=m,m=b,b=o(g,v),g=y,y=i,i=a,a=o(v,w)}this.h[0]=o(this.h[0],a),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],y),this.h[3]=o(this.h[3],g),this.h[4]=o(this.h[4],b),this.h[5]=o(this.h[5],m),this.h[6]=o(this.h[6],I),this.h[7]=o(this.h[7],C)},b.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},{"../common":27,"../utils":37,"./common":36,"minimalistic-assert":41}],34:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],35:[function(t,e,n){"use strict";var r=t("../utils"),a=t("../common"),i=t("minimalistic-assert"),s=r.rotr64_hi,o=r.rotr64_lo,u=r.shr64_hi,c=r.shr64_lo,A=r.sum64,d=r.sum64_hi,p=r.sum64_lo,f=r.sum64_4_hi,l=r.sum64_4_lo,h=r.sum64_5_hi,y=r.sum64_5_lo,g=a.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}r.inherits(m,g),(e.exports=m).blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var a=function(t,e){var n=s(t,e,19)^s(e,t,29)^u(t,e,6);return n<0&&(n+=4294967296),n}(n[r-4],n[r-3]),i=function(t,e){var n=o(t,e,19)^o(e,t,29)^c(t,e,6);return n<0&&(n+=4294967296),n}(n[r-4],n[r-3]),A=n[r-14],d=n[r-13],p=function(t,e){var n=s(t,e,1)^s(t,e,8)^u(t,e,7);return n<0&&(n+=4294967296),n}(n[r-30],n[r-29]),h=function(t,e){var n=o(t,e,1)^o(t,e,8)^c(t,e,7);return n<0&&(n+=4294967296),n}(n[r-30],n[r-29]),y=n[r-32],g=n[r-31];n[r]=f(a,i,A,d,p,h,y,g),n[r+1]=l(a,i,A,d,p,h,y,g)}},m.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],a=this.h[1],u=this.h[2],c=this.h[3],f=this.h[4],l=this.h[5],g=this.h[6],b=this.h[7],m=this.h[8],I=this.h[9],C=this.h[10],v=this.h[11],w=this.h[12],E=this.h[13],B=this.h[14],Q=this.h[15];i(this.k.length===n.length);for(var M=0;M<n.length;M+=2){var _=B,x=Q,k=function(t,e){var n=s(t,e,14)^s(t,e,18)^s(e,t,9);return n<0&&(n+=4294967296),n}(m,I),S=function(t,e){var n=o(t,e,14)^o(t,e,18)^o(e,t,9);return n<0&&(n+=4294967296),n}(m,I),D=function(t,e,n){var r=t&e^~t&n;return r<0&&(r+=4294967296),r}(m,C,w),R=function(t,e,n){var r=t&e^~t&n;return r<0&&(r+=4294967296),r}(I,v,E),N=this.k[M],T=this.k[M+1],O=n[M],H=n[M+1],L=h(_,x,k,S,D,R,N,T,O,H),U=y(_,x,k,S,D,R,N,T,O,H),j=(_=function(t,e){var n=s(t,e,28)^s(e,t,2)^s(e,t,7);return n<0&&(n+=4294967296),n}(r,a),x=function(t,e){var n=o(t,e,28)^o(e,t,2)^o(e,t,7);return n<0&&(n+=4294967296),n}(r,a),k=function(t,e,n){var r=t&e^t&n^e&n;return r<0&&(r+=4294967296),r}(r,u,f),S=function(t,e,n){var r=t&e^t&n^e&n;return r<0&&(r+=4294967296),r}(a,c,l),d(_,x,k,S)),F=p(_,x,k,S);B=w,Q=E,w=C,E=v,C=m,v=I,m=d(g,b,L,U),I=p(b,b,L,U),g=f,b=l,f=u,l=c,u=r,c=a,r=d(L,U,j,F),a=p(L,U,j,F)}A(this.h,0,r,a),A(this.h,2,u,c),A(this.h,4,f,l),A(this.h,6,g,b),A(this.h,8,m,I),A(this.h,10,C,v),A(this.h,12,w,E),A(this.h,14,B,Q)},m.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},{"../common":27,"../utils":37,"minimalistic-assert":41}],36:[function(t,e,n){"use strict";var r=t("../utils").rotr32;function a(t,e,n){return t&e^~t&n}function i(t,e,n){return t&e^t&n^e&n}n.ft_1=function(t,e,n,r){return 0===t?a(e,n,r):1===t||3===t?e^n^r:2===t?i(e,n,r):void 0},n.ch32=a,n.maj32=i,n.p32=function(t,e,n){return t^e^n},n.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},n.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},n.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},n.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},{"../utils":37}],37:[function(t,e,n){"use strict";var r=t("minimalistic-assert"),a=t("inherits");function i(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function o(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}n.inherits=a,n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(var r=0;r<t.length;r++){var a=t.charCodeAt(r),i=a>>8,s=255&a;i?n.push(i,s):n.push(s)}else for(r=0;r<t.length;r++)n[r]=0|t[r];return n},n.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=s(t[n].toString(16));return e},n.htonl=i,n.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var a=t[r];"little"===e&&(a=i(a)),n+=o(a.toString(16))}return n},n.zero2=s,n.zero8=o,n.join32=function(t,e,n,a){var i=n-e;r(i%4==0);for(var s=new Array(i/4),o=0,u=e;o<s.length;o++,u+=4){var c="big"===a?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u];s[o]=c>>>0}return s},n.split32=function(t,e){for(var n=new Array(4*t.length),r=0,a=0;r<t.length;r++,a+=4){var i=t[r];"big"===e?(n[a]=i>>>24,n[a+1]=i>>>16&255,n[a+2]=i>>>8&255,n[a+3]=255&i):(n[a+3]=i>>>24,n[a+2]=i>>>16&255,n[a+1]=i>>>8&255,n[a]=255&i)}return n},n.rotr32=function(t,e){return t>>>e|t<<32-e},n.rotl32=function(t,e){return t<<e|t>>>32-e},n.sum32=function(t,e){return t+e>>>0},n.sum32_3=function(t,e,n){return t+e+n>>>0},n.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},n.sum32_5=function(t,e,n,r,a){return t+e+n+r+a>>>0},n.sum64=function(t,e,n,r){var a=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+a;t[e]=s>>>0,t[e+1]=i},n.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},n.sum64_lo=function(t,e,n,r){return e+r>>>0},n.sum64_4_hi=function(t,e,n,r,a,i,s,o){var u=0,c=e;return u+=(c=c+r>>>0)<e?1:0,u+=(c=c+i>>>0)<i?1:0,t+n+a+s+(u+=(c=c+o>>>0)<o?1:0)>>>0},n.sum64_4_lo=function(t,e,n,r,a,i,s,o){return e+r+i+o>>>0},n.sum64_5_hi=function(t,e,n,r,a,i,s,o,u,c){var A=0,d=e;return A+=(d=d+r>>>0)<e?1:0,A+=(d=d+i>>>0)<i?1:0,A+=(d=d+o>>>0)<o?1:0,t+n+a+s+u+(A+=(d=d+c>>>0)<c?1:0)>>>0},n.sum64_5_lo=function(t,e,n,r,a,i,s,o,u,c){return e+r+i+o+c>>>0},n.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},n.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},n.shr64_hi=function(t,e,n){return t>>>n},n.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},{inherits:39,"minimalistic-assert":41}],38:[function(t,e,n){"use strict";var r=t("hash.js"),a=t("minimalistic-crypto-utils"),i=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=a.toArray(t.entropy,t.entropyEnc||"hex"),n=a.toArray(t.nonce,t.nonceEnc||"hex"),r=a.toArray(t.pers,t.persEnc||"hex");i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}(e.exports=s).prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=a.toArray(t,e),n=a.toArray(n,r),i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},s.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=a.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,t);return this._update(n),this._reseed++,a.encode(s,e)}},{"hash.js":26,"minimalistic-assert":41,"minimalistic-crypto-utils":42}],39:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){var n;e&&(t.super_=e,(n=function(){}).prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t)}},{}],40:[function(t,e,r){(function(t,n){!function(){"use strict";var r="object"==("undefined"==typeof window?"undefined":o(window))?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"==o(t)&&t.versions&&t.versions.node&&(r=n);for(var a=!r.JS_SHA3_NO_COMMON_JS&&"object"==o(e)&&e.exports,i="0123456789abcdef".split(""),s=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],c=[224,256,384,512],A=["hex","buffer","arrayBuffer","array"],d=function(t,e,n){return function(r){return new v(t,e,t).update(r)[n]()}},p=function(t,e,n){return function(r,a){return new v(t,e,a).update(r)[n]()}},f=function(t,e){var n=d(t,e,"hex");n.create=function(){return new v(t,e,t)},n.update=function(t){return n.create().update(t)};for(var r=0;r<A.length;++r){var a=A[r];n[a]=d(t,e,a)}return n},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:c,createMethod:f},{name:"sha3",padding:[6,1536,393216,100663296],bits:c,createMethod:f},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var n=p(t,e,"hex");n.create=function(n){return new v(t,e,n)},n.update=function(t,e){return n.create(e).update(t)};for(var r=0;r<A.length;++r){var a=A[r];n[a]=p(t,e,a)}return n}}],h={},y=[],g=0;g<l.length;++g)for(var b=l[g],m=b.bits,I=0;I<m.length;++I){var C=b.name+"_"+m[I];y.push(C),h[C]=b.createMethod(m[I],b.padding)}function v(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}v.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var n,r,a=t.length,i=this.blocks,o=this.byteCount,u=this.blockCount,c=0,A=this.s;c<a;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<u+1;++n)i[n]=0;if(e)for(n=this.start;c<a&&n<o;++c)i[n>>2]|=t[c]<<s[3&n++];else for(n=this.start;c<a&&n<o;++c)(r=t.charCodeAt(c))<128?i[n>>2]|=r<<s[3&n++]:(r<2048?i[n>>2]|=(192|r>>6)<<s[3&n++]:(r<55296||57344<=r?i[n>>2]|=(224|r>>12)<<s[3&n++]:(r=65536+((1023&r)<<10|1023&t.charCodeAt(++c)),i[n>>2]|=(240|r>>18)<<s[3&n++],i[n>>2]|=(128|r>>12&63)<<s[3&n++]),i[n>>2]|=(128|r>>6&63)<<s[3&n++]),i[n>>2]|=(128|63&r)<<s[3&n++]);if(o<=(this.lastByteIndex=n)){for(this.start=n-o,this.block=i[u],n=0;n<u;++n)A[n]^=i[n];w(A),this.reset=!0}else this.start=n}return this},v.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];w(r)},v.prototype.toString=v.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,a=this.extraBytes,s=0,o=0,u="";o<r;){for(s=0;s<e&&o<r;++s,++o)t=n[s],u+=i[t>>4&15]+i[15&t]+i[t>>12&15]+i[t>>8&15]+i[t>>20&15]+i[t>>16&15]+i[t>>28&15]+i[t>>24&15];o%e==0&&(w(n),s=0)}return a&&(t=n[s],0<a&&(u+=i[t>>4&15]+i[15&t]),1<a&&(u+=i[t>>12&15]+i[t>>8&15]),2<a&&(u+=i[t>>20&15]+i[t>>16&15])),u},v.prototype.buffer=v.prototype.arrayBuffer=function(){this.finalize();for(var t=this.blockCount,e=this.s,n=this.outputBlocks,r=this.extraBytes,a=0,i=0,s=this.outputBits>>3,o=r?new ArrayBuffer(n+1<<2):new ArrayBuffer(s),u=new Uint32Array(o);i<n;){for(a=0;a<t&&i<n;++a,++i)u[i]=e[a];i%t==0&&w(e)}return r&&(u[a]=e[a],o=o.slice(0,s)),o},v.prototype.digest=v.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,a=this.outputBlocks,i=this.extraBytes,s=0,o=0,u=[];o<a;){for(s=0;s<n&&o<a;++s,++o)t=o<<2,e=r[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;o%n==0&&w(r)}return i&&(t=o<<2,e=r[s],0<i&&(u[t]=255&e),1<i&&(u[t+1]=e>>8&255),2<i&&(u[t+2]=e>>16&255)),u};var w=function(t){for(var e,n,r,a,i,s,o,c,A,d,p,f,l,h,y,g,b,m,I,C,v,w,E,B,Q,M,_,x,k,S,D,R,N,T,O,H,L,U,j,F,P,G,q,Y,K,z,J,V,W,Z,X,$,tt,et,nt,rt,at,it,st,ot,ut,ct,At=0;At<48;At+=2)r=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],A=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(p=t[8]^t[18]^t[28]^t[38]^t[48])^(i<<1|s>>>31),n=(f=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|i>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=r^(o<<1|c>>>31),n=a^(c<<1|o>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=i^(A<<1|d>>>31),n=s^(d<<1|A>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=o^(p<<1|f>>>31),n=c^(f<<1|p>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=A^(r<<1|a>>>31),n=d^(a<<1|r>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,l=t[0],h=t[1],K=t[11]<<4|t[10]>>>28,z=t[10]<<4|t[11]>>>28,_=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ot=t[30]<<9|t[31]>>>23,P=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,T=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,V=t[23]<<10|t[22]>>>22,k=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ct=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,O=t[14]<<6|t[15]>>>26,H=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,m=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,D=t[45]<<29|t[44]>>>3,R=t[44]<<29|t[45]>>>3,E=t[6]<<28|t[7]>>>4,B=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,rt=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,I=t[36]<<21|t[37]>>>11,C=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,$=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,Y=t[9]<<27|t[8]>>>5,Q=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,at=t[29]<<7|t[28]>>>25,it=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,F=t[39]<<8|t[38]>>>24,v=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=l^~y&b,t[1]=h^~g&m,t[10]=E^~Q&_,t[11]=B^~M&x,t[20]=N^~O&L,t[21]=T^~H&U,t[30]=q^~K&J,t[31]=Y^~z&V,t[40]=tt^~nt&at,t[41]=et^~rt&it,t[2]=y^~b&I,t[3]=g^~m&C,t[12]=Q^~_&k,t[13]=M^~x&S,t[22]=O^~L&j,t[23]=H^~U&F,t[32]=K^~J&W,t[33]=z^~V&Z,t[42]=nt^~at&st,t[43]=rt^~it&ot,t[4]=b^~I&v,t[5]=m^~C&w,t[14]=_^~k&D,t[15]=x^~S&R,t[24]=L^~j&P,t[25]=U^~F&G,t[34]=J^~W&X,t[35]=V^~Z&$,t[44]=at^~st&ut,t[45]=it^~ot&ct,t[6]=I^~v&l,t[7]=C^~w&h,t[16]=k^~D&E,t[17]=S^~R&B,t[26]=j^~P&N,t[27]=F^~G&T,t[36]=W^~X&q,t[37]=Z^~$&Y,t[46]=st^~ut&tt,t[47]=ot^~ct&et,t[8]=v^~l&y,t[9]=w^~h&g,t[18]=D^~E&Q,t[19]=R^~B&M,t[28]=P^~N&O,t[29]=G^~T&H,t[38]=X^~q&K,t[39]=$^~Y&z,t[48]=ut^~tt&nt,t[49]=ct^~et&rt,t[0]^=u[At],t[1]^=u[At+1]};if(a)e.exports=h;else for(g=0;g<y.length;++g)r[y[g]]=h[y[g]]}()}).call(this,t("_process"),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:43}],41:[function(t,e,n){(e.exports=function(t,e){if(!t)throw new Error(e||"Assertion failed")}).equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},{}],42:[function(t,e,n){"use strict";var r=n;function a(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",n=0;n<t.length;n++)e+=a(t[n].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var a=t.charCodeAt(r),i=a>>8,s=255&a;i?n.push(i,s):n.push(s)}return n},r.zero2=a,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},{}],43:[function(t,e,n){e.exports={browser:!0}},{}],44:[function(t,e,n){(function(t){"use strict";function r(t){var e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=1779033703,r=3144134277,a=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635,c=1541459225,A=new Array(64);function d(t){for(var d=0,p=t.length;64<=p;){for(var f,l,h,y,g=n,b=r,m=a,I=i,C=s,v=o,w=u,E=c,B=0;B<16;B++)l=d+4*B,A[B]=(255&t[l])<<24|(255&t[l+1])<<16|(255&t[l+2])<<8|255&t[l+3];for(B=16;B<64;B++)h=((f=A[B-2])>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,y=((f=A[B-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,A[B]=(h+A[B-7]|0)+(y+A[B-16]|0)|0;for(B=0;B<64;B++)h=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&v^~C&w)|0)+(E+(e[B]+A[B]|0)|0)|0,y=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&m^b&m)|0,E=w,w=v,v=C,C=I+h|0,I=m,m=b,b=g,g=h+y|0;n=n+g|0,r=r+b|0,a=a+m|0,i=i+I|0,s=s+C|0,o=o+v|0,u=u+w|0,c=c+E|0,d+=64,p-=64}}d(t);var p,f=t.length%64,l=t.length/536870912|0,h=t.length<<3,y=f<56?56:120,g=t.slice(t.length-f,t.length);for(g.push(128),p=1+f;p<y;p++)g.push(0);return g.push(l>>>24&255),g.push(l>>>16&255),g.push(l>>>8&255),g.push(l>>>0&255),g.push(h>>>24&255),g.push(h>>>16&255),g.push(h>>>8&255),g.push(h>>>0&255),d(g),[n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function a(t,e,n){t=t.length<=64?t:r(t);for(var a=64+e.length+4,i=new Array(a),s=new Array(64),o=[],u=0;u<64;u++)i[u]=54;for(u=0;u<t.length;u++)i[u]^=t[u];for(u=0;u<e.length;u++)i[64+u]=e[u];for(u=a-4;u<a;u++)i[u]=0;for(u=0;u<64;u++)s[u]=92;for(u=0;u<t.length;u++)s[u]^=t[u];function c(){for(var t=a-1;a-4<=t;t--){if(i[t]++,i[t]<=255)return;i[t]=0}}for(;32<=n;)c(),o=o.concat(r(s.concat(r(i)))),n-=32;return 0<n&&(c(),o=o.concat(r(s.concat(r(i))).slice(0,n))),o}function i(t,e,n,r,a){var i;for(u(t,16*(2*n-1),a,0,16),i=0;i<2*n;i++)o(t,16*i,a,16),function(t,e){u(t,0,e,0,16);for(var n=8;0<n;n-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(n=0;n<16;++n)t[n]+=e[n]}(a,r),u(a,0,t,e+16*i,16);for(i=0;i<n;i++)u(t,e+2*i*16,t,16*i,16);for(i=0;i<n;i++)u(t,e+16*(2*i+1),t,16*(i+n),16)}function s(t,e){return t<<e|t>>>32-e}function o(t,e,n,r){for(var a=0;a<r;a++)n[a]^=t[e+a]}function u(t,e,n,r,a){for(;a--;)n[r++]=t[e++]}function c(t){if(t&&"number"==typeof t.length){for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return;var n=parseInt(t[e]);if(n!=t[e]||n<0||256<=n)return}return 1}}function A(t,e){var n=parseInt(t);if(t!=n)throw new Error("invalid "+e);return n}function d(e,n,r,s,d,p,l){if(!l)throw new Error("missing callback");if(r=A(r,"N"),s=A(s,"r"),d=A(d,"p"),p=A(p,"dkLen"),0===r||0!=(r&r-1))throw new Error("N must be power of 2");if(f/128/s<r)throw new Error("N too large");if(f/128/d<s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(n))throw new Error("salt must be an array or buffer");n=Array.prototype.slice.call(n);for(var h=a(e,n,128*d*s),y=new Uint32Array(32*d*s),g=0;g<y.length;g++){var b=4*g;y[g]=(255&h[3+b])<<24|(255&h[2+b])<<16|(255&h[1+b])<<8|(255&h[0+b])<<0}var m,I,C=new Uint32Array(64*s),v=new Uint32Array(32*s*r),w=32*s,E=new Uint32Array(16),B=new Uint32Array(16),Q=d*r*2,M=0,_=null,x=!1,k=0,S=0,D=parseInt(1e3/s),R=void 0!==t?t:setTimeout;!function t(){if(x)return l(new Error("cancelled"),M/Q);switch(k){case 0:u(y,I=32*S*s,C,0,w),k=1,m=0;case 1:D<(c=r-m)&&(c=D);for(var n=0;n<c;n++)u(C,0,v,(m+n)*w,w),i(C,w,s,E,B);if(m+=c,M+=c,(A=parseInt(1e3*M/Q))!==_){if(x=l(null,M/Q))break;_=A}if(m<r)break;m=0,k=2;case 2:var c,A;for(D<(c=r-m)&&(c=D),n=0;n<c;n++){var f=C[16*(2*s-1)]&r-1;o(v,f*w,C,w),i(C,w,s,E,B)}if(m+=c,M+=c,(A=parseInt(1e3*M/Q))!==_){if(x=l(null,M/Q))break;_=A}if(m<r)break;if(u(C,0,y,I,w),++S<d){k=0;break}for(h=[],n=0;n<y.length;n++)h.push(y[n]>>0&255),h.push(y[n]>>8&255),h.push(y[n]>>16&255),h.push(y[n]>>24&255);var g=a(e,h,p);return l(null,1,g)}R(t)}()}var p,f;p=this,f=2147483647,void 0!==n?e.exports=d:p&&(p.scrypt&&(p._scrypt=p.scrypt),p.scrypt=d)}).call(this,t("timers").setImmediate)},{timers:46}],45:[function(t,e,r){(function(t,e,n){!function(e,n){"use strict";var r,a,i,s,o,u,c,A,d;function p(t){return a[r]=f.apply(n,t),r++}function f(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(n,e):new Function(""+t)()}}function l(t){if(i)setTimeout(f(l,t),0);else{var e=a[t];if(e){i=!0;try{e()}finally{h(t),i=!1}}}}function h(t){delete a[t]}function y(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(A)&&l(+t.data.slice(A.length))}e.setImmediate||(r=1,i=!(a={}),s=e.document,d=(d=Object.getPrototypeOf&&Object.getPrototypeOf(e))&&d.setTimeout?d:e,o="[object process]"==={}.toString.call(e.process)?function(){var e=p(arguments);return t.nextTick(f(l,e)),e}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(A="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",y,!1):e.attachEvent("onmessage",y),function(){var t=p(arguments);return e.postMessage(A+t,"*"),t}):e.MessageChannel?((c=new MessageChannel).port1.onmessage=function(t){l(t.data)},function(){var t=p(arguments);return c.port2.postMessage(t),t}):s&&"onreadystatechange"in s.createElement("script")?(u=s.documentElement,function(){var t=p(arguments),e=s.createElement("script");return e.onreadystatechange=function(){l(t),e.onreadystatechange=null,u.removeChild(e),e=null},u.appendChild(e),t}):function(){var t=p(arguments);return setTimeout(f(l,t),0),t},d.setImmediate=o,d.clearImmediate=h)}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,t("_process"),void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").clearImmediate)},{_process:43,timers:46}],46:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(t,e,r){(function(t){var n,r,a;t.crypto&&crypto.getRandomValues&&(n=new Uint8Array(16),r=function(){return crypto.getRandomValues(n),n}),r||(a=new Array(16),r=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),a[e]=t>>>((3&e)<<3)&255;return a}),e.exports=r}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],48:[function(t,e,n){for(var r=t("./rng"),a=[],i={},s=0;s<256;s++)a[s]=(s+256).toString(16).substr(1),i[a[s]]=s;function o(t,e){var n=e||0;return a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+"-"+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]+a[t[n++]]}var u=r(),c=[1|u[0],u[1],u[2],u[3],u[4],u[5]],A=16383&(u[6]<<8|u[7]),d=0,p=0;function f(t,e,n){var a=e&&n||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;s++)e[a+s]=i[s];return e||o(i)}var l=f;l.v1=function(t,e,n){var r=e&&n||0,a=e||[],i=void 0!==(t=t||{}).clockseq?t.clockseq:A,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:p+1,f=s-d+(u-p)/1e4;if(f<0&&void 0===t.clockseq&&(i=i+1&16383),(f<0||d<s)&&void 0===t.nsecs&&(u=0),1e4<=u)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=s,A=i;var l=(1e4*(268435455&(s+=122192928e5))+(p=u))%4294967296;a[r++]=l>>>24&255,a[r++]=l>>>16&255,a[r++]=l>>>8&255,a[r++]=255&l;var h=s/4294967296*1e4&268435455;a[r++]=h>>>8&255,a[r++]=255&h,a[r++]=h>>>24&15|16,a[r++]=h>>>16&255,a[r++]=i>>>8|128,a[r++]=255&i;for(var y=t.node||c,g=0;g<6;g++)a[r+g]=y[g];return e||o(a)},l.v4=f,l.parse=function(t,e,n){var r=e&&n||0,a=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,(function(t){a<16&&(e[r+a++]=i[t])}));a<16;)e[r+a++]=0;return e},l.unparse=o,e.exports=l},{"./rng":47}],49:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],50:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/properties"),a=(i.isProvider=function(t){return r.isType(t,"Provider")},i);function i(){r.setType(this,"Provider")}n.Provider=a},{"../utils/properties":74}],51:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("../utils/address"),u=t("../utils/bignumber"),c=t("../utils/bytes"),A=t("../constants"),d=t("../utils/hash"),p=t("../utils/networks"),f=t("../utils/properties"),l=t("../utils/rlp"),h=t("../utils/transaction"),y=t("../utils/utf8"),g=t("../utils/web"),b=i(t("../errors")),m=t("./abstract-provider");function I(t,e){var n={};for(var r in t)try{var a=t[r](e[r]);void 0!==a&&(n[r]=a)}catch(t){throw t.checkKey=r,t.checkValue=e[r],t}return n}function C(t,e){return function(n){return null==n?e:t(n)}}function v(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");var n=[];return e.forEach((function(e){n.push(t(e))})),n}}function w(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),32===c.hexDataLength(t))?t.toLowerCase():(b.throwError("invalid hash",b.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function E(t){return u.bigNumberify(t).toNumber()}function B(t){if(!c.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function Q(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return c.hexStripZeros(c.hexlify(t));if(c.isHexString(t))return c.hexStripZeros(t);throw new Error("invalid blockTag")}var M={hash:w,blockHash:C(w,null),blockNumber:C(E,null),transactionIndex:C(E,null),confirmations:C(E,null),from:s.getAddress,gasPrice:u.bigNumberify,gasLimit:u.bigNumberify,to:C(s.getAddress,null),value:u.bigNumberify,nonce:E,data:c.hexlify,r:C(B),s:C(B),v:C(E),creates:C(s.getAddress,null),raw:C(c.hexlify)};function _(t){var e;null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&u.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=s.getContractAddress(t)),t.raw||t.v&&t.r&&t.s&&(e=[c.stripZeros(c.hexlify(t.nonce)),c.stripZeros(c.hexlify(t.gasPrice)),c.stripZeros(c.hexlify(t.gasLimit)),t.to||"0x",c.stripZeros(c.hexlify(t.value||"0x")),c.hexlify(t.data||"0x"),c.stripZeros(c.hexlify(t.v||"0x")),c.stripZeros(c.hexlify(t.r)),c.stripZeros(c.hexlify(t.s))],t.raw=l.encode(e));var n=I(M,t),r=t.networkId;return null!=t.chainId&&null==r&&null==n.v&&(r=t.chainId),c.isHexString(r)&&(r=u.bigNumberify(r).toNumber()),"number"!=typeof r&&null!=n.v&&((r=(n.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),n.networkId=r,null==n.chainId&&null!=r&&(n.chainId=r),n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}var x={hash:w,parentHash:w,number:E,timestamp:E,nonce:C(c.hexlify),difficulty:function(t){var e=u.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:u.bigNumberify,gasUsed:u.bigNumberify,miner:s.getAddress,extraData:c.hexlify,transactions:C(v(w))},k=f.shallowCopy(x);function S(t,e){return null!=t.author&&null==t.miner&&(t.miner=t.author),I(e?k:x,t)}k.transactions=C(v(_));var D={from:C(s.getAddress),nonce:C(E),gasLimit:C(u.bigNumberify),gasPrice:C(u.bigNumberify),to:C(s.getAddress),value:C(u.bigNumberify),data:C(c.hexlify)};function R(t){return I(D,t)}var N={transactionLogIndex:C(E),transactionIndex:E,blockNumber:E,transactionHash:w,address:s.getAddress,topics:v(w),data:c.hexlify,logIndex:E,blockHash:w},T={to:C(s.getAddress,null),from:C(s.getAddress,null),contractAddress:C(s.getAddress,null),transactionIndex:E,root:C(w),gasUsed:u.bigNumberify,logsBloom:C(c.hexlify),blockHash:w,transactionHash:w,logs:v((function(t){return I(N,t)})),blockNumber:E,confirmations:C(E,null),cumulativeGasUsed:u.bigNumberify,status:C(E)};function O(t){return Array.isArray(t)?t.forEach((function(t){O(t)})):null!=t&&w(t),t}var H,L={fromBlock:C(Q,void 0),toBlock:C(Q,void 0),address:C(s.getAddress,void 0),topics:C(O,void 0)},U={blockHash:C(w,void 0),address:C(s.getAddress,void 0),topics:C(O,void 0)},j={blockNumber:C(E),blockHash:C(w),transactionIndex:E,removed:C((function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)})),address:s.getAddress,data:(H=c.hexlify,function(t){return t?H(t):"0x"}),topics:v(w),transactionHash:w,logIndex:E};function F(t){return I(j,t)}function P(t){return t.map((function(t){return"string"==typeof t?t:Array.isArray(t)?(t.forEach((function(t){null!==t&&32!==c.hexDataLength(t)&&b.throwError("invalid topic",b.INVALID_ARGUMENT,{argument:"topic",value:t})})),t.join(",")):null===t?"":b.throwError("invalid topic value",b.INVALID_ARGUMENT,{argument:"topic",value:t})})).join("&")}function G(t){if("string"==typeof t){if(20===c.hexDataLength(t))return"address:"+s.getAddress(t);if(t=t.toLowerCase(),32===c.hexDataLength(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter::"+P(t);if(t&&"object"==o(t))return"filter:"+(t.address||"")+":"+P(t.topics||[])}throw new Error("invalid event - "+t)}function q(){return(new Date).getTime()}var Y,K=(a(z,Y=m.Provider),z.prototype._doPoll=function(){var t=this;this.getBlockNumber().then((function(e){if(t.polling&&(t._setFastBlockNumber(e),e!==t._lastBlockNumber)){-2===t._emitted.block&&(t._emitted.block=e-1);for(var n=t._emitted.block+1;n<=e;n++)t.emit("block",n);t._emitted.block!==e&&(t._emitted.block=e,Object.keys(t._emitted).forEach((function(n){var r;"block"===n||"pending"!==(r=t._emitted[n])&&12<e-r&&delete t._emitted[n]}))),-2===t._lastBlockNumber&&(t._lastBlockNumber=e-1);var r={},a={};return t._events.forEach((function(t){a[t.tag]=!0})),Object.keys(a).forEach((function(n){var a=n.split(":");switch(a[0]){case"tx":var i=a[1];t.getTransactionReceipt(i).then((function(e){return e&&null!=e.blockNumber&&(t._emitted["t:"+i]=e.blockNumber,t.emit(i,e)),null})).catch((function(e){t.emit("error",e)}));break;case"address":var s=a[1];t._balances[s]&&(r[s]=t._balances[s]),t.getBalance(s,"latest").then((function(e){var n=t._balances[s];if(!n||!e.eq(n))return t._balances[s]=e,t.emit(s,e),null})).catch((function(e){t.emit("error",e)}));break;case"filter":var o=a[2].split(/&/g).map((function(t){var e=t.split(",");return 1===e.length?""===e[0]?null:t:e.map((function(t){return""===t?null:t}))})),u={address:a[1],fromBlock:t._lastBlockNumber+1,toBlock:e,topics:o};u.address||delete u.address,t.getLogs(u).then((function(e){if(0!==e.length)return e.forEach((function(e){t._emitted["b:"+e.blockHash]=e.blockNumber,t._emitted["t:"+e.transactionHash]=e.blockNumber,t.emit(u,e)})),null})).catch((function(e){t.emit("error",e)}))}})),t._lastBlockNumber=e,t._balances=r,null}})).catch((function(t){})),this.doPoll()},z.prototype.resetEventsBlock=function(t){this._lastBlockNumber=t-1,this.polling&&this._doPoll()},Object.defineProperty(z.prototype,"network",{get:function(){return this._network},enumerable:!0,configurable:!0}),z.prototype.getNetwork=function(){return this.ready},Object.defineProperty(z.prototype,"blockNumber",{get:function(){return this._fastBlockNumber},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"polling",{get:function(){return null!=this._poller},set:function(t){var e=this;setTimeout((function(){t&&!e._poller?(e._poller=setInterval(e._doPoll.bind(e),e.pollingInterval),e._doPoll()):!t&&e._poller&&(clearInterval(e._poller),e._poller=null)}),0)},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){e._doPoll()}),this._pollingInterval))},enumerable:!0,configurable:!0}),z.prototype._getFastBlockNumber=function(){var t=this,e=q();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((function(e){return(null==t._fastBlockNumber||e>t._fastBlockNumber)&&(t._fastBlockNumber=e),t._fastBlockNumber}))),this._fastBlockNumberPromise},z.prototype._setFastBlockNumber=function(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=q(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))},z.prototype.waitForTransaction=function(t,e){var n=this;return null==e&&(e=1),this.getTransactionReceipt(t).then((function(r){return 0===e||r&&r.confirmations>=e?r:new Promise((function(r){n.on(t,(function a(i){i.confirmations<e||(n.removeListener(t,a),r(i))}))}))}))},z.prototype.getBlockNumber=function(){var t=this;return this.ready.then((function(){return t.perform("getBlockNumber",{}).then((function(e){var n=parseInt(e);if(n!=e)throw new Error("invalid response - getBlockNumber");return t._setFastBlockNumber(n),n}))}))},z.prototype.getGasPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getGasPrice",{}).then((function(t){return u.bigNumberify(t)}))}))},z.prototype.getBalance=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getBalance",e).then((function(t){return u.bigNumberify(t)}))}))}))}))},z.prototype.getTransactionCount=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getTransactionCount",e).then((function(t){return u.bigNumberify(t).toNumber()}))}))}))}))},z.prototype.getCode=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,blockTag:e}).then((function(t){var e=t.addressOrName,r=t.blockTag;return n._getAddress(e).then((function(t){var e={address:t,blockTag:Q(r)};return n.perform("getCode",e).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.getStorageAt=function(t,e,n){var r=this;return this.ready.then((function(){return f.resolveProperties({addressOrName:t,position:e,blockTag:n}).then((function(t){var e=t.addressOrName,n=t.position,a=t.blockTag;return r._getAddress(e).then((function(t){var e={address:t,blockTag:Q(a),position:c.hexStripZeros(c.hexlify(n))};return r.perform("getStorageAt",e).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.sendTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({signedTransaction:t}).then((function(t){var n=t.signedTransaction,r={signedTransaction:c.hexlify(n)};return e.perform("sendTransaction",r).then((function(t){return e._wrapTransaction(h.parse(n),t)}),(function(t){throw t.transaction=h.parse(n),t.transaction.hash&&(t.transactionHash=t.transaction.hash),t}))}))}))},z.prototype._wrapTransaction=function(t,e){var n=this;if(null!=e&&32!==c.hexDataLength(e))throw new Error("invalid response - sendTransaction");var r=t;return null!=e&&t.hash!==e&&b.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),r.wait=function(e){return 0!==e&&(n._emitted["t:"+t.hash]="pending"),n.waitForTransaction(t.hash,e).then((function(r){return null==r&&0===e?null:(n._emitted["t:"+t.hash]=r.blockNumber,0===r.status&&b.throwError("transaction failed",b.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t}),r)}))},r},z.prototype.call=function(t,e){var n=this,r=f.shallowCopy(t);return this.ready.then((function(){return f.resolveProperties({blockTag:e,tx:r}).then((function(t){var e=t.blockTag,r=t.tx;return n._resolveNames(r,["to","from"]).then((function(t){var r={blockTag:Q(e),transaction:R(t)};return n.perform("call",r).then((function(t){return c.hexlify(t)}))}))}))}))},z.prototype.estimateGas=function(t){var e=this,n={to:t.to,from:t.from,data:t.data,gasPrice:t.gasPrice,value:t.value};return this.ready.then((function(){return f.resolveProperties(n).then((function(t){return e._resolveNames(t,["to","from"]).then((function(t){var n={transaction:R(t)};return e.perform("estimateGas",n).then((function(t){return u.bigNumberify(t)}))}))}))}))},z.prototype.getBlock=function(t,e){var n=this;return this.ready.then((function(){return f.resolveProperties({blockHashOrBlockTag:t}).then((function(t){var r=t.blockHashOrBlockTag;try{var a=c.hexlify(r);if(32===c.hexDataLength(a))return g.poll((function(){return n.perform("getBlock",{blockHash:a,includeTransactions:!!e}).then((function(t){return null==t?null==n._emitted["b:"+a]?null:void 0:S(t,e)}))}),{onceBlock:n})}catch(t){}try{var i=-128,s=Q(r);return c.isHexString(s)&&(i=parseInt(s.substring(2),16)),g.poll((function(){return n.perform("getBlock",{blockTag:s,includeTransactions:!!e}).then((function(t){return null!=t?S(t,e):i<=n._emitted.block?void 0:null}))}),{onceBlock:n})}catch(t){}throw new Error("invalid block hash or block tag")}))}))},z.prototype.getTransaction=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var n=t.transactionHash,r={transactionHash:w(n,!0)};return g.poll((function(){return e.perform("getTransaction",r).then((function(t){if(null==t)return null==e._emitted["t:"+n]?null:void 0;var r=z.checkTransactionResponse(t);if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations)return e._getFastBlockNumber().then((function(t){var n=t-r.blockNumber+1;return n<=0&&(n=1),r.confirmations=n,e._wrapTransaction(r)}));return e._wrapTransaction(r)}))}),{onceBlock:e})}))}))},z.prototype.getTransactionReceipt=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties({transactionHash:t}).then((function(t){var n=t.transactionHash,r={transactionHash:w(n,!0)};return g.poll((function(){return e.perform("getTransactionReceipt",r).then((function(t){if(null==t)return null==e._emitted["t:"+n]?null:void 0;if(null!=t.blockHash){var r,a,i=((a=I(T,r=t)).logs.forEach((function(t,e){null==t.transactionLogIndex&&(t.transactionLogIndex=e)})),null!=r.status&&(a.byzantium=!0),a);if(null==i.blockNumber)i.confirmations=0;else if(null==i.confirmations)return e._getFastBlockNumber().then((function(t){var e=t-i.blockNumber+1;return e<=0&&(e=1),i.confirmations=e,i}));return i}}))}),{onceBlock:e})}))}))},z.prototype.getLogs=function(t){var e=this;return this.ready.then((function(){return f.resolveProperties(t).then((function(t){return e._resolveNames(t,["address"]).then((function(t){var n,r={filter:(n=t)&&n.blockHash?I(U,n):I(L,n)};return e.perform("getLogs",r).then((function(t){return v(F)(t)}))}))}))}))},z.prototype.getEtherPrice=function(){var t=this;return this.ready.then((function(){return t.perform("getEtherPrice",{}).then((function(t){return t}))}))},z.prototype._getAddress=function(t){return this.resolveName(t).then((function(e){return null==e&&b.throwError("ENS name not configured",b.UNSUPPORTED_OPERATION,{operation:"resolveName("+JSON.stringify(t)+")"}),e}))},z.prototype._resolveNames=function(t,e){var n=[],r=f.shallowCopy(t);return e.forEach((function(t){null!=r[t]&&n.push(this._getAddress(r[t]).then((function(e){r[t]=e})))}),this),Promise.all(n).then((function(){return r}))},z.prototype._getResolver=function(t){var e=this;return this.getNetwork().then((function(n){n.ensAddress||b.throwError("network does not support ENS",b.UNSUPPORTED_OPERATION,{operation:"ENS",network:n.name});var r="0x0178b8bf"+d.namehash(t).substring(2),a={to:n.ensAddress,data:r};return e.call(a).then((function(t){if(32!==c.hexDataLength(t))return null;var e=s.getAddress(c.hexDataSlice(t,12));return e===A.AddressZero?null:e}))}))},z.prototype.resolveName=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.resolveName(t)}));try{return Promise.resolve(s.getAddress(t))}catch(e){if(c.isHexString(t))throw e}var n=this,r=d.namehash(t);return this._getResolver(t).then((function(t){if(null==t)return null;var e={to:t,data:"0x3b3b57de"+r.substring(2)};return n.call(e)})).then((function(t){if(32!==c.hexDataLength(t))return null;var e=s.getAddress(c.hexDataSlice(t,12));return e===A.AddressZero?null:e}))},z.prototype.lookupAddress=function(t){var e=this;if(t instanceof Promise)return t.then((function(t){return e.lookupAddress(t)}));var n=(t=s.getAddress(t)).substring(2)+".addr.reverse",r=d.namehash(n),a=this;return this._getResolver(n).then((function(t){if(!t)return null;var e={to:t,data:"0x691f3431"+r.substring(2)};return a.call(e)})).then((function(e){if(null==e)return null;if((e=e.substring(2)).length<64)return null;if((e=e.substring(64)).length<64)return null;var n=u.bigNumberify("0x"+e.substring(0,64)).toNumber();if(2*n>(e=e.substring(64)).length)return null;var r=y.toUtf8String("0x"+e.substring(0,2*n));return a.resolveName(r).then((function(e){return e!=t?null:r}))}))},z.checkTransactionResponse=_,z.prototype.doPoll=function(){},z.prototype.perform=function(t,e){return b.throwError(t+" not implemented",b.NOT_IMPLEMENTED,{operation:t}),null},z.prototype._startPending=function(){b.warn("WARNING: this provider does not support pending events")},z.prototype._stopPending=function(){},z.prototype._addEventListener=function(t,e,n){this._events.push({tag:G(t),listener:e,once:n}),"pending"===t&&this._startPending(),this.polling=!0},z.prototype.on=function(t,e){return this._addEventListener(t,e,!1),this},z.prototype.once=function(t,e){return this._addEventListener(t,e,!0),this},z.prototype.addEventListener=function(t,e){return this.on(t,e)},z.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var a=!1,i=G(t);return this._events=this._events.filter((function(t){return t.tag!==i||(setTimeout((function(){t.listener.apply(e,n)}),0),a=!0,!t.once)})),0===this.listenerCount()&&(this.polling=!1),a},z.prototype.listenerCount=function(t){if(!t)return this._events.length;var e=G(t);return this._events.filter((function(t){return t.tag===e})).length},z.prototype.listeners=function(t){var e=G(t);return this._events.filter((function(t){return t.tag===e})).map((function(t){return t.listener}))},z.prototype.removeAllListeners=function(t){var e;return null==t?(this._events=[],this._stopPending()):(e=G(t),this._events=this._events.filter((function(t){return t.tag!==e})),"pending"===t&&this._stopPending()),0===this._events.length&&(this.polling=!1),this},z.prototype.removeListener=function(t,e){var n=!1,r=G(t);return this._events=this._events.filter((function(t){return t.tag!==r||t.listener!=e||!!n||!(n=!0)})),"pending"===t&&0===this.listenerCount("pending")&&this._stopPending(),0===this.listenerCount()&&(this.polling=!1),this},z);function z(t){var e,n=Y.call(this)||this;return b.checkNew(n,m.Provider),t instanceof Promise?(f.defineReadOnly(n,"ready",t.then((function(t){return f.defineReadOnly(n,"_network",t),t}))),n.ready.catch((function(t){}))):(e=p.getNetwork(null==t?"homestead":t))?(f.defineReadOnly(n,"_network",e),f.defineReadOnly(n,"ready",Promise.resolve(n._network))):b.throwError("invalid network",b.INVALID_ARGUMENT,{arg:"network",value:t}),n._lastBlockNumber=-2,n._balances={},n._events=[],n._pollingInterval=4e3,n._emitted={block:-2},n._fastQueryDate=0,n}n.BaseProvider=K,f.defineReadOnly(m.Provider,"inherits",f.inheritable(m.Provider))},{"../constants":3,"../errors":5,"../utils/address":60,"../utils/bignumber":63,"../utils/bytes":64,"../utils/hash":65,"../utils/networks":72,"../utils/properties":74,"../utils/rlp":76,"../utils/transaction":83,"../utils/utf8":85,"../utils/web":86,"./abstract-provider":50}],52:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=t("../utils/bytes"),u=t("../utils/properties"),c=t("../utils/web"),A=i(t("../errors"));function d(t){var e,n=[];for(var r in t)null!=t[r]&&(e=o.hexlify(t[r]),{gasLimit:!0,gasPrice:!0,nonce:!0,value:!0}[r]&&(e=o.hexStripZeros(e)),n.push(r+"="+e));return n.join("&")}function p(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1==t.status&&"OK"==t.message)return t.result;var e=new Error("invalid response");throw e.result=JSON.stringify(t),e}function f(t){if("2.0"!=t.jsonrpc)throw(e=new Error("invalid response")).result=JSON.stringify(t),e;if(t.error){var e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function l(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}var h,y=(a(g,h=s.BaseProvider),g.prototype.perform=function(t,e){var n,r=this,a=this.baseUrl,i="";function s(t,e){return c.fetchJson(t,null,e||f).then((function(e){return r.emit("debug",{action:"perform",request:t,response:e,provider:r}),e}))}switch(this.apiKey&&(i+="&apikey="+this.apiKey),t){case"getBlockNumber":return s(a+="/api?module=proxy&action=eth_blockNumber"+i);case"getGasPrice":return s(a+="/api?module=proxy&action=eth_gasPrice"+i);case"getBalance":return a+="/api?module=account&action=balance&address="+e.address,s(a+="&tag="+e.blockTag+i,p);case"getTransactionCount":return a+="/api?module=proxy&action=eth_getTransactionCount&address="+e.address,s(a+="&tag="+e.blockTag+i);case"getCode":return a+="/api?module=proxy&action=eth_getCode&address="+e.address,s(a+="&tag="+e.blockTag+i,f);case"getStorageAt":return a+="/api?module=proxy&action=eth_getStorageAt&address="+e.address,a+="&position="+e.position,s(a+="&tag="+e.blockTag+i,f);case"sendTransaction":return a+="/api?module=proxy&action=eth_sendRawTransaction&hex="+e.signedTransaction,s(a+=i).catch((function(t){throw t.responseText&&(0<=t.responseText.toLowerCase().indexOf("insufficient funds")&&A.throwError("insufficient funds",A.INSUFFICIENT_FUNDS,{}),0<=t.responseText.indexOf("same hash was already imported")&&A.throwError("nonce has already been used",A.NONCE_EXPIRED,{}),0<=t.responseText.indexOf("another transaction with same nonce")&&A.throwError("replacement fee too low",A.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?(a+="/api?module=proxy&action=eth_getBlockByNumber&tag="+e.blockTag,e.includeTransactions?a+="&boolean=true":a+="&boolean=false",s(a+=i)):Promise.reject(new Error("getBlock by blockHash not implemeneted"));case"getTransaction":return a+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+e.transactionHash,s(a+=i);case"getTransactionReceipt":return a+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+e.transactionHash,s(a+=i);case"call":return a+="/api?module=proxy&action=eth_call"+(n=(n=d(e.transaction))&&"&"+n),"latest"!==e.blockTag?Promise.reject(new Error("EtherscanProvider does not support blockTag for call")):s(a+=i);case"estimateGas":return a+="/api?module=proxy&action=eth_estimateGas&"+(n=(n=d(e.transaction))&&"&"+n),s(a+=i);case"getLogs":a+="/api?module=logs&action=getLogs";try{if(e.filter.fromBlock&&(a+="&fromBlock="+l(e.filter.fromBlock)),e.filter.toBlock&&(a+="&toBlock="+l(e.filter.toBlock)),e.filter.blockHash)try{A.throwError("Etherscan does not support blockHash filters",A.UNSUPPORTED_OPERATION,{operation:"getLogs(blockHash)"})}catch(t){return Promise.reject(t)}if(e.filter.address&&(a+="&address="+e.filter.address),e.filter.topics&&0<e.filter.topics.length){if(1<e.filter.topics.length)throw new Error("unsupported topic format");var o=e.filter.topics[0];if("string"!=typeof o||66!==o.length)throw new Error("unsupported topic0 format");a+="&topic0="+o}}catch(t){return Promise.reject(t)}var u=this;return s(a+=i,p).then((function(t){var e={},n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return null!=t.blockHash?null:(t.blockHash=e[t.transactionHash],null==t.blockHash?u.getTransaction(t.transactionHash).then((function(n){return e[t.transactionHash]=n.blockHash,t.blockHash=n.blockHash,null})):null)}))})),n.then((function(){return t}))}));case"getEtherPrice":return"homestead"!==this.network.name?Promise.resolve(0):(a+="/api?module=stats&action=ethprice",s(a+=i,p).then((function(t){return parseFloat(t.ethusd)})))}return h.prototype.perform.call(this,t,e)},g.prototype.getHistory=function(t,e,n){var r=this,a=this.baseUrl,i="";return this.apiKey&&(i+="&apikey="+this.apiKey),null==e&&(e=0),null==n&&(n=99999999),this.resolveName(t).then((function(t){return a+="/api?module=account&action=txlist&address="+t,a+="&startblock="+e,a+="&endblock="+n,a+="&sort=asc"+i,c.fetchJson(a,null,p).then((function(t){r.emit("debug",{action:"getHistory",request:a,response:t,provider:r});var e=[];return t.forEach((function(t){["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);var n=s.BaseProvider.checkTransactionResponse(t);t.timeStamp&&(n.timestamp=parseInt(t.timeStamp)),e.push(n)})),e}))}))},g);function g(t,e){var n=h.call(this,t)||this;A.checkNew(n,g);var r="invalid";n.network&&(r=n.network.name);var a=null;switch(r){case"homestead":a="https://api.etherscan.io";break;case"ropsten":a="https://api-ropsten.etherscan.io";break;case"rinkeby":a="https://api-rinkeby.etherscan.io";break;case"kovan":a="https://api-kovan.etherscan.io";break;case"goerli":a="https://api-goerli.etherscan.io";break;default:throw new Error("unsupported network")}return u.defineReadOnly(n,"baseUrl",a),u.defineReadOnly(n,"apiKey",e||"8FG3JMZ9USS4NTA6YKEKHINU56SEPPVBJR"),n}n.EtherscanProvider=y},{"../errors":5,"../utils/bytes":64,"../utils/properties":74,"../utils/web":86,"./base-provider":51}],53:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=i(t("../errors"));function u(t){var e=!0,n=null;return t.forEach((function(r){null!=r?null!=n?n.name===r.name&&n.chainId===r.chainId&&(n.ensAddress===r.ensAddress||null==n.ensAddress&&null==r.ensAddress)||o.throwError("provider mismatch",o.INVALID_ARGUMENT,{arg:"networks",value:t}):n=r:e=!1})),e}var c,A=(a(d,c=s.BaseProvider),Object.defineProperty(d.prototype,"providers",{get:function(){return this._providers.slice(0)},enumerable:!0,configurable:!0}),d.prototype.perform=function(t,e){var n=this.providers;return new Promise((function(r,a){var i=null;!function s(){n.length?n.shift().perform(t,e).then((function(t){return r(t)})).catch((function(t){i=i||t,setTimeout(s,0)})):a(i)}()}))},d);function d(t){var e,n=this;if(0===t.length)throw new Error("no providers");return n=u(t.map((function(t){return t.network})))?c.call(this,t[0].network)||this:(e=Promise.all(t.map((function(t){return t.getNetwork()}))).then((function(t){return u(t)||o.throwError("getNetwork returned null",o.UNKNOWN_ERROR,{}),t[0]})),c.call(this,e)||this),o.checkNew(n,d),n._providers=t.slice(0),n}n.FallbackProvider=A},{"../errors":5,"./base-provider":51}],54:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./abstract-provider");n.Provider=r.Provider;var a=t("./base-provider");n.BaseProvider=a.BaseProvider;var i=t("./etherscan-provider");n.EtherscanProvider=i.EtherscanProvider;var s=t("./fallback-provider");n.FallbackProvider=s.FallbackProvider;var o=t("./ipc-provider");n.IpcProvider=o.IpcProvider;var u=t("./infura-provider");n.InfuraProvider=u.InfuraProvider;var c=t("./json-rpc-provider");n.JsonRpcProvider=c.JsonRpcProvider,n.JsonRpcSigner=c.JsonRpcSigner;var A=t("./web3-provider");n.Web3Provider=A.Web3Provider},{"./abstract-provider":50,"./base-provider":51,"./etherscan-provider":52,"./fallback-provider":53,"./infura-provider":55,"./ipc-provider":56,"./json-rpc-provider":57,"./web3-provider":58}],55:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./json-rpc-provider"),u=t("../utils/bytes"),c=t("../utils/networks"),A=t("../utils/properties"),d=i(t("../errors")),p=(a(f,s=o.JsonRpcProvider),f.prototype._startPending=function(){d.warn("WARNING: INFURA does not support pending filters")},f.prototype.getSigner=function(t){return d.throwError("INFURA does not support signing",d.UNSUPPORTED_OPERATION,{operation:"getSigner"})},f.prototype.listAccounts=function(){return Promise.resolve([])},f);function f(t,e){var n=this,r=c.getNetwork(null==t?"homestead":t);null==e&&(e="7d0d81d0919f4f05b9ab6634be01ee73");var a=null;switch(r.name){case"homestead":a="mainnet.infura.io";break;case"ropsten":a="ropsten.infura.io";break;case"rinkeby":a="rinkeby.infura.io";break;case"goerli":a="goerli.infura.io";break;case"kovan":a="kovan.infura.io";break;default:d.throwError("unsupported network",d.INVALID_ARGUMENT,{argument:"network",value:t})}return u.isHexString("0x"+e,16)?(n=s.call(this,"https://"+a+"/v3/"+e,r)||this,A.defineReadOnly(n,"apiAccessToken",null),A.defineReadOnly(n,"projectId",e)):(d.warn("The legacy INFURA apiAccesToken API is deprecated; please upgrade to a Project ID instead (see INFURA dshboard; https://infura.io)"),n=s.call(this,"https://"+a+"/"+e,r)||this,A.defineReadOnly(n,"apiAccessToken",e),A.defineReadOnly(n,"projectId",null)),d.checkNew(n,f),n}n.InfuraProvider=p},{"../errors":5,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"./json-rpc-provider":57}],56:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0})},{}],57:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("./base-provider"),o=t("../abstract-signer"),u=i(t("../errors")),c=t("../utils/address"),A=t("../utils/bytes"),d=t("../utils/networks"),p=t("../utils/properties"),f=t("../utils/utf8"),l=t("../utils/web");function h(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function y(t){return t?t.toLowerCase():t}var g,b={},m=42,I=(a(C,g=o.Signer),C.prototype.getAddress=function(){var t=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(e){return e.length<=t._index&&u.throwError("unknown account #"+t._index,u.UNSUPPORTED_OPERATION,{operation:"getAddress"}),t._address=c.getAddress(e[t._index]),t._address}))},C.prototype.getBalance=function(t){return this.provider.getBalance(this.getAddress(),t)},C.prototype.getTransactionCount=function(t){return this.provider.getTransactionCount(this.getAddress(),t)},C.prototype.sendUncheckedTransaction=function(t){var e=this;t=p.shallowCopy(t);var n,r=this.getAddress().then((function(t){return t&&t.toLowerCase()}));return null==t.gasLimit&&((n=p.shallowCopy(t)).from=r,t.gasLimit=this.provider.estimateGas(n)),Promise.all([p.resolveProperties(t),r]).then((function(t){var n=t[0],r=E.hexlifyTransaction(n);return r.from=t[1],e.provider.send("eth_sendTransaction",[r]).then((function(t){return t}),(function(t){throw t.responseText&&(0<=t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{transaction:n}),0<=t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{transaction:n}),0<=t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{transaction:n})),t}))}))},C.prototype.sendTransaction=function(t){var e=this;return this.sendUncheckedTransaction(t).then((function(t){return l.poll((function(){return e.provider.getTransaction(t).then((function(n){if(null!==n)return e.provider._wrapTransaction(n,t)}))}),{fastRetry:250,onceBlock:e.provider}).catch((function(e){throw e.transactionHash=t,e}))}))},C.prototype.signMessage=function(t){var e=this,n="string"==typeof t?f.toUtf8Bytes(t):t;return this.getAddress().then((function(t){return e.provider.send("eth_sign",[t.toLowerCase(),A.hexlify(n)])}))},C.prototype.unlock=function(t){var e=this.provider;return this.getAddress().then((function(n){return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])}))},C);function C(t,e,n){var r=g.call(this)||this;if(u.checkNew(r,C),t!==b)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return p.defineReadOnly(r,"provider",e),n?"string"==typeof n?p.defineReadOnly(r,"_address",c.getAddress(n)):"number"==typeof n?p.defineReadOnly(r,"_index",n):u.throwError("invalid address or index",u.INVALID_ARGUMENT,{argument:"addressOrIndex",value:n}):p.defineReadOnly(r,"_index",0),r}n.JsonRpcSigner=I;var v,w={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0},E=(a(B,v=s.BaseProvider),B.prototype.getSigner=function(t){return new I(b,this,t)},B.prototype.listAccounts=function(){return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return c.getAddress(t)}))}))},B.prototype.send=function(t,e){var n=this,r={method:t,params:e,id:m++,jsonrpc:"2.0"};return l.fetchJson(this.connection,JSON.stringify(r),h).then((function(t){return n.emit("debug",{action:"send",request:r,response:t,provider:n}),t}))},B.prototype.perform=function(t,e){switch(t){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":return this.send("eth_getBalance",[y(e.address),e.blockTag]);case"getTransactionCount":return this.send("eth_getTransactionCount",[y(e.address),e.blockTag]);case"getCode":return this.send("eth_getCode",[y(e.address),e.blockTag]);case"getStorageAt":return this.send("eth_getStorageAt",[y(e.address),e.position,e.blockTag]);case"sendTransaction":return this.send("eth_sendRawTransaction",[e.signedTransaction]).catch((function(t){throw t.responseText&&(0<t.responseText.indexOf("insufficient funds")&&u.throwError("insufficient funds",u.INSUFFICIENT_FUNDS,{}),0<t.responseText.indexOf("nonce too low")&&u.throwError("nonce has already been used",u.NONCE_EXPIRED,{}),0<t.responseText.indexOf("replacement transaction underpriced")&&u.throwError("replacement fee too low",u.REPLACEMENT_UNDERPRICED,{})),t}));case"getBlock":return e.blockTag?this.send("eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]):e.blockHash?this.send("eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[e.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[e.transactionHash]);case"call":return this.send("eth_call",[B.hexlifyTransaction(e.transaction,{from:!0}),e.blockTag]);case"estimateGas":return this.send("eth_estimateGas",[B.hexlifyTransaction(e.transaction,{from:!0})]);case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=y(e.filter.address)),this.send("eth_getLogs",[e.filter])}return u.throwError(t+" not implemented",u.NOT_IMPLEMENTED,{operation:t}),null},B.prototype._startPending=function(){var t,e;null==this._pendingFilter&&(e=(t=this).send("eth_newPendingTransactionFilter",[]),(this._pendingFilter=e).then((function(n){return function r(){t.send("eth_getFilterChanges",[n]).then((function(n){if(t._pendingFilter!=e)return null;var r=Promise.resolve();return n.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",r=r.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),r.then((function(){return new Promise((function(t){setTimeout((function(){t()}),1e3)}))}))})).then((function(){return t._pendingFilter==e?(setTimeout((function(){r()}),0),null):void t.send("eth_uninstallFilter",[n])})).catch((function(t){}))}(),n})).catch((function(t){})))},B.prototype._stopPending=function(){this._pendingFilter=null},B.hexlifyTransaction=function(t,e){var n=p.shallowCopy(w);if(e)for(var r in e)e[r]&&(n[r]=!0);p.checkProperties(t,n);var a={};return["gasLimit","gasPrice","nonce","value"].forEach((function(e){var n;null!=t[e]&&(n=A.hexStripZeros(A.hexlify(t[e])),"gasLimit"===e&&(e="gas"),a[e]=n)})),["from","to","data"].forEach((function(e){null!=t[e]&&(a[e]=A.hexlify(t[e]))})),a},B);function B(t,e){var n,r=this;return"string"==typeof t&&null===e&&d.getNetwork(t)&&(e=t,t=null),r=e?v.call(this,e)||this:(n=new Promise((function(t,e){setTimeout((function(){r.send("net_version",[]).then((function(e){return t(d.getNetwork(parseInt(e)))})).catch((function(t){e(t)}))}))})),v.call(this,n)||this),u.checkNew(r,B),t=t||"http://localhost:8545",r.connection="string"==typeof t?{url:t}:t,r}n.JsonRpcProvider=E},{"../abstract-signer":2,"../errors":5,"../utils/address":60,"../utils/bytes":64,"../utils/networks":72,"../utils/properties":74,"../utils/utf8":85,"../utils/web":86,"./base-provider":51}],58:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./json-rpc-provider"),u=t("../utils/properties"),c=i(t("../errors")),A=42,d=(a(p,s=o.JsonRpcProvider),p.prototype.send=function(t,e){var n=this;return"eth_sign"==t&&this._web3Provider.isMetaMask&&(t="personal_sign",e=[e[1],e[0]]),new Promise((function(r,a){var i={method:t,params:e,id:A++,jsonrpc:"2.0"};n._sendAsync(i,(function(t,e){if(t)a(t);else{if(e.error){var n=new Error(e.error.message);return n.code=e.error.code,n.data=e.error.data,void a(n)}r(e.result)}}))}))},p);function p(t,e){var n=s.call(this,t.host||t.path||"",e)||this;return c.checkNew(n,p),t&&(t.sendAsync?n._sendAsync=t.sendAsync.bind(t):t.send&&(n._sendAsync=t.send.bind(t))),t&&n._sendAsync||c.throwError("invalid web3Provider",c.INVALID_ARGUMENT,{arg:"web3Provider",value:t}),u.defineReadOnly(n,"_web3Provider",t),u.defineReadOnly(n,"provider",t),n}n.Web3Provider=d},{"../errors":5,"../utils/properties":74,"./json-rpc-provider":57}],59:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s=t("../constants"),u=i(t("../errors")),c=t("./address"),A=t("./bignumber"),d=t("./bytes"),p=t("./utf8"),f=t("./properties"),l=new RegExp(/^bytes([0-9]*)$/),h=new RegExp(/^(u?int)([0-9]*)$/),y=new RegExp(/^(.*)\[([0-9]*)\]$/);n.defaultCoerceFunc=function(t,e){var n=t.match(h);return n&&parseInt(n[2])<=48?e.toNumber():e};var g=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),b=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function I(t,e){var n=t;function r(t){throw new Error('unexpected character "'+n[t]+'" at position '+t+' in "'+n+'"')}t=t.replace(/\s/g," ");for(var a={type:"",name:"",state:{allowType:!0}},i=a,s=0;s<t.length;s++){var o=t[s];switch(o){case"(":i.state.allowParams||r(s),i.state.allowType=!1,i.type=m(i.type),i.components=[{type:"",name:"",parent:i,state:{allowType:!0}}],i=i.components[0];break;case")":delete i.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),i.type=m(i.type);var u=i;(i=i.parent)||r(s),delete u.parent,i.state.allowParams=!1,i.state.allowName=!0,i.state.allowArray=!0;break;case",":delete i.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),i.type=m(i.type);var c={type:"",name:"",parent:i.parent,state:{allowType:!0}};i.parent.components.push(c),delete i.parent,i=c;break;case" ":i.state.allowType&&""!==i.type&&(i.type=m(i.type),delete i.state.allowType,i.state.allowName=!0,i.state.allowParams=!0),i.state.allowName&&""!==i.name&&(e&&"indexed"===i.name?(i.indexed=!0,i.name=""):i.state.allowName=!1);break;case"[":i.state.allowArray||r(s),i.type+=o,i.state.allowArray=!1,i.state.allowName=!1,i.state.readArray=!0;break;case"]":i.state.readArray||r(s),i.type+=o,i.state.readArray=!1,i.state.allowArray=!0,i.state.allowName=!0;break;default:i.state.allowType?(i.type+=o,i.state.allowParams=!0,i.state.allowArray=!0):i.state.allowName?(i.name+=o,delete i.state.allowArray):i.state.readArray?i.type+=o:r(s)}}if(i.parent)throw new Error("unexpected eof");return delete a.state,e&&"indexed"===i.name&&(i.indexed=!0,i.name=""),a.type=m(a.type),a}function C(t){return ot(n.defaultCoerceFunc,t).type}function v(t,e,n,r,a){this.coerceFunc=t,this.name=e,this.type=n,this.localName=r,this.dynamic=a}n.parseParamType=function(t){return I(t,!0)},n.formatParamType=C,n.formatSignature=function(t){return t.name+"("+t.inputs.map(C).join(",")+")"},n.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},n=t.match(g);if(!n)throw new Error("invalid event: "+t);if(e.name=n[1].trim(),it(n[2]).forEach((function(t){(t=I(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),n[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:u.info("unknown modifier: "+t)}})),e.name&&!e.name.match(b))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},n=t.split("@");if(1!==n.length){if(2<n.length)throw new Error("invalid signature");if(!n[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=A.bigNumberify(n[1]),t=n[0]}var r=(n=t.split(" returns "))[0].match(g);if(!r)throw new Error("invalid signature");if(e.name=r[1].trim(),!e.name.match(b))throw new Error('invalid identifier: "'+r[1]+'"');if(it(r[2]).forEach((function(t){e.inputs.push(I(t))})),r[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:u.info("unknown modifier: "+t)}})),1<n.length){var a=n[1].match(g);if(""!=a[1].trim()||""!=a[3].trim())throw new Error("unexpected tokens");it(a[2]).forEach((function(t){e.outputs.push(I(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var w,E=(a(B,w=v),B.prototype.encode=function(t){return this.coder.encode(t)},B.prototype.decode=function(t,e){return this.coder.decode(t,e)},B);function B(t){var e=w.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return f.defineReadOnly(e,"coder",t),e}var Q,M=(a(_,Q=v),_.prototype.encode=function(t){return d.arrayify([])},_.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},_);function _(t,e){return Q.call(this,t,"null","",e,!1)||this}var x,k=(a(S,x=v),S.prototype.encode=function(t){try{var e=A.bigNumberify(t);if(this.signed){var n=s.MaxUint256.maskn(8*this.size-1);if(e.gt(n))throw new Error("out-of-bounds");if(n=n.add(s.One).mul(s.NegativeOne),e.lt(n))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),d.padZeros(d.arrayify(e),32)}catch(e){u.throwError("invalid number value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},S.prototype.decode=function(t,e){t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:d.hexlify(t.slice(e,e+32))});var n=32-this.size,r=A.bigNumberify(t.slice(e+n,e+32));return r=this.signed?r.fromTwos(8*this.size):r.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,r)}},S);function S(t,e,n,r){var a=this,i=(n?"int":"uint")+8*e;return(a=x.call(this,t,i,i,r,!1)||this).size=e,a.signed=n,a}var D,R=new k((function(t,e){return e}),32,!1,"none"),N=(a(T,D=v),T.prototype.encode=function(t){return R.encode(t?1:0)},T.prototype.decode=function(t,e){try{var n=R.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&u.throwError("insufficient data for boolean type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:n.consumed,value:this.coerceFunc("bool",!n.value.isZero())}},T);function T(t,e){return D.call(this,t,"bool","bool",e,!1)||this}var O,H=(a(L,O=v),L.prototype.encode=function(t){var e=new Uint8Array(32);try{var n=d.arrayify(t);if(n.length!==this.length)throw new Error("incorrect data length");e.set(n)}catch(e){u.throwError("invalid "+this.name+" value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},L.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:d.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,d.hexlify(t.slice(e,e+this.length)))}},L);function L(t,e,n){var r=this,a="bytes"+e;return(r=O.call(this,t,a,a,n,!1)||this).length=e,r}var U,j=(a(F,U=v),F.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(d.arrayify(c.getAddress(t)),12)}catch(e){u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},F.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficient data for address type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:d.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",c.getAddress(d.hexlify(t.slice(e+12,e+32))))}},F);function F(t,e){return U.call(this,t,"address","address",e,!1)||this}function P(t){var e=32*Math.ceil(t.length/32),n=new Uint8Array(e-t.length);return d.concat([R.encode(t.length),t,n])}function G(t,e,n){t.length<e+32&&u.throwError("insufficient data for dynamicBytes length",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:d.hexlify(t.slice(e,e+32))});var r=R.decode(t,e).value;try{r=r.toNumber()}catch(t){u.throwError("dynamic bytes count too large",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:r.toString()})}return t.length<e+32+r&&u.throwError("insufficient data for dynamicBytes type",u.INVALID_ARGUMENT,{arg:n,coderType:"dynamicBytes",value:d.hexlify(t.slice(e,e+32+r))}),{consumed:32+32*Math.ceil(r/32),value:t.slice(e+32,e+32+r)}}var q,Y=(a(K,q=v),K.prototype.encode=function(t){try{return P(d.arrayify(t))}catch(t){u.throwError("invalid bytes value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},K.prototype.decode=function(t,e){var n=G(t,e,this.localName);return n.value=this.coerceFunc("bytes",d.hexlify(n.value)),n},K);function K(t,e){return q.call(this,t,"bytes","bytes",e,!0)||this}var z,J=(a(V,z=v),V.prototype.encode=function(t){return"string"!=typeof t&&u.throwError("invalid string value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),P(p.toUtf8Bytes(t))},V.prototype.decode=function(t,e){var n=G(t,e,this.localName);return n.value=this.coerceFunc("string",p.toUtf8String(n.value)),n},V);function V(t,e){return z.call(this,t,"string","string",e,!0)||this}function W(t){return 32*Math.ceil(t/32)}function Z(t,e){var n;Array.isArray(e)||(e&&"object"==o(e)?(n=[],t.forEach((function(t){n.push(e[t.localName])})),e=n):u.throwError("invalid tuple value",u.INVALID_ARGUMENT,{coderType:"tuple",value:e})),t.length!==e.length&&u.throwError("types/value length mismatch",u.INVALID_ARGUMENT,{coderType:"tuple",value:e});var r=[];t.forEach((function(t,n){r.push({dynamic:t.dynamic,value:t.encode(e[n])})}));var a=0,i=0;r.forEach((function(t){t.dynamic?(a+=32,i+=W(t.value.length)):a+=W(t.value.length)}));var s=0,c=a,A=new Uint8Array(a+i);return r.forEach((function(t){t.dynamic?(A.set(R.encode(c),s),s+=32,A.set(t.value,c),c+=W(t.value.length)):(A.set(t.value,s),s+=W(t.value.length))})),A}function X(t,e,n){var r=n,a=0,i=[];return t.forEach((function(t){var s,o;t.dynamic?(s=R.decode(e,n),(o=t.decode(e,r+s.value.toNumber())).consumed=s.consumed):o=t.decode(e,n),null!=o.value&&i.push(o.value),n+=o.consumed,a+=o.consumed})),t.forEach((function(t,e){var n=t.localName;n&&("length"===n&&(n="_length"),null==i[n]&&(i[n]=i[e]))})),{value:i,consumed:a}}var $,tt=(a(et,$=v),et.prototype.encode=function(t){Array.isArray(t)||u.throwError("expected array value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,n=new Uint8Array(0);-1===e&&(e=t.length,n=R.encode(e)),u.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var r=[],a=0;a<t.length;a++)r.push(this.coder);return d.concat([n,Z(r,t)])},et.prototype.decode=function(t,e){var n=0,r=this.length;if(-1===r){try{var a=R.decode(t,e)}catch(t){u.throwError("insufficient data for dynamic array length",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{r=a.value.toNumber()}catch(t){u.throwError("array count too large",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:a.value.toString()})}n+=a.consumed,e+=a.consumed}for(var i=[],s=0;s<r;s++)i.push(new E(this.coder));var o=X(i,t,e);return o.consumed+=n,o.value=this.coerceFunc(this.type,o.value),o},et);function et(t,e,n,r){var a=this,i=e.type+"["+(0<=n?n:"")+"]",s=-1===n||e.dynamic;return(a=$.call(this,t,"array",i,r,s)||this).coder=e,a.length=n,a}var nt,rt=(a(at,nt=v),at.prototype.encode=function(t){return Z(this.coders,t)},at.prototype.decode=function(t,e){var n=X(this.coders,t,e);return n.value=this.coerceFunc(this.type,n.value),n},at);function at(t,e,n){var r=this,a=!1,i=[];e.forEach((function(t){t.dynamic&&(a=!0),i.push(t.type)}));var s="tuple("+i.join(",")+")";return(r=nt.call(this,t,"tuple",s,n,a)||this).coders=e,r}function it(t){t=t.trim();for(var e=[],n="",r=0,a=0;a<t.length;a++){var i=t[a];if(","===i&&0===r)e.push(n),n="";else if(n+=i,"("===i)r++;else if(")"===i&&-1==--r)throw new Error("unbalanced parenthsis")}return n&&e.push(n),e}var st={address:j,bool:N,string:J,bytes:Y};function ot(t,e){var n=st[e.type];if(n)return new n(t,e.name);var r,a,i,s,o=e.type.match(h);if(o)return(0===(c=parseInt(o[2]||"256"))||256<c||c%8!=0)&&u.throwError("invalid "+o[1]+" bit length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new k(t,c/8,"int"===o[1],e.name);if(o=e.type.match(l))return(0===(c=parseInt(o[1]))||32<c)&&u.throwError("invalid bytes length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new H(t,c,e.name);if(o=e.type.match(y)){var c=parseInt(o[2]||"-1");return(e=f.shallowCopy(e)).type=o[1],e=f.deepCopy(e),new tt(t,ot(t,e),c,e.name)}return"tuple"===e.type.substring(0,5)?(r=t,a=e.components,i=e.name,s=[],(a=a||[]).forEach((function(t){s.push(ot(r,t))})),new rt(r,s,i)):""===e.type?new M(t,e.name):(u.throwError("invalid type",u.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var ut=(ct.prototype.encode=function(t,e){t.length!==e.length&&u.throwError("types/values length mismatch",u.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=[];return t.forEach((function(t){var e="string"==typeof t?I(t):t;n.push(ot(this.coerceFunc,e))}),this),d.hexlify(new rt(this.coerceFunc,n,"_").encode(e))},ct.prototype.decode=function(t,e){var n=[];return t.forEach((function(t){var e="string"==typeof t?I(t):f.deepCopy(t);n.push(ot(this.coerceFunc,e))}),this),new rt(this.coerceFunc,n,"_").decode(d.arrayify(e),0).value},ct);function ct(t){u.checkNew(this,ct),t=t||n.defaultCoerceFunc,f.defineReadOnly(this,"coerceFunc",t)}n.AbiCoder=ut,n.defaultAbiCoder=new ut},{"../constants":3,"../errors":5,"./address":60,"./bignumber":63,"./bytes":64,"./properties":74,"./utf8":85}],60:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("bn.js")),i=t("./bytes"),s=t("./keccak256"),o=t("./rlp"),u=t("../errors");function c(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40),r=0;r<40;r++)n[r]=e[r].charCodeAt(0);n=i.arrayify(s.keccak256(n));for(var a=0;a<40;a+=2)8<=n[a>>1]>>4&&(e[a]=e[a].toUpperCase()),8<=(15&n[a>>1])&&(e[a+1]=e[a+1].toUpperCase());return"0x"+e.join("")}for(var A={},d=0;d<10;d++)A[String(d)]=String(d);for(d=0;d<26;d++)A[String.fromCharCode(65+d)]=String(10+d);var p,f=Math.floor((p=9007199254740991,Math.log10?Math.log10(p):Math.log(p)/Math.LN10));function l(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=A[t]}));e.length>=f;){var n=e.substring(0,f);e=parseInt(n,10)%97+e.substring(n.length)}for(var r=String(98-parseInt(e,10)%97);r.length<2;)r="0"+r;return r}function h(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==l(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new a.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=c("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}n.getAddress=h,n.getIcapAddress=function(t){for(var e=new a.default.BN(h(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+l("XE00"+e)+e},n.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return h("0x"+s.keccak256(o.encode([h(t.from),i.stripZeros(i.hexlify(e))])).substring(26))},n.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var n=h(t.from),r=i.arrayify(t.salt);return 32!==r.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),h("0x"+s.keccak256(i.concat(["0xff",n,r,e])).substring(26))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],n=0;n<t.length;n++)e.push(t.charCodeAt(n));return r.arrayify(e)},encode:function(t){t=r.arrayify(t);for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}}},{"../utils/bytes":64}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bytes"),a=t("./properties"),i=(s.prototype.encode=function(t){var e=r.arrayify(t);if(0===e.length)return"";for(var n=[0],a=0;a<e.length;++a){for(var i=e[a],s=0;s<n.length;++s)i+=n[s]<<8,n[s]=i%this.base,i=i/this.base|0;for(;0<i;)n.push(i%this.base),i=i/this.base|0}for(var o="",u=0;0===e[u]&&u<e.length-1;++u)o+=this._leader;for(var c=n.length-1;0<=c;--c)o+=this.alphabet[n[c]];return o},s.prototype.decode=function(t){if("string"!=typeof t)throw new TypeError("Expected String");var e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(var n=0;n<t.length;n++){var a=this._alphabetMap[t[n]];if(void 0===a)throw new Error("Non-base"+this.base+" character");for(var i=a,s=0;s<e.length;++s)i+=e[s]*this.base,e[s]=255&i,i>>=8;for(;0<i;)e.push(255&i),i>>=8}for(var o=0;t[o]===this._leader&&o<t.length-1;++o)e.push(0);return r.arrayify(new Uint8Array(e.reverse()))},s);function s(t){a.defineReadOnly(this,"alphabet",t),a.defineReadOnly(this,"base",t.length),a.defineReadOnly(this,"_alphabetMap",{}),a.defineReadOnly(this,"_leader",t.charAt(0));for(var e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}var o=new(n.BaseX=i)("abcdefghijklmnopqrstuvwxyz234567");n.Base32=o;var u=new i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");n.Base58=u},{"./bytes":64,"./properties":74}],63:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var i=r(t("bn.js")),s=t("./bytes"),o=t("./properties"),u=a(t("../errors")),c=new i.default.BN(-1);function A(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(y(t))}function p(t){return new l(A(t))}function f(t){var e=t._hex;return"-"===e[0]?new i.default.BN(e.substring(3),16).mul(c):new i.default.BN(e.substring(2),16)}var l=(h.prototype.fromTwos=function(t){return p(f(this).fromTwos(t))},h.prototype.toTwos=function(t){return p(f(this).toTwos(t))},h.prototype.abs=function(){return"-"===this._hex[0]?p(f(this).mul(c)):this},h.prototype.add=function(t){return p(f(this).add(d(t)))},h.prototype.sub=function(t){return p(f(this).sub(d(t)))},h.prototype.div=function(t){return y(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),p(f(this).div(d(t)))},h.prototype.mul=function(t){return p(f(this).mul(d(t)))},h.prototype.mod=function(t){return p(f(this).mod(d(t)))},h.prototype.pow=function(t){return p(f(this).pow(d(t)))},h.prototype.maskn=function(t){return p(f(this).maskn(t))},h.prototype.eq=function(t){return f(this).eq(d(t))},h.prototype.lt=function(t){return f(this).lt(d(t))},h.prototype.lte=function(t){return f(this).lte(d(t))},h.prototype.gt=function(t){return f(this).gt(d(t))},h.prototype.gte=function(t){return f(this).gte(d(t))},h.prototype.isZero=function(){return f(this).isZero()},h.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},h.prototype.toString=function(){return f(this).toString(10)},h.prototype.toHexString=function(){return this._hex},h.isBigNumber=function(t){return o.isType(t,"BigNumber")},h);function h(t){if(u.checkNew(this,h),o.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),o.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?o.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),o.defineReadOnly(this,"_hex",A(new i.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{o.defineReadOnly(this,"_hex",A(new i.default.BN(t)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else t instanceof h?o.defineReadOnly(this,"_hex",t._hex):t.toHexString?o.defineReadOnly(this,"_hex",A(d(t.toHexString()))):t._hex&&s.isHexString(t._hex)?o.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?o.defineReadOnly(this,"_hex",A(new i.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}function y(t){return l.isBigNumber(t)?t:new l(t)}n.BigNumber=l,n.bigNumberify=y},{"../errors":5,"./bytes":64,"./properties":74,"bn.js":9}],64:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function u(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var n=t[e];if(n<0||256<=n||parseInt(String(n))!=n)return!1}return!0}function c(t){if(null==t&&a.throwError("cannot convert null value to array",a.INVALID_ARGUMENT,{arg:"value",value:t}),i(t)&&(t=t.toHexString()),"string"!=typeof t)return u(t)?s(new Uint8Array(t)):(a.throwError("invalid arrayify value",null,{arg:"value",value:t,type:o(t)}),null);var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||a.throwError("invalid hexidecimal string",a.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&a.throwError("hex string must have 0x prefix",a.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var n=[],r=0;r<t.length;r+=2)n.push(parseInt(t.substr(r,2),16));return s(new Uint8Array(n))}function A(t){for(var e=[],n=0,r=0;r<t.length;r++){var a=c(t[r]);e.push(a),n+=a.length}var i=new Uint8Array(n),o=0;for(r=0;r<e.length;r++)i.set(e[r],o),o+=e[r].length;return s(i)}function d(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}n.isHexable=i,n.isArrayish=u,n.arrayify=c,n.concat=A,n.stripZeros=function(t){var e=c(t);if(0===e.length)return e;for(var n=0;0===e[n];)n++;return n&&(e=e.slice(n)),e},n.padZeros=function(t,e){if(e<(t=c(t)).length)throw new Error("cannot pad");var n=new Uint8Array(e);return n.set(t,e-t.length),s(n)},n.isHexString=d;var p="0123456789abcdef";function f(t){if(i(t))return t.toHexString();if("number"==typeof t){t<0&&a.throwError("cannot hexlify negative value",a.INVALID_ARGUMENT,{arg:"value",value:t}),9007199254740991<=t&&a.throwError("out-of-range",a.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var n=t.match(/^(0x)?[0-9a-fA-F]*$/);return n||a.throwError("invalid hexidecimal string",a.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==n[1]&&a.throwError("hex string must have 0x prefix",a.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(u(t)){for(var r=[],s=0;s<t.length;s++){var o=t[s];r.push(p[(240&o)>>4]+p[15&o])}return"0x"+r.join("")}return a.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function l(t,e){for(d(t)||a.throwError("invalid hex string",a.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function h(t){var e,n=0,r="0x",i="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&a.throwError("at least on of recoveryParam or v must be specified",a.INVALID_ARGUMENT,{argument:"signature",value:t}),r=l(t.r,32),i=l(t.s,32),"string"==typeof(n=t.v)&&(n=parseInt(n,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-n%2),n=27+s}else{var o=c(t);if(65!==o.length)throw new Error("invalid signature");r=f(o.slice(0,32)),i=f(o.slice(32,64)),27!==(n=o[64])&&28!==n&&(n=27+n%2)}return{r:r,s:i,recoveryParam:n-27,v:n}}n.hexlify=f,n.hexDataLength=function(t){return d(t)&&t.length%2==0?(t.length-2)/2:null},n.hexDataSlice=function(t,e,n){return d(t)||a.throwError("invalid hex data",a.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&a.throwError("hex data length must be even",a.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=n?"0x"+t.substring(e,2+2*n):"0x"+t.substring(e)},n.hexStripZeros=function(t){for(d(t)||a.throwError("invalid hex string",a.INVALID_ARGUMENT,{arg:"value",value:t});3<t.length&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},n.hexZeroPad=l,n.splitSignature=h,n.joinSignature=function(t){return f(A([(t=h(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},{"../errors":5}],65:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors")),i=t("./bytes"),s=t("./utf8"),o=t("./keccak256"),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),c=new RegExp("^((.*)\\.)?([^.]+)$"),A=new RegExp("^[a-z0-9.-]*$");n.namehash=function(t){"string"!=typeof t&&a.throwError("invalid address - "+String(t),a.INVALID_ARGUMENT,{argument:"name",value:t}),(t=t.toLowerCase()).match(A)||a.throwError("contains invalid UseSTD3ASCIIRules characters",a.INVALID_ARGUMENT,{argument:"name",value:t});for(var e=u;t.length;){var n=t.match(c),r=s.toUtf8Bytes(n[3]);e=o.keccak256(i.concat([e,o.keccak256(r)])),t=n[2]||""}return i.hexlify(e)},n.id=function(t){return o.keccak256(s.toUtf8Bytes(t))},n.hashMessage=function(t){return o.keccak256(i.concat([s.toUtf8Bytes("Ethereum Signed Message:\n"),s.toUtf8Bytes(String(t.length)),"string"==typeof t?s.toUtf8Bytes(t):t]))}},{"../errors":5,"./bytes":64,"./keccak256":71,"./utf8":85}],66:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors")),i=t("../wordlists/lang-en"),s=t("./basex"),o=t("./bytes"),u=t("./bignumber"),c=t("./utf8"),A=t("./pbkdf2"),d=t("./hmac"),p=t("./properties"),f=t("./secp256k1"),l=t("./sha2"),h=u.bigNumberify("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=c.toUtf8Bytes("Bitcoin seed"),g=2147483648;function b(t){return(1<<t)-1<<8-t}function m(t){return o.hexZeroPad(o.hexlify(t),32)}function I(t){var e=o.hexDataSlice(l.sha256(l.sha256(t)),0,4);return s.Base58.encode(o.concat([t,e]))}var C={};n.defaultPath="m/44'/60'/0'/0/0";var v=(Object.defineProperty(w.prototype,"extendedKey",{get:function(){if(256<=this.depth)throw new Error("Depth too large!");return I(o.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",o.hexlify(this.depth),this.parentFingerprint,o.hexZeroPad(o.hexlify(this.index),4),this.chainCode,null!=this.privateKey?o.concat(["0x00",this.privateKey]):this.publicKey]))},enumerable:!0,configurable:!0}),w.prototype.neuter=function(){return new w(C,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,null,this.path)},w.prototype._derive=function(t){if(4294967295<t)throw new Error("invalid index - "+String(t));var e=this.path;e&&(e+="/"+(t&~g));var n=new Uint8Array(37);if(t&g){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(o.arrayify(this.privateKey),1),e&&(e+="'")}else n.set(o.arrayify(this.publicKey));for(var r=24;0<=r;r-=8)n[33+(r>>3)]=t>>24-r&255;var a=d.computeHmac(d.SupportedAlgorithms.sha512,this.chainCode,n),i=a.slice(0,32),s=a.slice(32),c=null,A=null;return this.privateKey?c=m(u.bigNumberify(i).add(this.privateKey).mod(h)):A=new f.KeyPair(o.hexlify(i))._addPoint(this.publicKey),new w(C,c,A,this.fingerprint,m(s),t,this.depth+1,this.mnemonic,e)},w.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();for(var n=this,r=0;r<e.length;r++){var a=e[r];if(a.match(/^[0-9]+'$/)){var i=parseInt(a.substring(0,a.length-1));if(g<=i)throw new Error("invalid path index - "+a);n=n._derive(g+i)}else{if(!a.match(/^[0-9]+$/))throw new Error("invalid path component - "+a);if(i=parseInt(a),g<=i)throw new Error("invalid path index - "+a);n=n._derive(i)}}return n},w.isHDNode=function(t){return p.isType(t,"HDNode")},w);function w(t,e,n,r,i,s,u,c,A){if(a.checkNew(this,w),t!==C)throw new Error("HDNode constructor cannot be called directly");var d;e?(d=new f.KeyPair(e),p.defineReadOnly(this,"privateKey",d.privateKey),p.defineReadOnly(this,"publicKey",d.compressedPublicKey)):(p.defineReadOnly(this,"privateKey",null),p.defineReadOnly(this,"publicKey",o.hexlify(n))),p.defineReadOnly(this,"parentFingerprint",r),p.defineReadOnly(this,"fingerprint",o.hexDataSlice(l.ripemd160(l.sha256(this.publicKey)),0,4)),p.defineReadOnly(this,"address",f.computeAddress(this.publicKey)),p.defineReadOnly(this,"chainCode",i),p.defineReadOnly(this,"index",s),p.defineReadOnly(this,"depth",u),p.defineReadOnly(this,"mnemonic",c),p.defineReadOnly(this,"path",A),p.setType(this,"HDNode")}function E(t,e){var n=o.arrayify(t);if(n.length<16||64<n.length)throw new Error("invalid seed");var r=o.arrayify(d.computeHmac(d.SupportedAlgorithms.sha512,y,n));return new v(C,m(r.slice(0,32)),null,"0x00000000",m(r.slice(32)),0,0,e,"m")}function B(t,e){e=e||"";var n=c.toUtf8Bytes("mnemonic"+e,c.UnicodeNormalizationForm.NFKD);return o.hexlify(A.pbkdf2(c.toUtf8Bytes(t,c.UnicodeNormalizationForm.NFKD),n,2048,64,"sha512"))}function Q(t,e){e=e||i.langEn,a.checkNormalize();var n=e.split(t);if(n.length%3!=0)throw new Error("invalid mnemonic");for(var r=o.arrayify(new Uint8Array(Math.ceil(11*n.length/8))),s=0,u=0;u<n.length;u++){var c=e.getWordIndex(n[u].normalize("NFKD"));if(-1===c)throw new Error("invalid mnemonic");for(var A=0;A<11;A++)c&1<<10-A&&(r[s>>3]|=1<<7-s%8),s++}var d=32*n.length/3,p=b(n.length/3),f=o.arrayify(l.sha256(r.slice(0,d/8)))[0];if((f&=p)!=(r[r.length-1]&p))throw new Error("invalid checksum");return o.hexlify(r.slice(0,d/8))}function M(t,e){if((t=o.arrayify(t)).length%4!=0||t.length<16||32<t.length)throw new Error("invalid entropy");for(var n=[0],r=11,a=0;a<t.length;a++)8<r?(n[n.length-1]<<=8,n[n.length-1]|=t[a],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=t[a]>>8-r,n.push(t[a]&(1<<8-r)-1),r+=3);var s=o.arrayify(l.sha256(t))[0],u=t.length/4;return s&=b(u),n[n.length-1]<<=u,n[n.length-1]|=s>>8-u,(e=e||i.langEn).join(n.map((function(t){return e.getWord(t)})))}n.HDNode=v,n.fromExtendedKey=function(t){var e=s.Base58.decode(t);82===e.length&&I(e.slice(0,78))===t||a.throwError("invalid extended key",a.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"});var n=e[4],r=o.hexlify(e.slice(5,9)),i=parseInt(o.hexlify(e.slice(9,13)).substring(2),16),u=o.hexlify(e.slice(13,45)),c=e.slice(45,78);switch(o.hexlify(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new v(C,null,o.hexlify(c),r,u,i,n,null,null);case"0x0488ade4":case"0x04358394":if(0!==c[0])break;return new v(C,o.hexlify(c.slice(1)),null,r,u,i,n,null,null)}return a.throwError("invalid extended key",a.INVALID_ARGUMENT,{argument:"extendedKey",value:"[REDACTED]"})},n.fromMnemonic=function(t,e,n){return E(B(t=M(Q(t,e),e),n),t)},n.fromSeed=function(t){return E(t,null)},n.mnemonicToSeed=B,n.mnemonicToEntropy=Q,n.entropyToMnemonic=M,n.isValidMnemonic=function(t,e){try{return Q(t,e),!0}catch(t){}return!1}},{"../errors":5,"../wordlists/lang-en":90,"./basex":62,"./bignumber":63,"./bytes":64,"./hmac":67,"./pbkdf2":73,"./properties":74,"./secp256k1":77,"./sha2":79,"./utf8":85}],67:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a,i,s=r(t("hash.js")),o=t("../utils/bytes"),u=r(t("../errors"));(i=a=n.SupportedAlgorithms||(n.SupportedAlgorithms={})).sha256="sha256",i.sha512="sha512",n.computeHmac=function(t,e,n){return a[t]||u.throwError("unsupported algorithm "+t,u.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),o.arrayify(s.hmac(s[t],o.arrayify(e)).update(o.arrayify(n)).digest())}},{"../errors":5,"../utils/bytes":64,"hash.js":26}],68:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./abi-coder");n.AbiCoder=a.AbiCoder,n.defaultAbiCoder=a.defaultAbiCoder,n.formatSignature=a.formatSignature,n.formatParamType=a.formatParamType,n.parseSignature=a.parseSignature,n.parseParamType=a.parseParamType;var i=t("./address");n.getAddress=i.getAddress,n.getContractAddress=i.getContractAddress,n.getCreate2Address=i.getCreate2Address,n.getIcapAddress=i.getIcapAddress;var s=r(t("./base64"));n.base64=s;var o=t("./bignumber");n.BigNumber=o.BigNumber,n.bigNumberify=o.bigNumberify;var u=t("./bytes");n.arrayify=u.arrayify,n.concat=u.concat,n.hexDataSlice=u.hexDataSlice,n.hexDataLength=u.hexDataLength,n.hexlify=u.hexlify,n.hexStripZeros=u.hexStripZeros,n.hexZeroPad=u.hexZeroPad,n.isHexString=u.isHexString,n.joinSignature=u.joinSignature,n.padZeros=u.padZeros,n.splitSignature=u.splitSignature,n.stripZeros=u.stripZeros;var c=t("./hash");n.hashMessage=c.hashMessage,n.id=c.id,n.namehash=c.namehash;var A=r(t("./hdnode"));n.HDNode=A;var d=t("./interface");n.Interface=d.Interface;var p=t("./json-wallet");n.getJsonWalletAddress=p.getJsonWalletAddress;var f=t("./keccak256");n.keccak256=f.keccak256;var l=t("./sha2");n.sha256=l.sha256;var h=t("./solidity");n.solidityKeccak256=h.keccak256,n.solidityPack=h.pack,n.soliditySha256=h.sha256;var y=t("./random-bytes");n.randomBytes=y.randomBytes;var g=t("./networks");n.getNetwork=g.getNetwork;var b=t("./properties");n.checkProperties=b.checkProperties,n.deepCopy=b.deepCopy,n.defineReadOnly=b.defineReadOnly,n.resolveProperties=b.resolveProperties,n.shallowCopy=b.shallowCopy;var m=r(t("./rlp"));n.RLP=m;var I=t("./secp256k1");n.computeAddress=I.computeAddress,n.computePublicKey=I.computePublicKey,n.recoverAddress=I.recoverAddress,n.recoverPublicKey=I.recoverPublicKey,n.verifyMessage=I.verifyMessage;var C=t("./signing-key");n.SigningKey=C.SigningKey;var v=t("./transaction");n.populateTransaction=v.populateTransaction;var w=t("./transaction");n.parseTransaction=w.parse,n.serializeTransaction=w.serialize;var E=t("./utf8");n.formatBytes32String=E.formatBytes32String,n.parseBytes32String=E.parseBytes32String,n.toUtf8Bytes=E.toUtf8Bytes,n.toUtf8String=E.toUtf8String;var B=t("./units");n.commify=B.commify,n.formatEther=B.formatEther,n.parseEther=B.parseEther,n.formatUnits=B.formatUnits,n.parseUnits=B.parseUnits;var Q=t("./web");n.fetchJson=Q.fetchJson,n.poll=Q.poll;var M=t("./hmac");n.SupportedAlgorithms=M.SupportedAlgorithms;var _=t("./utf8");n.UnicodeNormalizationForm=_.UnicodeNormalizationForm;var x=t("./wordlist");n.Wordlist=x.Wordlist},{"./abi-coder":59,"./address":60,"./base64":61,"./bignumber":63,"./bytes":64,"./hash":65,"./hdnode":66,"./hmac":67,"./interface":69,"./json-wallet":70,"./keccak256":71,"./networks":72,"./properties":74,"./random-bytes":75,"./rlp":76,"./secp256k1":77,"./sha2":79,"./signing-key":81,"./solidity":82,"./transaction":83,"./units":84,"./utf8":85,"./web":86,"./wordlist":87}],69:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};function s(t){for(var e in l.setType(this,"Description"),t)l.defineReadOnly(this,e,l.deepCopy(t[e],!0));Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0});var o,u=t("./address"),c=t("./abi-coder"),A=t("./bignumber"),d=t("./bytes"),p=t("./hash"),f=t("./keccak256"),l=t("./properties"),h=i(t("../errors")),y=function(t){l.setType(this,"Indexed"),l.defineReadOnly(this,"hash",t)},g=(a(b,o=s),b.prototype.encode=function(t,e){d.isHexString(t)||h.throwError("invalid contract bytecode",h.INVALID_ARGUMENT,{arg:"bytecode",value:t}),h.checkArgumentCount(e.length,this.inputs.length," in Interface constructor");try{return t+c.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){h.throwError("invalid constructor argument",h.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},b);function b(){return null!==o&&o.apply(this,arguments)||this}var m,I=(a(C,m=s),C.prototype.encode=function(t){h.checkArgumentCount(t.length,this.inputs.length," in interface function "+this.name);try{return this.sighash+c.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){h.throwError("invalid input argument",h.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},C.prototype.decode=function(t){try{return c.defaultAbiCoder.decode(this.outputs,d.arrayify(t))}catch(e){h.throwError("invalid data for function output",h.INVALID_ARGUMENT,{arg:"data",errorArg:e.arg,errorValue:e.value,value:t,reason:e.reason})}},C);function C(){return null!==m&&m.apply(this,arguments)||this}var v,w=(a(E,v=s),E);function E(){return null!==v&&v.apply(this,arguments)||this}var B,Q=(a(M,B=s),M.prototype.encodeTopics=function(t){var e=this;t.length>this.inputs.length&&h.throwError("too many arguments for "+this.name,h.UNEXPECTED_ARGUMENT,{maxCount:t.length,expectedCount:this.inputs.length});var n=[];for(this.anonymous||n.push(this.topic),t.forEach((function(t,r){var a=e.inputs[r];a.indexed?null==t?n.push(null):"string"===a.type?n.push(p.id(t)):"bytes"===a.type?n.push(f.keccak256(t)):-1!==a.type.indexOf("[")||"tuple"===a.type.substring(0,5)?h.throwError("filtering with tuples or arrays not implemented yet; bug us on GitHub",h.NOT_IMPLEMENTED,{operation:"filter(array|tuple)"}):("address"===a.type&&u.getAddress(t),n.push(d.hexZeroPad(d.hexlify(t),32).toLowerCase())):null!=t&&h.throwError("cannot filter non-indexed parameters; must be null",h.INVALID_ARGUMENT,{argument:a.name||r,value:t})}));n.length&&null===n[n.length-1];)n.pop();return n},M.prototype.decode=function(t,e){null==e||this.anonymous||(e=e.slice(1));var n,r=[],a=[],i=[];this.inputs.forEach((function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(r.push({type:"bytes32",name:t.name||""}),i.push(!0)):(r.push(t),i.push(!1)):(a.push(t),i.push(!1))})),null!=e&&(n=c.defaultAbiCoder.decode(r,d.concat(e)));var s=c.defaultAbiCoder.decode(a,d.arrayify(t)),o={},u=0,A=0;return this.inputs.forEach((function(t,r){t.indexed?null==e?o[r]=new y(null):i[r]?o[r]=new y(n[A++]):o[r]=n[A++]:o[r]=s[u++],t.name&&(o[t.name]=o[r])})),o.length=this.inputs.length,new w(o)},M);function M(){return null!==B&&B.apply(this,arguments)||this}var _,x=(a(k,_=s),k);function k(){return null!==_&&_.apply(this,arguments)||this}var S,D=(a(R,S=s),R);function R(){return null!==S&&S.apply(this,arguments)||this}function N(t){switch(t.type){case"constructor":var e=new g({inputs:t.inputs,payable:null==t.payable||!!t.payable});this.deployFunction||(this.deployFunction=e);break;case"function":var n=c.formatSignature(t).replace(/tuple/g,""),r=p.id(n).substring(0,10),a=!1;null!=t.constant?a=t.constant:null!=t.stateMutability&&(a="view"==t.stateMutability||"pure"==t.stateMutability),e=new I({inputs:t.inputs,outputs:t.outputs,gas:t.gas,payable:null==t.payable||!!t.payable,type:a?"call":"transaction",name:t.name,signature:n,sighash:r}),t.name&&(null==this.functions[t.name]?l.defineReadOnly(this.functions,t.name,e):h.warn("WARNING: Multiple definitions for "+t.name)),null==this.functions[e.signature]&&l.defineReadOnly(this.functions,e.signature,e);break;case"event":n=c.formatSignature(t).replace(/tuple/g,""),e=new Q({name:t.name,signature:n,inputs:t.inputs,topic:p.id(n),anonymous:!!t.anonymous}),t.name&&null==this.events[t.name]&&l.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&l.defineReadOnly(this.events,e.signature,e);break;case"receive":case"fallback":break;default:h.warn("WARNING: unsupported ABI type - "+t.type)}}var T=(O.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var n in this.functions)if(-1!==n.indexOf("(")){var r=this.functions[n];if(r.sighash===e){var a=c.defaultAbiCoder.decode(r.inputs,"0x"+t.data.substring(10));return new x({args:a,decode:r.decode,name:r.name,signature:r.signature,sighash:r.sighash,value:A.bigNumberify(t.value||"0")})}}return null},O.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var n=this.events[e];if(!n.anonymous&&n.topic===t.topics[0])return new D({decode:n.decode,name:n.name,signature:n.signature,topic:n.topic,values:n.decode(t.data,t.topics)})}return null},O.isInterface=function(t){return l.isType(t,"Interface")},O.isIndexed=function(t){return l.isType(t,"Indexed")},O);function O(t){if(h.checkNew(this,O),"string"==typeof t){try{t=JSON.parse(t)}catch(e){h.throwError("could not parse ABI JSON",h.INVALID_ARGUMENT,{arg:"abi",errorMessage:e.message,value:t})}if(!Array.isArray(t))return h.throwError("invalid abi",h.INVALID_ARGUMENT,{arg:"abi",value:t}),null}l.defineReadOnly(this,"functions",{}),l.defineReadOnly(this,"events",{});var e=[];t.forEach((function(t){"string"==typeof t&&(t=c.parseSignature(t)),e.push(t)})),l.defineReadOnly(this,"abi",l.deepCopy(e,!0)),e.forEach(N,this),this.deployFunction||N.call(this,{type:"constructor",inputs:[]}),l.setType(this,"Interface")}n.Interface=T},{"../errors":5,"./abi-coder":59,"./address":60,"./bignumber":63,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74}],70:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./address");function a(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function i(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}n.isCrowdsaleWallet=a,n.isSecretStorageWallet=i,n.getJsonWalletAddress=function(t){if(a(t))try{return r.getAddress(JSON.parse(t).ethaddr)}catch(t){return null}if(i(t))try{return r.getAddress(JSON.parse(t).address)}catch(t){return null}return null}},{"./address":60}],71:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("js-sha3"),a=t("./bytes");n.keccak256=function(t){return"0x"+r.keccak_256(a.arrayify(t))}},{"./bytes":64,"js-sha3":40}],72:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t){return function(e){var n=[];return e.InfuraProvider&&n.push(new e.InfuraProvider(t)),e.EtherscanProvider&&n.push(new e.EtherscanProvider(t)),0===n.length?null:e.FallbackProvider?new e.FallbackProvider(n):n[0]}}function s(t,e){return function(n){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null}}var o={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},c={unspecified:{chainId:0,name:"unspecified"},homestead:o,mainnet:o,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://web3.gastracker.io","classic")},classicTestnet:{chainId:62,name:"classicTestnet",_defaultProvider:s("https://web3.gastracker.io/morden","classicTestnet")}};n.getNetwork=function(t){if(null==t)return null;if("number"==typeof t){for(var e in c){var n=c[e];if(n.chainId===t)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var r=c[t];return null==r?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}var i=c[t.name];return i?(0!==t.chainId&&t.chainId!==i.chainId&&a.throwError("network chainId mismatch",a.INVALID_ARGUMENT,{arg:"network",value:t}),{name:t.name,chainId:i.chainId,ensAddress:t.ensAddress||i.ensAddress||null,_defaultProvider:t._defaultProvider||i._defaultProvider||null}):("number"!=typeof t.chainId&&a.throwError("invalid network chainId",a.INVALID_ARGUMENT,{arg:"network",value:t}),t)}},{"../errors":5}],73:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../utils/bytes"),a=t("./hmac");n.pbkdf2=function(t,e,n,i,s){var o;t=r.arrayify(t),e=r.arrayify(e);var u,c,A=1,d=new Uint8Array(i),p=new Uint8Array(e.length+4);p.set(e);for(var f=1;f<=A;f++){p[e.length]=f>>24&255,p[e.length+1]=f>>16&255,p[e.length+2]=f>>8&255,p[e.length+3]=255&f;var l=a.computeHmac(s,t,p);o||(o=l.length,c=new Uint8Array(o),u=i-((A=Math.ceil(i/o))-1)*o),c.set(l);for(var h=1;h<n;h++){l=a.computeHmac(s,t,l);for(var y=0;y<o;y++)c[y]^=l[y]}var g=(f-1)*o,b=f===A?u:o;d.set(r.arrayify(c).slice(0,b),g)}return r.arrayify(d)}},{"../utils/bytes":64,"./hmac":67}],74:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("../errors"));function i(t,e,n){Object.defineProperty(t,e,{enumerable:!0,value:n,writable:!1})}function s(t,e){return t&&t._ethersType===e}n.defineReadOnly=i,n.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},n.isType=s,n.resolveProperties=function(t){var e={},n=[];return Object.keys(t).forEach((function(r){var a=t[r];a instanceof Promise?n.push(a.then((function(t){return e[r]=t,null}))):e[r]=a})),Promise.all(n).then((function(){return e}))},n.checkProperties=function(t,e){t&&"object"==o(t)||a.throwError("invalid object",a.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(n){e[n]||a.throwError("invalid object key - "+n,a.INVALID_ARGUMENT,{argument:"transaction",value:t,key:n})}))},n.shallowCopy=function(t){var e={};for(var n in t)e[n]=t[n];return e};var u={boolean:!0,number:!0,string:!0};n.deepCopy=function t(e,n){if(null==e||u[o(e)])return e;if(Array.isArray(e)){var r=e.map((function(e){return t(e,n)}));return n&&Object.freeze(r),r}if("object"==o(e)){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var a in r={},e){var c=e[a];void 0!==c&&i(r,a,t(c,n))}return n&&Object.freeze(r),r}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+o(e))},n.inheritable=function t(e){return function(n){var r,a;a=e,(r=n).super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(n,"inherits",t(n))}}},{"../errors":5}],75:[function(t,e,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/bytes"),a=t("../utils/properties"),i=e.crypto||e.msCrypto;function s(t){if(t<=0||1024<t||parseInt(String(t))!=t)throw new Error("invalid length");var e=new Uint8Array(t);return i.getRandomValues(e),n.arrayify(e)}i&&i.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),i={getRandomValues:function(t){for(var e=0;e<20;e++)for(var n=0;n<t.length;n++)e?t[n]^=Math.trunc(256*Math.random()):t[n]=Math.trunc(256*Math.random());return t},_weakCrypto:!0}),r.randomBytes=s,!0===i._weakCrypto&&a.defineReadOnly(s,"_weakCrypto",!0)}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/bytes":64,"../utils/properties":74}],76:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bytes");function a(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function i(t,e,n){for(var r=0,a=0;a<n;a++)r=256*r+t[e+a];return r}function s(t,e,n,r){for(var a=[];n<e+1+r;){var i=o(t,n);if(a.push(i.result),e+1+r<(n+=i.consumed))throw new Error("invalid rlp")}return{consumed:1+r,result:a}}function o(t,e){if(0===t.length)throw new Error("invalid rlp data");if(248<=t[e]){if(e+1+(n=t[e]-247)>t.length)throw new Error("too short");if(e+1+n+(a=i(t,e+1,n))>t.length)throw new Error("to short");return s(t,e,e+1+n,n+a)}if(192<=t[e]){if(e+1+(a=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,a)}if(184<=t[e]){var n;if(e+1+(n=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+n+(a=i(t,e+1,n))>t.length)throw new Error("invalid rlp data");return{consumed:1+n+a,result:r.hexlify(t.slice(e+1+n,e+1+n+a))}}if(128<=t[e]){var a;if(e+1+(a=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+a,result:r.hexlify(t.slice(e+1,e+1+a))}}return{consumed:1,result:r.hexlify(t[e])}}n.encode=function(t){return r.hexlify(function t(e){if(Array.isArray(e)){var n=[];return e.forEach((function(e){n=n.concat(t(e))})),n.length<=55?(n.unshift(192+n.length),n):((i=a(n.length)).unshift(247+i.length),i.concat(n))}var i,s=Array.prototype.slice.call(r.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((i=a(s.length)).unshift(183+i.length),i.concat(s))}(t))},n.decode=function(t){var e=r.arrayify(t),n=o(e,0);if(n.consumed!==e.length)throw new Error("invalid rlp data");return n.result}},{"./bytes":64}],77:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("elliptic"),i=t("./address"),s=t("./bytes"),o=t("./hash"),u=t("./keccak256"),c=t("./properties"),A=r(t("../errors")),d=null;function p(){return d=d||new a.ec("secp256k1")}var f=(l.prototype.sign=function(t){var e=p().keyFromPrivate(s.arrayify(this.privateKey)).sign(s.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:s.hexZeroPad("0x"+e.r.toString(16),32),s:s.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},l.prototype.computeSharedSecret=function(t){var e=p().keyFromPrivate(s.arrayify(this.privateKey)),n=p().keyFromPublic(s.arrayify(h(t)));return s.hexZeroPad("0x"+e.derive(n.getPublic()).toString(16),32)},l.prototype._addPoint=function(t){var e=p().keyFromPublic(s.arrayify(this.publicKey)),n=p().keyFromPublic(s.arrayify(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")},l);function l(t){var e=p().keyFromPrivate(s.arrayify(t));c.defineReadOnly(this,"privateKey",s.hexlify(e.priv.toArray("be",32))),c.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),c.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),c.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}function h(t,e){var n=s.arrayify(t);if(32!==n.length)return 33===n.length?e?s.hexlify(n):"0x"+p().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?e?"0x"+p().keyFromPublic(n).getPublic(!0,"hex"):s.hexlify(n):(A.throwError("invalid public or private key",A.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null);var r=new f(n);return e?r.compressedPublicKey:r.publicKey}function y(t){var e="0x"+h(t).slice(4);return i.getAddress("0x"+u.keccak256(e).substring(26))}function g(t,e){var n=s.splitSignature(e),r={r:s.arrayify(n.r),s:s.arrayify(n.s)};return"0x"+p().recoverPubKey(s.arrayify(t),r,n.recoveryParam).encode("hex",!1)}function b(t,e){return y(g(s.arrayify(t),e))}n.KeyPair=f,n.computePublicKey=h,n.computeAddress=y,n.recoverPublicKey=g,n.recoverAddress=b,n.verifyMessage=function(t,e){return b(o.hashMessage(t),e)}},{"../errors":5,"./address":60,"./bytes":64,"./hash":65,"./keccak256":71,"./properties":74,elliptic:12}],78:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var i=r(t("aes-js")),s=r(t("scrypt-js")),o=r(t("uuid")),u=t("./signing-key"),c=a(t("./hdnode")),A=t("./address"),d=t("./bytes"),p=t("./pbkdf2"),f=t("./keccak256"),l=t("./utf8"),h=t("./random-bytes");function y(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),d.arrayify(t)}function g(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function b(t){return"string"==typeof t?l.toUtf8Bytes(t,l.UnicodeNormalizationForm.NFKC):d.arrayify(t)}function m(t,e){for(var n=t,r=e.toLowerCase().split("/"),a=0;a<r.length;a++){var i=null;for(var s in n)if(s.toLowerCase()===r[a]){i=n[s];break}if(null===i)return null;n=i}return n}n.decryptCrowdsale=function(t,e){var n=JSON.parse(t);e=b(e);var r=A.getAddress(m(n,"ethaddr")),a=y(m(n,"encseed"));if(!a||a.length%16!=0)throw new Error("invalid encseed");for(var s=p.pbkdf2(e,e,2e3,32,"sha256").slice(0,16),o=a.slice(0,16),c=a.slice(16),h=new i.default.ModeOfOperation.cbc(s,o),g=d.arrayify(h.decrypt(c)),I=(g=i.default.padding.pkcs7.strip(g),""),C=0;C<g.length;C++)I+=String.fromCharCode(g[C]);var v=l.toUtf8Bytes(I),w=new u.SigningKey(f.keccak256(v));if(w.address!==r)throw new Error("corrupt crowdsale wallet");return w},n.decrypt=function(t,e,n){function r(t,e){var n,r,s=y(m(a,"crypto/ciphertext"));if(d.hexlify((n=t.slice(16,32),r=s,f.keccak256(d.concat([n,r])))).substring(2)!==m(a,"crypto/mac").toLowerCase())return e(new Error("invalid password")),null;var o=function(t,e){if("aes-128-ctr"!==m(a,"crypto/cipher"))return null;var n=y(m(a,"crypto/cipherparams/iv")),r=new i.default.Counter(n),s=new i.default.ModeOfOperation.ctr(t,r);return d.arrayify(s.decrypt(e))}(t.slice(0,16),s),p=t.slice(32,64);if(!o)return e(new Error("unsupported cipher")),null;var l=new u.SigningKey(o);if(a.address&&l.address!==A.getAddress(a.address))return e(new Error("address mismatch")),null;var h=m(a,"x-ethers/locale");if("0.1"===m(a,"x-ethers/version")&&(null==h||"en"===h)){var g=y(m(a,"x-ethers/mnemonicCiphertext")),b=y(m(a,"x-ethers/mnemonicCounter")),I=new i.default.Counter(b),C=new i.default.ModeOfOperation.ctr(p,I),v=m(a,"x-ethers/path")||c.defaultPath,w=d.arrayify(C.decrypt(g)),E=c.entropyToMnemonic(w),B=c.fromMnemonic(E).derivePath(v);if(B.privateKey!=d.hexlify(o))return e(new Error("mnemonic mismatch")),null;l=new u.SigningKey(B)}return l}var a=JSON.parse(t),o=b(e);return new Promise((function(t,e){var i=m(a,"crypto/kdf");if(i&&"string"==typeof i)if("scrypt"===i.toLowerCase()){var u=y(m(a,"crypto/kdfparams/salt")),c=parseInt(m(a,"crypto/kdfparams/n")),A=parseInt(m(a,"crypto/kdfparams/r")),f=parseInt(m(a,"crypto/kdfparams/p"));if(!c||!A||!f)return void e(new Error("unsupported key-derivation function parameters"));if(0!=(c&c-1))return void e(new Error("unsupported key-derivation function parameter value for N"));if(32!==(g=parseInt(m(a,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));n&&n(0),s.default(o,u,c,A,f,64,(function(a,i,s){if(a)a.progress=i,e(a);else if(s){var o=r(s=d.arrayify(s),e);if(!o)return;n&&n(1),t(o)}else if(n)return n(i)}))}else if("pbkdf2"===i.toLowerCase()){u=y(m(a,"crypto/kdfparams/salt"));var l=null,h=m(a,"crypto/kdfparams/prf");if("hmac-sha256"===h)l="sha256";else{if("hmac-sha512"!==h)return void e(new Error("unsupported prf"));l="sha512"}var g,b=parseInt(m(a,"crypto/kdfparams/c"));if(32!==(g=parseInt(m(a,"crypto/kdfparams/dklen"))))return void e(new Error("unsupported key-derivation derived-key length"));var I=r(p.pbkdf2(o,u,b,g,l),e);if(!I)return;t(I)}else e(new Error("unsupported key-derivation function"));else e(new Error("unsupported key-derivation function"))}))},n.encrypt=function(t,e,n,r){var a;if("function"!=typeof n||r||(r=n,n={}),n=n||{},32!==(a=u.SigningKey.isSigningKey(t)?d.arrayify(t.privateKey):d.arrayify(t)).length)throw new Error("invalid private key");var A=b(e),p=null;if(n.entropy&&(p=d.arrayify(n.entropy)),n.mnemonic)if(p){if(c.entropyToMnemonic(p)!==n.mnemonic)throw new Error("entropy and mnemonic mismatch")}else p=d.arrayify(c.mnemonicToEntropy(n.mnemonic,n.wordlist));var l=n.path;p&&!l&&(l=c.defaultPath);var y=(y=n.client)||"ethers.js",m=n.salt?d.arrayify(n.salt):h.randomBytes(32),I=null;if(n.iv){if(16!==(I=d.arrayify(n.iv)).length)throw new Error("invalid iv")}else I=h.randomBytes(16);var C=null;if(n.uuid){if(16!==(C=d.arrayify(n.uuid)).length)throw new Error("invalid uuid")}else C=h.randomBytes(16);var v=1<<17,w=8,E=1;return n.scrypt&&(n.scrypt.N&&(v=n.scrypt.N),n.scrypt.r&&(w=n.scrypt.r),n.scrypt.p&&(E=n.scrypt.p)),new Promise((function(t,e){r&&r(0),s.default(A,m,v,w,E,64,(function(s,c,A){if(s)s.progress=c,e(s);else if(A){var b,B,Q,M,_,x,k=(A=d.arrayify(A)).slice(0,16),S=A.slice(16,32),D=A.slice(32,64),R=new u.SigningKey(a).address,N=new i.default.Counter(I),T=new i.default.ModeOfOperation.ctr(k,N),O=d.arrayify(T.encrypt(a)),H=f.keccak256(d.concat([S,O])),L={address:R.substring(2).toLowerCase(),id:o.default.v4({random:C}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:d.hexlify(I).substring(2)},ciphertext:d.hexlify(O).substring(2),kdf:"scrypt",kdfparams:{salt:d.hexlify(m).substring(2),n:v,dklen:32,p:E,r:w},mac:H.substring(2)}};p&&(b=h.randomBytes(16),B=new i.default.Counter(b),Q=new i.default.ModeOfOperation.ctr(D,B),M=d.arrayify(Q.encrypt(p)),x=(_=new Date).getUTCFullYear()+"-"+g(_.getUTCMonth()+1,2)+"-"+g(_.getUTCDate(),2)+"T"+g(_.getUTCHours(),2)+"-"+g(_.getUTCMinutes(),2)+"-"+g(_.getUTCSeconds(),2)+".0Z",L["x-ethers"]={client:y,gethFilename:"UTC--"+x+"--"+L.address,mnemonicCounter:d.hexlify(b).substring(2),mnemonicCiphertext:d.hexlify(M).substring(2),path:l,version:"0.1"},n.wordlist&&"string"==typeof n.wordlist.locale&&(L["x-ethers"].locale=n.wordlist.locale)),r&&r(1),t(JSON.stringify(L))}else if(r)return r(c)}))}))}},{"./address":60,"./bytes":64,"./hdnode":66,"./keccak256":71,"./pbkdf2":73,"./random-bytes":75,"./signing-key":81,"./utf8":85,"aes-js":8,"scrypt-js":44,uuid:48}],79:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var a=r(t("hash.js")),i=t("./bytes");n.ripemd160=function(t){return"0x"+a.default.ripemd160().update(i.arrayify(t)).digest("hex")},n.sha256=function(t){return"0x"+a.default.sha256().update(i.arrayify(t)).digest("hex")},n.sha512=function(t){return"0x"+a.default.sha512().update(i.arrayify(t)).digest("hex")}},{"./bytes":64,"hash.js":26}],80:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t("setimmediate"),n.platform="browser"},{setimmediate:45}],81:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("./hdnode"),i=t("./bytes"),s=t("./properties"),u=t("./secp256k1"),c=r(t("../errors")),A=(d.prototype.signDigest=function(t){return this.keyPair.sign(t)},d.prototype.computeSharedSecret=function(t){return this.keyPair.computeSharedSecret(i.arrayify(t))},d.isSigningKey=function(t){return s.isType(t,"SigningKey")},d);function d(t){c.checkNew(this,d);var e=a.HDNode.isHDNode(t)?(s.defineReadOnly(this,"mnemonic",t.mnemonic),s.defineReadOnly(this,"path",t.path),i.arrayify(t.privateKey)):("string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t),i.arrayify(t));try{32!==e.length&&c.throwError("exactly 32 bytes required",c.INVALID_ARGUMENT,{arg:"privateKey",value:"[REDACTED]"})}catch(t){var n={arg:"privateKey",reason:t.reason,value:"[REDACTED]"};t.value&&("number"==typeof t.value.length&&(n.length=t.value.length),n.type=o(t.value)),c.throwError("invalid private key",t.code,n)}s.defineReadOnly(this,"privateKey",i.hexlify(e)),s.defineReadOnly(this,"keyPair",new u.KeyPair(e)),s.defineReadOnly(this,"publicKey",this.keyPair.publicKey),s.defineReadOnly(this,"address",u.computeAddress(this.keyPair.publicKey)),s.setType(this,"SigningKey")}n.SigningKey=A},{"../errors":5,"./bytes":64,"./hdnode":66,"./properties":74,"./secp256k1":77}],82:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./bignumber"),a=t("./bytes"),i=t("./utf8"),s=t("./keccak256"),o=t("./sha2"),u=new RegExp("^bytes([0-9]+)$"),c=new RegExp("^(u?int)([0-9]*)$"),A=new RegExp("^(.*)\\[([0-9]*)\\]$");function d(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");var n=[];return t.forEach((function(t,s){n.push(function t(e,n,s){switch(e){case"address":return s?a.padZeros(n,32):a.arrayify(n);case"string":return i.toUtf8Bytes(n);case"bytes":return a.arrayify(n);case"bool":return n=n?"0x01":"0x00",s?a.padZeros(n,32):a.arrayify(n)}var o=e.match(c);if(o){if((d=parseInt(o[2]||"256"))%8!=0||0===d||256<d)throw new Error("invalid number type - "+e);return s&&(d=256),n=r.bigNumberify(n).toTwos(d),a.padZeros(n,d/8)}if(o=e.match(u)){var d=parseInt(o[1]);if(String(d)!=o[1]||0===d||32<d)throw new Error("invalid number type - "+e);if(a.arrayify(n).byteLength!==d)throw new Error("invalid value for "+e);return s?a.arrayify((n+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):n}if((o=e.match(A))&&Array.isArray(n)){var p=o[1];if(parseInt(o[2]||String(n.length))!=n.length)throw new Error("invalid value for "+e);var f=[];return n.forEach((function(e){f.push(t(p,e,!0))})),a.concat(f)}throw new Error("unknown type - "+e)}(t,e[s]))})),a.hexlify(a.concat(n))}n.pack=d,n.keccak256=function(t,e){return s.keccak256(d(t,e))},n.sha256=function(t,e){return o.sha256(d(t,e))}},{"./bignumber":63,"./bytes":64,"./keccak256":71,"./sha2":79,"./utf8":85}],83:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("../constants"),i=r(t("../errors")),s=t("./secp256k1"),o=t("./address"),u=t("./bignumber"),c=t("./bytes"),A=t("./keccak256"),d=t("./properties"),p=r(t("./rlp")),f=t("../providers/abstract-provider");function l(t){return"0x"===t?a.Zero:u.bigNumberify(t)}var h=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};n.serialize=function(t,e){d.checkProperties(t,y);var n=[];h.forEach((function(e){var r=t[e.name]||[];r=c.arrayify(c.hexlify(r)),e.length&&r.length!==e.length&&0<r.length&&i.throwError("invalid length for "+e.name,i.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:r}),e.maxLength&&(r=c.stripZeros(r)).length>e.maxLength&&i.throwError("invalid length for "+e.name,i.INVALID_ARGUMENT,{arg:"transaction"+e.name,value:r}),n.push(c.hexlify(r))})),null!=t.chainId&&0!==t.chainId&&(n.push(c.hexlify(t.chainId)),n.push("0x"),n.push("0x"));var r=p.encode(n);if(!e)return r;var a=c.splitSignature(e),s=27+a.recoveryParam;return 9===n.length&&(n.pop(),n.pop(),n.pop(),s+=2*t.chainId+8),n.push(c.hexlify(s)),n.push(c.stripZeros(c.arrayify(a.r))),n.push(c.stripZeros(c.arrayify(a.s))),p.encode(n)},n.parse=function(t){var e=p.decode(t);9!==e.length&&6!==e.length&&i.throwError("invalid raw transaction",i.INVALID_ARGUMENT,{arg:"rawTransactin",value:t});var n,r={nonce:l(e[0]).toNumber(),gasPrice:l(e[1]),gasLimit:l(e[2]),to:"0x"===(n=e[3])?null:o.getAddress(n),value:l(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=u.bigNumberify(e[6]).toNumber()}catch(t){return i.info(t),r}if(r.r=c.hexZeroPad(e[7],32),r.s=c.hexZeroPad(e[8],32),u.bigNumberify(r.r).isZero()&&u.bigNumberify(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var a=r.v-27,d=e.slice(0,6);0!==r.chainId&&(d.push(c.hexlify(r.chainId)),d.push("0x"),d.push("0x"),a-=2*r.chainId+8);var f=A.keccak256(p.encode(d));try{r.from=s.recoverAddress(f,{r:c.hexlify(r.r),s:c.hexlify(r.s),recoveryParam:a})}catch(t){i.info(t)}r.hash=A.keccak256(t)}return r},n.populateTransaction=function(t,e,n){f.Provider.isProvider(e)||i.throwError("missing provider",i.INVALID_ARGUMENT,{argument:"provider",value:e}),d.checkProperties(t,y);var r,a=d.shallowCopy(t);return null!=a.to&&(a.to=e.resolveName(a.to)),null==a.gasPrice&&(a.gasPrice=e.getGasPrice()),null==a.nonce&&(a.nonce=e.getTransactionCount(n)),null==a.gasLimit&&((r=d.shallowCopy(a)).from=n,a.gasLimit=e.estimateGas(r)),null==a.chainId&&(a.chainId=e.getNetwork().then((function(t){return t.chainId}))),d.resolveProperties(a)}},{"../constants":3,"../errors":5,"../providers/abstract-provider":50,"./address":60,"./bignumber":63,"./bytes":64,"./keccak256":71,"./properties":74,"./rlp":76,"./secp256k1":77}],84:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a,i=t("../constants"),s=r(t("../errors")),o=t("./bignumber"),u={};function c(t){return{decimals:t.length-1,tenPower:o.bigNumberify(t)}}function A(t){var e=u[String(t).toLowerCase()];if(!e&&"number"==typeof t&&parseInt(String(t))==t&&0<=t&&t<=256){for(var n="1",r=0;r<t;r++)n+="0";e=c(n)}return e||s.throwError("invalid unitType",s.INVALID_ARGUMENT,{argument:"name",value:t}),e}function d(t,e){var n=A(e),r=(t=o.bigNumberify(t)).lt(i.Zero);r&&(t=t.mul(i.NegativeOne));for(var a=t.mod(n.tenPower).toString();a.length<n.decimals;)a="0"+a;return a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1],t=t.div(n.tenPower).toString()+"."+a,r&&(t="-"+t),t}function p(t,e){null==e&&(e=18);var n=A(e);if("string"==typeof t&&t.match(/^-?[0-9.,]+$/)||s.throwError("invalid decimal value",s.INVALID_ARGUMENT,{arg:"value",value:t}),0===n.decimals)return o.bigNumberify(t);var r="-"===t.substring(0,1);r&&(t=t.substring(1)),"."===t&&s.throwError("missing value",s.INVALID_ARGUMENT,{arg:"value",value:t});var a=t.split(".");2<a.length&&s.throwError("too many decimal points",s.INVALID_ARGUMENT,{arg:"value",value:t});var u=a[0],c=a[1];for(u=u||"0",(c=c||"0").length>n.decimals&&s.throwError("underflow occurred",s.NUMERIC_FAULT,{operation:"division",fault:"underflow"});c.length<n.decimals;)c+="0";var d=o.bigNumberify(u),p=o.bigNumberify(c),f=d.mul(n.tenPower).add(p);return r&&(f=f.mul(i.NegativeOne)),f}a="1",["wei","kwei","Mwei","Gwei","szabo","finney","ether"].forEach((function(t){var e=c(a);u[t.toLowerCase()]=e,u[String(e.decimals)]=e,a+="000"})),n.commify=function(t){var e=String(t).split(".");(2<e.length||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&s.throwError("invalid value",s.INVALID_ARGUMENT,{argument:"value",value:t});var n=e[0],r="";for("-"===n.substring(0,1)&&(r="-",n=n.substring(1));"0"===n.substring(0,1);)n=n.substring(1);""===n&&(n="0");var a="";2===e.length&&(a="."+(e[1]||"0"));for(var i=[];n.length;){if(n.length<=3){i.unshift(n);break}var o=n.length-3;i.unshift(n.substring(o)),n=n.substring(0,o)}return r+i.join(",")+a},n.formatUnits=d,n.parseUnits=p,n.formatEther=function(t){return d(t,18)},n.parseEther=function(t){return p(t,18)}},{"../constants":3,"../errors":5,"./bignumber":63}],85:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,a,i=t("../constants"),s=t("../errors"),o=t("./bytes");function u(t,e){void 0===e&&(e=r.current),e!=r.current&&(s.checkNormalize(),t=t.normalize(e));for(var n=[],a=0;a<t.length;a++){var i=t.charCodeAt(a);if(i<128)n.push(i);else if(i<2048)n.push(i>>6|192),n.push(63&i|128);else if(55296==(64512&i)){a++;var u=t.charCodeAt(a);if(a>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");i=65536+((1023&i)<<10)+(1023&u),n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(63&i|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(63&i|128)}return o.arrayify(n)}function c(t,e){t=o.arrayify(t);for(var n="",r=0;r<t.length;){var a=t[r++];if(a>>7!=0){var i=null,s=null;if(192==(224&a))i=1,s=127;else if(224==(240&a))i=2,s=2047;else{if(240!=(248&a)){if(e)continue;if(128==(192&a))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}i=3,s=65535}if(r+i>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;r<t.length&&t[r]>>6==2;r++);}else{for(var u=a&(1<<8-i-1)-1,c=0;c<i;c++){var A=t[r];if(128!=(192&A)){u=null;break}u=u<<6|63&A,r++}if(null!==u)if(u<=s){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(1114111<u){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(55296<=u&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?n+=String.fromCharCode(u):(u-=65536,n+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else n+=String.fromCharCode(a)}return n}(a=r=n.UnicodeNormalizationForm||(n.UnicodeNormalizationForm={})).current="",a.NFC="NFC",a.NFD="NFD",a.NFKC="NFKC",a.NFKD="NFKD",n.toUtf8Bytes=u,n.toUtf8String=c,n.formatBytes32String=function(t){var e=u(t);if(31<e.length)throw new Error("bytes32 string must be less than 32 bytes");return o.hexlify(o.concat([e,i.HashZero]).slice(0,32))},n.parseBytes32String=function(t){var e=o.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var n=31;0===e[n-1];)n--;return c(e.slice(0,n))}},{"../constants":3,"../errors":5,"./bytes":64}],86:[function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var a=t("xmlhttprequest"),i=t("./base64"),s=t("./properties"),u=t("./utf8"),c=r(t("../errors"));n.fetchJson=function(t,e,n){var r,s={},A=null,d=12e4;if("string"==typeof t)A=t;else if("object"==o(t)){if(null==t.url&&c.throwError("missing URL",c.MISSING_ARGUMENT,{arg:"url"}),A=t.url,"number"==typeof t.timeout&&0<t.timeout&&(d=t.timeout),t.headers)for(var p in t.headers)s[p.toLowerCase()]={key:p,value:String(t.headers[p])};null!=t.user&&null!=t.password&&("https:"!==A.substring(0,6)&&!0!==t.allowInsecure&&c.throwError("basic authentication requires a secure https url",c.INVALID_ARGUMENT,{arg:"url",url:A,user:t.user,password:"[REDACTED]"}),r=t.user+":"+t.password,s.authorization={key:"Authorization",value:"Basic "+i.encode(u.toUtf8Bytes(r))})}return new Promise((function(t,r){function i(){null!=u&&(clearTimeout(u),u=null)}var o=new a.XMLHttpRequest,u=null;u=setTimeout((function(){null!=u&&(u=null,r(new Error("timeout")),setTimeout((function(){o.abort()}),0))}),d),e?(o.open("POST",A,!0),s["content-type"]={key:"Content-Type",value:"application/json"}):o.open("GET",A,!0),Object.keys(s).forEach((function(t){var e=s[t];o.setRequestHeader(e.key,e.value)})),o.onreadystatechange=function(){if(4===o.readyState){if(200!=o.status){i();var a=new Error("invalid response - "+o.status);return a.statusCode=o.status,o.responseText&&(a.responseText=o.responseText),void r(a)}var s=null;try{s=JSON.parse(o.responseText)}catch(a){i();var u=new Error("invalid json response");return u.orginialError=a,u.responseText=o.responseText,null!=e&&(u.requestBody=e),u.url=A,void r(u)}if(n)try{s=n(s)}catch(a){return i(),a.url=A,a.body=e,a.responseText=o.responseText,void r(a)}i(),t(s)}},o.onerror=function(t){i(),r(t)};try{null!=e?o.send(e):o.send()}catch(u){i();var c=new Error("connection error");c.error=u,r(c)}}))},n.poll=function(t,e){return e=e||{},null==(e=s.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(n,r){var a=null,i=!1,s=function(){return!i&&(i=!0,a&&clearTimeout(a),!0)};e.timeout&&(a=setTimeout((function(){s()&&r(new Error("timeout"))}),e.timeout));var o=e.fastRetry||null,u=0;!function a(){return t().then((function(t){var r;return void 0!==t?s()&&n(t):e.onceBlock?e.onceBlock.once("block",a):i||(u++,(r=e.interval*parseInt(String(Math.random()*Math.pow(2,u))))<e.floor&&(r=e.floor),r>e.ceiling&&(r=e.ceiling),o&&(u--,r=o,o=null),setTimeout(a,r)),null}),(function(t){s()&&r(t)}))}()}))}},{"../errors":5,"./base64":61,"./properties":74,"./utf8":85,xmlhttprequest:49}],87:[function(t,e,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/hash"),a=t("../utils/properties");r.check=function(t){for(var e=[],r=0;r<2048;r++){var a=t.getWord(r);if(r!==t.getWordIndex(a))return"0x";e.push(a)}return n.id(e.join("\n")+"\n")};var i=(s.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},s.prototype.join=function(t){return t.join(" ")},s);function s(t){a.defineReadOnly(this,"locale",t)}r.Wordlist=i,r.register=function(t,e){e=e||t.locale}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/hash":65,"../utils/properties":74}],88:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var s,o=t("./utils/bytes"),u=t("./utils/hash"),c=t("./utils/hdnode"),A=t("./utils/json-wallet"),d=t("./utils/keccak256"),p=t("./utils/properties"),f=t("./utils/random-bytes"),l=i(t("./utils/secret-storage")),h=t("./utils/signing-key"),y=t("./utils/transaction"),g=t("./abstract-signer"),b=t("./providers/abstract-provider"),m=i(t("./errors")),I=(a(C,s=g.Signer),Object.defineProperty(C.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"path",{get:function(){return this.signingKey.path},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),C.prototype.connect=function(t){return b.Provider.isProvider(t)||m.throwError("invalid provider",m.INVALID_ARGUMENT,{argument:"provider",value:t}),new C(this.signingKey,t)},C.prototype.getAddress=function(){return Promise.resolve(this.address)},C.prototype.sign=function(t){var e=this;return p.resolveProperties(t).then((function(t){var n=y.serialize(t),r=e.signingKey.signDigest(d.keccak256(n));return y.serialize(t,r)}))},C.prototype.signMessage=function(t){return Promise.resolve(o.joinSignature(this.signingKey.signDigest(u.hashMessage(t))))},C.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},C.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},C.prototype.sendTransaction=function(t){var e=this;if(!this.provider)throw new Error("missing provider");return null==t.nonce&&((t=p.shallowCopy(t)).nonce=this.getTransactionCount("pending")),y.populateTransaction(t,this.provider,this.address).then((function(t){return e.sign(t).then((function(t){return e.provider.sendTransaction(t)}))}))},C.prototype.encrypt=function(t,e,n){if("function"!=typeof e||n||(n=e,e={}),n&&"function"!=typeof n)throw new Error("invalid callback");return e=e||{},this.mnemonic&&((e=p.shallowCopy(e)).mnemonic=this.mnemonic,e.path=this.path),l.encrypt(this.privateKey,t,e,n)},C.createRandom=function(t){var e=f.randomBytes(16);(t=t||{}).extraEntropy&&(e=o.arrayify(d.keccak256(o.concat([e,t.extraEntropy])).substring(0,34)));var n=c.entropyToMnemonic(e,t.locale);return C.fromMnemonic(n,t.path,t.locale)},C.fromEncryptedJson=function(t,e,n){if(A.isCrowdsaleWallet(t))try{n&&n(0);var r=l.decryptCrowdsale(t,e);return n&&n(1),Promise.resolve(new C(r))}catch(t){return Promise.reject(t)}else if(A.isSecretStorageWallet(t))return l.decrypt(t,e,n).then((function(t){return new C(t)}));return Promise.reject("invalid wallet JSON")},C.fromMnemonic=function(t,e,n){return e=e||c.defaultPath,new C(c.fromMnemonic(t,n).derivePath(e))},C);function C(t,e){var n=s.call(this)||this;return m.checkNew(n,C),h.SigningKey.isSigningKey(t)?p.defineReadOnly(n,"signingKey",t):p.defineReadOnly(n,"signingKey",new h.SigningKey(t)),p.defineReadOnly(n,"provider",e),n}n.Wallet=I},{"./abstract-signer":2,"./errors":5,"./providers/abstract-provider":50,"./utils/bytes":64,"./utils/hash":65,"./utils/hdnode":66,"./utils/json-wallet":70,"./utils/keccak256":71,"./utils/properties":74,"./utils/random-bytes":75,"./utils/secret-storage":78,"./utils/signing-key":81,"./utils/transaction":83}],89:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../wordlists/lang-en").langEn;n.en=r},{"../wordlists/lang-en":90}],90:[function(t,e,n){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var i,s=t("../utils/wordlist"),o=null;function u(t){if(null==o&&(o="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==s.check(t)))throw o=null,new Error("BIP39 Wordlist for en (English) FAILED")}function c(){return i.call(this,"en")||this}var A=new(a(c,i=s.Wordlist),c.prototype.getWord=function(t){return u(this),o[t]},c.prototype.getWordIndex=function(t){return u(this),o.indexOf(t)},c);n.langEn=A,s.register(A)},{"../utils/wordlist":87}]},{},[7])(7)},"object"==o(e)&&void 0!==t?t.exports=s():(a=[],void 0===(i="function"==typeof(r=s)?r.apply(e,a):r)||(t.exports=i))}).call(this,n(5))},function(t,e,n){(function(e,r){var a=n(23),i=n(4),s=n(7),o=n(156),u=this;function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}void 0===e&&(e=n(2).Buffer);var A=n(81),d=n(161).default,p=n(162),f=n(52),l=n(82),h=n(14).utils,y=h.keccak256,g=h.getAddress,b={name:"Utils",nullAddress:"0x0000000000000000000000000000000000000000",weiPerEther:new d("1000000000000000000"),ToBigNumber:function(t){return new d(t)},WeiToEther:function(t){return b.ToBigNumber(t).div(b.weiPerEther)},EtherToWei:function(t){return b.ToBigNumber(t).times(b.weiPerEther)},FormatAddress:function(t){return t&&"string"==typeof t?((t=t.trim()).startsWith("0x")||(t="0x"+t),t.toLowerCase()):""},FormatSignature:function(t){return t=t.replace("0x",""),"ES256K_"+A.encode(e.from(t,"hex"))},DecodeVersionHash:function(t){if(!t.startsWith("hq__")&&!t.startsWith("tq__"))throw new Error('Invalid version hash: "'.concat(t,'"'));t=t.slice(4);var n=b.FromB58(t),r=n.slice(0,32),a=r.toString("hex");n=n.slice(32);for(var i=0;n[i]>=128;)i++;i++;var s=n.slice(0,i),o=p.decode(s);return n=n.slice(i),{digest:a,size:o,objectId:"iq__"+b.B58(n),partHash:"hqp_"+b.B58(e.concat([r,s]))}},DecodeSignedToken:function(t){var n=b.FromB58(t.slice(6)),r="0x".concat(n.slice(0,65).toString("hex")),a=JSON.parse(e.from(l.inflateRaw(n.slice(65))).toString("utf-8"));return a.adr=b.FormatAddress("0x".concat(e.from(a.adr,"base64").toString("hex"))),{payload:a,signature:r}},DecodeWriteToken:function(t){if(t.length<4)throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'));var e;if(t.startsWith("tqw__")?(e="tq__",t=t.slice(5)):(e=t.slice(0,4),t=t.slice(4)),0===t.length)throw new Error('Invalid write token: ["'.concat(t,'"] (too short)'));switch(e){case"tqw_":case"tq__":case"tqpw":case"tqp_":case"tlro":break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}var n,r,a,i,s,o=b.FromB58(t);function u(t,e){var n,r,a=p.decode(o,0),i=p.decode.bytes;return r=t?0===(n=o.slice(i+1,a+i)).length?"":e+b.B58(n):"0x"+(n=o.slice(i,a+i)).toString("hex"),o=o.slice(a+i),r}switch(e){case"tqw_":case"tqpw":n="0x"+o.toString("hex");break;case"tlro":case"tq__":r=u(!0,"iq__"),a=u(!0,"inod"),n=u(!1,"");break;case"tqp_":if(o.length<3)throw new Error('Invalid write token: ["'.concat(t,'"] (token truncated)'));i=o[0],s=o[1],o=o.slice(2),n=u(!1,"");break;default:throw new Error('Invalid write token: ["'.concat(t,'"] (unknown prefix)'))}return{tokenType:e,tokenId:n,objectId:r,nodeId:a,scheme:i,flags:s}},AddressToHash:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t.replace(n?"0x04":"0x",""),A.encode(e.from(t,"hex"))},AddressToSpaceId:function(t){return"ispc"+b.AddressToHash(t)},AddressToLibraryId:function(t){return"ilib"+b.AddressToHash(t)},AddressToObjectId:function(t){return"iq__"+b.AddressToHash(t)},HashToAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e?t:t.substr(4),b.FormatAddress((e?"0x04":"0x")+A.decode(t).toString("hex"))},EqualAddress:function(t,e){return!(!t||!e)&&b.FormatAddress(t)===b.FormatAddress(e)},EqualHash:function(t,e){return!(!t||!e)&&(!(t.length<=4||e.length<=4)&&b.HashToAddress(t)===b.HashToAddress(e))},ValidAddress:function(t){try{return g(t),!0}catch(t){return u.Log(t),!1}},ValidHash:function(t){return b.ValidAddress(b.HashToAddress(t))},ToBytes32:function(t){return"0x"+t.split("").map((function(t){return t.charCodeAt(0).toString(16)})).join("").slice(0,64).padEnd(64,"0")},BufferToArrayBuffer:function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)},B64:function(t){return e.from(t,"utf-8").toString("base64")},FromB64:function(t){return e.from(t,"base64").toString("utf-8")},B58:function(t){return A.encode(e.from(t))},FromB58:function(t){return A.decode(t)},DecodeAuthorizationToken:function(t){var e=(t=decodeURIComponent(t)).split("."),n=o(e,2),r=n[0],a=n[1];return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},r=JSON.parse(b.FromB64(r)),{signature:a})},LimitedMap:function(t,e,n){var r,s,o,u,c;return i.async((function(A){for(;;)switch(A.prev=A.next){case 0:return r=0,s=!1,o=function(){var t;return i.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s){e.next=5;break}return e.next=3,i.awrap(new Promise((function(t){return setTimeout(t,10)})));case 3:e.next=0;break;case 5:return s=!0,t=r,r+=1,s=!1,e.abrupt("return",t);case 10:case"end":return e.stop()}}))},u=[],c=0,A.abrupt("return",new Promise((function(r,s){a(Array(t||1)).forEach((function(){var t;return i.async((function(a){for(;;)switch(a.prev=a.next){case 0:return c+=1,a.next=3,i.awrap(o());case 3:t=a.sent;case 4:if(!(t<e.length)){a.next=19;break}return a.prev=5,a.next=8,i.awrap(n(e[t],t));case 8:u[t]=a.sent,a.next=14;break;case 11:a.prev=11,a.t0=a.catch(5),s(a.t0);case 14:return a.next=16,i.awrap(o());case 16:t=a.sent,a.next=4;break;case 19:0===(c-=1)&&r(u);case 21:case"end":return a.stop()}}),null,null,[[5,11]])}))})));case 6:case"end":return A.stop()}}))},ResponseToJson:function(t){return i.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",b.ResponseToFormat("json",t));case 1:case"end":return e.stop()}}))},ResponseToFormat:function(t,e){return i.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.awrap(e);case 2:e=n.sent,n.t0=t.toLowerCase(),n.next="json"===n.t0?6:"text"===n.t0?9:"blob"===n.t0?12:"arraybuffer"===n.t0?15:"formdata"===n.t0?18:"buffer"===n.t0?21:24;break;case 6:return n.next=8,i.awrap(e.json());case 8:return n.abrupt("return",n.sent);case 9:return n.next=11,i.awrap(e.text());case 11:return n.abrupt("return",n.sent);case 12:return n.next=14,i.awrap(e.blob());case 14:return n.abrupt("return",n.sent);case 15:return n.next=17,i.awrap(e.arrayBuffer());case 17:return n.abrupt("return",n.sent);case 18:return n.next=20,i.awrap(e.formData());case 20:return n.abrupt("return",n.sent);case 21:return n.next=23,i.awrap(e.buffer());case 23:return n.abrupt("return",n.sent);case 24:return n.abrupt("return",e);case 25:case"end":return n.stop()}}))},ResizeImage:function(t){var e=t.imageUrl,n=t.height;return!e||e&&!e.startsWith("http")?e:(e=f(e).removeSearch("height").removeSearch("header-x_image_height"),n&&!isNaN(parseInt(n))&&e.addSearch("height",parseInt(n)),e.toString())},SafeTraverse:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(!t)return t;1===n.length&&Array.isArray(n[0])&&(n=n[0]);for(var a=t,i=0;i<n.length;i++)if(void 0===(a=a[n[i]]))return;return a},IsCloneable:function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return b.IsCloneable(t[e])}));case"Map":return a(t.keys()).every(b.IsCloneable)&&a(t.values()).every(b.IsCloneable);case"Set":return a(t.keys()).every(b.IsCloneable);default:return!1}},MakeClonable:function(t){if(b.IsCloneable(t))return t;if(e.isBuffer(t))return b.BufferToArrayBuffer(t);switch({}.toString.call(t).slice(8,-1)){case"Response":case"Function":return;case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return t;case"Array":return t.map((function(t){return b.MakeClonable(t)}));case"Set":return new Set(Array.from(t.keys()).map((function(t){return b.MakeClonable(t)})));case"Map":var n=new Map;return Array.from(t.keys()).forEach((function(e){var r=b.MakeClonable(t.get(e));r&&n.set(e,r)})),n;case"Error":return t.message;case"Object":var r={};return Object.keys(t).map((function(e){var n=b.MakeClonable(t[e]);n&&(r[e]=n)})),r;default:return JSON.parse(JSON.stringify(t))}},PublicKeyToAddress:function(t){var n=new Uint8Array(e.from(t.replace("0x04",""),"hex")),r="0x"+y(n).slice(26);return b.FormatAddress(r)},PLATFORM_NODE:"node",PLATFORM_WEB:"web",PLATFORM_REACT_NATIVE:"react-native",Platform:function(){return"undefined"!=typeof navigator&&"ReactNative"===navigator.product?b.PLATFORM_REACT_NATIVE:void 0!==r&&void 0!==r.versions&&void 0!==r.versions.node?b.PLATFORM_NODE:b.PLATFORM_WEB}};t.exports=b}).call(this,n(2).Buffer,n(6))},function(t,e,n){var r,a,i;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}i=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var n=t.shift();t[0]=n+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<t.length;r++){var a=t[r];if("string"!=typeof a)throw new TypeError("Url must be a string. Received "+a);""!==a&&(r>0&&(a=a.replace(/^[\/]+/,"")),a=r<t.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),e.push(a))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i=s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"===s(arguments[0])?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=i():void 0===(a="function"==typeof(r=i)?r.call(e,n,e,t):r)||(t.exports=a)},function(t,e,n){var r=n(15);e.ValidatePresence=function(t,e){if(!e)throw Error("".concat(t," not specified"))},e.ValidateLibrary=function(t){if(!t)throw Error("Library ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid library ID: ".concat(t))},e.ValidateObject=function(t){if(!t)throw Error("Object ID not specified");if(!t.toString().startsWith("i"))throw Error("Invalid object ID: ".concat(t))},e.ValidateVersion=function(t){if(!t)throw Error("Version hash not specified");if(!t.toString().startsWith("h"))throw Error("Invalid version hash: ".concat(t))},e.ValidateWriteToken=function(t){if(!t)throw Error("Write token not specified");if(!t.toString().startsWith("t"))throw Error("Invalid write token: ".concat(t))},e.ValidatePartHash=function(t){if(!t)throw Error("Part hash not specified");if(!t.toString().startsWith("hqp_")&&!t.toString().startsWith("hqpe"))throw Error("Invalid part hash: ".concat(t))},e.ValidateParameters=function(t){var n=t.libraryId,r=t.objectId,a=t.versionHash;a?e.ValidateVersion(a):(e.ValidateLibrary(n),e.ValidateObject(r))},e.ValidateAddress=function(t){if(!t)throw Error("Address not specified");if(!/^(0x)?[0-9a-f]{40}$/i.test(t.toLowerCase()))throw Error("Invalid address: ".concat(t));return r.FormatAddress(t)},e.ValidatePermission=function(t){if(t&&"full-access"!==t&&"no-access"!==t)throw Error("Invalid profile permission: ".concat(t));return t},e.ValidateDate=function(t){if(t){if(isNaN(new Date(t)))throw Error("Invalid date: ".concat(t));return new Date(t).getTime()}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e,n){var r=n(1).Buffer,a=n(45).Transform,i=n(34).StringDecoder;function s(t){a.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(0)(s,a),s.prototype.update=function(t,e,n){"string"==typeof t&&(t=r.from(t,e));var a=this._update(t);return this.hashMode?this:(n&&(a=this._toString(a,n)),a)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,n){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{n(r)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new i(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return n&&(r+=this._decoder.end()),r},t.exports=s},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";var r=n(46),a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=d;var i=n(33);i.inherits=n(0);var s=n(101),o=n(60);i.inherits(d,s);for(var u=a(o.prototype),c=0;c<u.length;c++){var A=u[c];d.prototype[A]||(d.prototype[A]=o.prototype[A])}function d(t){if(!(this instanceof d))return new d(t);s.call(this,t),o.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),d.prototype._destroy=function(t,e){this.push(null),this.end(),r.nextTick(e,t)}},function(t,e,n){"use strict";(function(e,r){var a=n(1).Buffer,i=e.crypto||e.msCrypto;i&&i.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s<t;s+=65536)i.getRandomValues(n.slice(s,s+65536));else i.getRandomValues(n);if("function"==typeof e)return r.nextTick((function(){e(null,n)}));return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(5),n(6))},function(t,e,n){var r=n(151),a=n(152),i=n(153);t.exports=function(t){return r(t)||a(t)||i()}},function(t,e,n){var r=n(4),a=n(12),i=n(13),s=n(52),o="undefined"!=typeof fetch?fetch:n(53).default,u=n(30).LogMessage,c=function(){"use strict";function t(e){var n=e.uris,r=e.debug;a(this,t),this.uris=n,this.uriIndex=0,this.debug=r,this.draftURIs={}}return i(t,[{key:"Log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u(this,t,e)}}]),i(t,[{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(t){this.draftURIs[t]=this.BaseURI()}},{key:"RequestHeaders",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.Accept||(e.Accept="application/json"),"JSON"===t?e["Content-type"]="application/json":"BINARY"===t&&(e["Content-type"]="application/octet-stream"),e}},{key:"Request",value:function(e){var n,a,i,s,o,u,c,A,d,p,f,l,h,y,g,b,m,I,C,v,w,E,B,Q;return r.async((function(M){for(;;)switch(M.prev=M.next){case 0:return n=e.method,a=e.path,i=e.queryParams,s=void 0===i?{}:i,o=e.body,u=e.bodyType,c=void 0===u?"JSON":u,A=e.headers,d=void 0===A?{}:A,p=e.attempts,f=void 0===p?0:p,l=e.failover,h=void 0===l||l,y=e.forceFailover,g=void 0!==y&&y,b=this.BaseURI(),m=a.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw_[a-zA-Z0-9]+)/),(I=m?m[2]:void 0)&&(this.draftURIs[I]?b=this.draftURIs[I]:this.draftURIs[I]=b),C=b.path(a).query(s).hash(""),v={method:n,headers:this.RequestHeaders(c,d)},"POST"!==n&&"PUT"!==n&&"DELETE"!==n||(o&&"JSON"===c?v.body=JSON.stringify(o):o&&(v.body=o)),M.prev=8,M.next=11,r.awrap(t.Fetch(C.toString(),v));case 11:w=M.sent,M.next=17;break;case 14:M.prev=14,M.t0=M.catch(8),w={ok:!1,status:500,statusText:"ElvClient Error: "+M.t0.message,url:C.toString(),stack:M.t0.stack};case 17:if(w.ok){M.next=40;break}if(!(!I&&(h&&parseInt(w.status)>=500||g)&&f<this.uris.length)){M.next=24;break}return this.Log("HttpClient failing over from ".concat(this.BaseURI(),": ").concat(f+1," attempts"),!0),this.uriIndex=(this.uriIndex+1)%this.uris.length,M.next=23,r.awrap(this.Request({method:n,path:a,queryParams:s,body:o,bodyType:c,headers:d,attempts:f+1,forceFailover:g}));case 23:return M.abrupt("return",M.sent);case 24:if(E=w.headers&&w.headers.get("content-type")||"",B="",!w.text||!w.json){M.next=37;break}if(!E.includes("application/json")){M.next=33;break}return M.next=30,r.awrap(w.json());case 30:M.t1=M.sent,M.next=36;break;case 33:return M.next=35,r.awrap(w.text());case 35:M.t1=M.sent;case 36:B=M.t1;case 37:throw Q={name:"ElvHttpClientError",status:w.status,statusText:w.statusText,message:w.statusText,url:C.toString(),body:B,requestParams:v},this.Log(JSON.stringify(Q,null,2),!0),Q;case 40:return this.Log("".concat(w.status," - ").concat(n," ").concat(C.toString())),M.abrupt("return",w);case 42:case"end":return M.stop()}}),null,this,[[8,14]])}},{key:"URL",value:function(t){var e=t.path,n=t.queryParams,r=void 0===n?{}:n;return this.BaseURI().path(e).query(r).hash("").toString()}}],[{key:"Fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(t,e)}}]),t}();t.exports=c},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=n(87),i="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,s=a||i||Function("return this")();t.exports=s},function(t,e,n){"use strict";var r=n(0),a=n(61),i=n(62),s=n(63),o=n(19);function u(t){o.call(this,"digest"),this._hash=t}r(u,o),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new a:"rmd160"===t||"ripemd160"===t?new i:new u(s(t))}},function(t,e,n){var r=n(1).Buffer;function a(t,e){this._block=r.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=r.from(t,e));for(var n=this._block,a=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var u=s%a,c=Math.min(i-o,a-u),A=0;A<c;A++)n[u+A]=t[o+A];o+=c,(s+=c)%a==0&&this._update(n)}return this._len+=i,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,a=(n-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return t?i.toString(t):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a={};function i(t,e,n){n||(n=Error);var r=function(t){var n,r;function a(n,r,a){return t.call(this,function(t,n,r){return"string"==typeof e?e:e(t,n,r)}(n,r,a))||this}return r=t,(n=a).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,a}(n);r.prototype.name=n.name,r.prototype.code=t,a[t]=r}function s(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var a,i,o,u;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(a="must not be",e=e.replace(/^not /,"")):a="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))u="The ".concat(t," ").concat(a," ").concat(s(e,"type"));else{var c=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(c," ").concat(a," ").concat(s(e,"type"))}return u+=". Received type ".concat(r(n))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=a},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var a=n(144),i=n(148);n(0)(c,a);for(var s=r(i.prototype),o=0;o<s.length;o++){var u=s[o];c.prototype[u]||(c.prototype[u]=i.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);a.call(this,t),i.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",A)))}function A(){this._writableState.ended||e.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this,n(6))},function(t,e,n){var r=n(18),a=function(t,e){return"object"===r(e)&&"function"==typeof e[t]?e[t]:null},i=function(t){return"object"===r(t)?JSON.stringify(t):t};t.exports={LogMessage:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.debug){var r=a("log",t.debugOptions),s=a("error",t.debugOptions),o="(elv-client-js#".concat(t.constructor.name,")"),u="\n".concat(o," ").concat(i(e),"\n");n?s?s(o,e):console.error(u):r?r(o,e):console.log(u)}}}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==n(t)}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a,i="object"===("undefined"==typeof Reflect?"undefined":r(Reflect))?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};a=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function A(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function d(t,e,n,a){var i,s,o,u;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(n));if(void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),void 0===o)o=s[e]=n,++t._eventsCount;else if("function"==typeof o?o=s[e]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),(i=A(t))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function p(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,t))}function f(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=p.bind(r);return a.listener=n,r.wrapFn=a,a}function l(t,e,n){var r=t._events;if(void 0===r)return[];var a=r[e];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(a):y(a,a.length)}function h(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return A(this)},u.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,a=this._events;if(void 0!==a)r=r&&void 0===a.error;else if(!r)return!1;if(r){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var u=a[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var c=u.length,A=y(u,c);for(n=0;n<c;++n)s(A[n],this,e)}return!0},u.prototype.addListener=function(t,e){return d(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return d(this,t,e,!0)},u.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));return this.on(t,f(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));return this.prependListener(t,f(this,t,e)),this},u.prototype.removeListener=function(t,e){var n,a,i,s,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e));if(void 0===(a=this._events))return this;if(void 0===(n=a[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(a[t]=n[0]),void 0!==a.removeListener&&this.emit("removeListener",t,o||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var a,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(a=i[r])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return l(this,t,!0)},u.prototype.rawListeners=function(t){return l(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):h.call(t,e)},u.prototype.listenerCount=h,u.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(t,e,n){(function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"===n(t)&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=t.isBuffer}).call(this,n(2).Buffer)},function(t,e,n){"use strict";var r=n(1).Buffer,a=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=A,this.end=d,e=3;break;default:return this.write=p,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function A(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function d(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=i,i.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},i.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},i.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var a=s(e[r]);if(a>=0)return a>0&&(t.lastNeed=a-1),a;if(--r<n||-2===a)return 0;if((a=s(e[r]))>=0)return a>0&&(t.lastNeed=a-2),a;if(--r<n||-2===a)return 0;if((a=s(e[r]))>=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){(function(e){t.exports=function(t,n){for(var r=Math.min(t.length,n.length),a=new e(r),i=0;i<r;++i)a[i]=t[i]^n[i];return a}}).call(this,n(2).Buffer)},function(t,e,n){"use strict";var r=n(11),a=n(8);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this},i.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},i.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var a=1;a<n;a++)r[a]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[a++]=0;r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=t>>>24&255,r[a++]=t>>>16&255,r[a++]=t>>>8&255,r[a++]=255&t}else for(r[a++]=255&t,r[a++]=t>>>8&255,r[a++]=t>>>16&255,r[a++]=t>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i<this.padLength;i++)r[a++]=0;return r}},function(t,e,n){var r=e;r.bignum=n(3),r.define=n(317).define,r.base=n(38),r.constants=n(133),r.decoders=n(322),r.encoders=n(324)},function(t,e,n){var r=e;r.Reporter=n(319).Reporter,r.DecoderBuffer=n(132).DecoderBuffer,r.EncoderBuffer=n(132).EncoderBuffer,r.Node=n(320)},function(t,e,n){var r=n(191),a=n(192),i=n(193),s=n(194),o=n(195);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=a,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,t.exports=u},function(t,e,n){var r=n(41);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(86),a=n(202),i=n(203),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?a(t):i(t)}},function(t,e,n){var r=n(54)(Object,"create");t.exports=r},function(t,e,n){var r=n(217);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){t.exports=a;var r=n(32).EventEmitter;function a(){r.call(this)}n(0)(a,r),a.Readable=n(58),a.Writable=n(268),a.Duplex=n(269),a.Transform=n(270),a.PassThrough=n(271),a.Stream=a,a.prototype.pipe=function(t,e){var n=this;function a(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",a),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",o),n.on("close",u));var s=!1;function o(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(A(),0===r.listenerCount(this,"error"))throw t}function A(){n.removeListener("data",a),t.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",u),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",A),n.removeListener("close",A),t.removeListener("close",A)}return n.on("error",c),t.on("error",c),n.on("end",A),n.on("close",A),t.on("close",A),t.emit("pipe",n),t}},function(t,e,n){"use strict";(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,a){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,a)}));default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return e.nextTick((function(){t.apply(null,i)}))}}}:t.exports=e}).call(this,n(6))},function(t,e,n){var r=n(1).Buffer;function a(t){r.isBuffer(t)||(t=r.from(t));for(var e=t.length/4|0,n=new Array(e),a=0;a<e;a++)n[a]=t.readUInt32BE(4*a);return n}function i(t){for(;0<t.length;t++)t[0]=0}function s(t,e,n,r,a){for(var i,s,o,u,c=n[0],A=n[1],d=n[2],p=n[3],f=t[0]^e[0],l=t[1]^e[1],h=t[2]^e[2],y=t[3]^e[3],g=4,b=1;b<a;b++)i=c[f>>>24]^A[l>>>16&255]^d[h>>>8&255]^p[255&y]^e[g++],s=c[l>>>24]^A[h>>>16&255]^d[y>>>8&255]^p[255&f]^e[g++],o=c[h>>>24]^A[y>>>16&255]^d[f>>>8&255]^p[255&l]^e[g++],u=c[y>>>24]^A[f>>>16&255]^d[l>>>8&255]^p[255&h]^e[g++],f=i,l=s,h=o,y=u;return i=(r[f>>>24]<<24|r[l>>>16&255]<<16|r[h>>>8&255]<<8|r[255&y])^e[g++],s=(r[l>>>24]<<24|r[h>>>16&255]<<16|r[y>>>8&255]<<8|r[255&f])^e[g++],o=(r[h>>>24]<<24|r[y>>>16&255]<<16|r[f>>>8&255]<<8|r[255&l])^e[g++],u=(r[y>>>24]<<24|r[f>>>16&255]<<16|r[l>>>8&255]<<8|r[255&h])^e[g++],[i>>>=0,s>>>=0,o>>>=0,u>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var n=[],r=[],a=[[],[],[],[]],i=[[],[],[],[]],s=0,o=0,u=0;u<256;++u){var c=o^o<<1^o<<2^o<<3^o<<4;c=c>>>8^255&c^99,n[s]=c,r[c]=s;var A=t[s],d=t[A],p=t[d],f=257*t[c]^16843008*c;a[0][s]=f<<24|f>>>8,a[1][s]=f<<16|f>>>16,a[2][s]=f<<8|f>>>24,a[3][s]=f,f=16843009*p^65537*d^257*A^16843008*s,i[0][c]=f<<24|f>>>8,i[1][c]=f<<16|f>>>16,i[2][c]=f<<8|f>>>24,i[3][c]=f,0===s?s=o=1:(s=A^t[t[t[p^A]]],o^=t[t[o]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:a,INV_SUB_MIX:i}}();function c(t){this._key=a(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,n=e+6,r=4*(n+1),a=[],i=0;i<e;i++)a[i]=t[i];for(i=e;i<r;i++){var s=a[i-1];i%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=o[i/e|0]<<24):e>6&&i%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),a[i]=a[i-e]^s}for(var c=[],A=0;A<r;A++){var d=r-A,p=a[d-(A%4?0:4)];c[A]=A<4||d<=4?p:u.INV_SUB_MIX[0][u.SBOX[p>>>24]]^u.INV_SUB_MIX[1][u.SBOX[p>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[p>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&p]]}this._nRounds=n,this._keySchedule=a,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return s(t=a(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),n=r.allocUnsafe(16);return n.writeUInt32BE(e[0],0),n.writeUInt32BE(e[1],4),n.writeUInt32BE(e[2],8),n.writeUInt32BE(e[3],12),n},c.prototype.decryptBlock=function(t){var e=(t=a(t))[1];t[1]=t[3],t[3]=e;var n=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},c.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=c},function(t,e,n){var r=n(1).Buffer,a=n(61);t.exports=function(t,e,n,i){if(r.isBuffer(t)||(t=r.from(t,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=n/8,o=r.alloc(s),u=r.alloc(i||0),c=r.alloc(0);s>0||i>0;){var A=new a;A.update(c),A.update(t),e&&A.update(e),c=A.digest();var d=0;if(s>0){var p=o.length-s;d=Math.min(s,c.length),c.copy(o,p,0,d),s-=d}if(d<c.length&&i>0){var f=u.length-i,l=Math.min(i,c.length-d);c.copy(u,f,d,d+l),i-=l}}return c.fill(0),{key:o,iv:u}}},function(t,e,n){"use strict";var r=n(3),a=n(9),i=a.getNAF,s=a.getJSF,o=a.assert;function u(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){o(t.precomputed);var n=t._getDoubles(),r=i(e,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;var s,u,c=[];for(s=0;s<r.length;s+=n.step){u=0;for(var A=s+n.step-1;A>=s;A--)u=(u<<1)+r[A];c.push(u)}for(var d=this.jpoint(null,null,null),p=this.jpoint(null,null,null),f=a;f>0;f--){for(s=0;s<c.length;s++)(u=c[s])===f?p=p.mixedAdd(n.points[s]):u===-f&&(p=p.mixedAdd(n.points[s].neg()));d=d.add(p)}return d.toP()},u.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var a=r.points,s=i(e,n,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var A=0;c>=0&&0===s[c];c--)A++;if(c>=0&&A++,u=u.dblp(A),c<0)break;var d=s[c];o(0!==d),u="affine"===t.type?d>0?u.mixedAdd(a[d-1>>1]):u.mixedAdd(a[-d-1>>1].neg()):d>0?u.add(a[d-1>>1]):u.add(a[-d-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,n,r,a){var o,u,c,A=this._wnafT1,d=this._wnafT2,p=this._wnafT3,f=0;for(o=0;o<r;o++){var l=(c=e[o])._getNAFPoints(t);A[o]=l.wnd,d[o]=l.points}for(o=r-1;o>=1;o-=2){var h=o-1,y=o;if(1===A[h]&&1===A[y]){var g=[e[h],null,null,e[y]];0===e[h].y.cmp(e[y].y)?(g[1]=e[h].add(e[y]),g[2]=e[h].toJ().mixedAdd(e[y].neg())):0===e[h].y.cmp(e[y].y.redNeg())?(g[1]=e[h].toJ().mixedAdd(e[y]),g[2]=e[h].add(e[y].neg())):(g[1]=e[h].toJ().mixedAdd(e[y]),g[2]=e[h].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],m=s(n[h],n[y]);for(f=Math.max(m[0].length,f),p[h]=new Array(f),p[y]=new Array(f),u=0;u<f;u++){var I=0|m[0][u],C=0|m[1][u];p[h][u]=b[3*(I+1)+(C+1)],p[y][u]=0,d[h]=g}}else p[h]=i(n[h],A[h],this._bitLength),p[y]=i(n[y],A[y],this._bitLength),f=Math.max(p[h].length,f),f=Math.max(p[y].length,f)}var v=this.jpoint(null,null,null),w=this._wnafT4;for(o=f;o>=0;o--){for(var E=0;o>=0;){var B=!0;for(u=0;u<r;u++)w[u]=0|p[u][o],0!==w[u]&&(B=!1);if(!B)break;E++,o--}if(o>=0&&E++,v=v.dblp(E),o<0)break;for(u=0;u<r;u++){var Q=w[u];0!==Q&&(Q>0?c=d[u][Q-1>>1]:Q<0&&(c=d[u][-Q-1>>1].neg()),v="affine"===c.type?v.mixedAdd(c):v.add(c))}}for(o=0;o<r;o++)d[o]=null;return a?v:v.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=a.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?o(t[t.length-1]%2==0):7===t[0]&&o(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return a.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,a=0;a<e;a+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),a=1;a<n;a++)e[a]=e[a-1].add(r);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=n(316),i=n(327),s=n(328),o=n(67),u=n(65),c=n(1).Buffer;function A(t){var e;"object"!==r(t)||c.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=c.from(t));var n,A,d=s(t,e),p=d.tag,f=d.data;switch(p){case"CERTIFICATE":A=a.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=a.PublicKey.decode(f,"der")),n=A.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=a.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+p);case"ENCRYPTED PRIVATE KEY":f=function(t,e){var n=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,A=t.subjectPrivateKey,d=parseInt(a.split("-")[1],10)/8,p=u.pbkdf2Sync(e,n,r,d,"sha1"),f=o.createDecipheriv(a,p,s),l=[];return l.push(f.update(A)),l.push(f.final()),c.concat(l)}(f=a.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(n=(A=a.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:a.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=a.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+p);case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=a.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+p)}}t.exports=A,A.signature=a.signature},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(t){var r,a,i;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}
9
9
  /*!
10
10
  * URI.js - Mutating URLs
11
11
  *