!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Uport Credentials",[],e):"object"==typeof exports?exports["Uport Credentials"]=e():t["Uport Credentials"]=e()}(window,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=65)}([function(t,e,r){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
var i=r(92),n=r(93),o=r(94);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,r){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,r)}function u(t,e,r,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,i){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,r):new Uint8Array(e,r,i);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=d(t,e);return t}(t,e,r,i):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!h.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(e,r),n=(t=s(t,i)).write(e,r);n!==i&&(t=t.slice(0,n));return t}(t,e,r):function(t,e){if(h.isBuffer(e)){var r=0|l(e.length);return 0===(t=s(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(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 c(t,e){if(f(e),t=s(t,e<0?0:0|l(e)),!h.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|l(e.length);t=s(t,r);for(var i=0;i<r;i+=1)t[i]=255&e[i];return t}function l(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(h.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 r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(i)return z(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function b(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=h.from(e,i)),h.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var o,a=1,s=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,s/=2,h/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var f=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===h)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+h>s&&(r=s-h),o=r;o>=0;o--){for(var c=!0,d=0;d<h;d++)if(u(t,o+d)!==u(e,d)){c=!1;break}if(c)return o}return-1}function y(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a<i;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function g(t,e,r,i){return U(z(e,t.length-r),t,r,i)}function w(t,e,r,i){return U(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function M(t,e,r,i){return w(t,e,r,i)}function _(t,e,r,i){return U(L(e),t,r,i)}function S(t,e,r,i){return U(function(t,e){for(var r,i,n,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function x(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var o,a,s,h,u=t[n],f=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c<=r)switch(c){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[n+1]))&&(h=(31&u)<<6|63&o)>127&&(f=h);break;case 3:o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(h=(15&u)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=c}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=E));return r}(i)}e.Buffer=h,e.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.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=a(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return u(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,i){return f(e),e<=0?s(t,e):void 0!==r?"string"==typeof i?s(t,e).fill(r,i):s(t,e).fill(r):s(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return c(null,t)},h.allocUnsafeSlow=function(t){return c(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n<o;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},h.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}},h.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=h.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var a=t[r];if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,n),n+=a.length}return i},h.byteLength=p,h.prototype._isBuffer=!0,h.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)m(this,e,e+1);return this},h.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)m(this,e,e+3),m(this,e+1,e+2);return this},h.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)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},h.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):function(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,i,n){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(i,n),f=t.slice(e,r),c=0;c<s;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},h.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function k(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function R(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function B(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",o=e;o<r;++o)n+=H(t[o]);return n}function I(t,e,r){for(var i=t.slice(e,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function j(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n<o;++n)t[r+n]=(e&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function O(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n<o;++n)t[r+n]=e>>>8*(i?n:3-n)&255}function C(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,o){return o||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function q(t,e,r,i,o){return o||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}h.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),h.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=h.prototype;else{var n=e-t;r=new h(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+t]}return r},h.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i},h.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},h.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=this[t],n=1,o=0;++o<e&&(n*=256);)i+=this[t+o]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o<r&&(n*=256);)this[e+o]=t/n&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n,o=i-r;if(this===t&&r<e&&e<i)for(n=o-1;n>=0;--n)t[n+e]=this[n+r];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},h.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=h.isBuffer(t)?t:z(new h(t,i).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var r;e=e||1/0;for(var i=t.length,n=null,o=[],a=0;a<i;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(6))},function(t,e,r){"use strict";var i=e;i.version=r(66).version,i.utils=r(67),i.rand=r(69),i.curve=r(18),i.curves=r(75),i.ec=r(83),i.eddsa=r(87)},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){var i=r(50)("wks"),n=r(51),o=r(2).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:n)("Symbol."+t))}).store=i},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(68).Buffer}catch(t){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var a=t.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){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):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("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 n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=i)u=h(t,f,f+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=h(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],h=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:u[d-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,h="le"===e,u=new t(o),f=this.clone();if(h){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-n;s++)u[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;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?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a<i.length;a++)o=(e=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,a=t.words,s=e.words,h=r.words,u=0,f=0|a[0],c=8191&f,d=f>>>13,l=0|a[1],p=8191&l,m=l>>>13,b=0|a[2],v=8191&b,y=b>>>13,g=0|a[3],w=8191&g,M=g>>>13,_=0|a[4],S=8191&_,x=_>>>13,A=0|a[5],E=8191&A,k=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],P=8191&T,j=T>>>13,O=0|a[8],C=8191&O,N=O>>>13,q=0|a[9],D=8191&q,H=q>>>13,z=0|s[0],L=8191&z,U=z>>>13,F=0|s[1],K=8191&F,J=F>>>13,Z=0|s[2],Q=8191&Z,Y=Z>>>13,X=0|s[3],W=8191&X,V=X>>>13,G=0|s[4],$=8191&G,tt=G>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],ct=8191&ft,dt=ft>>>13,lt=0|s[9],pt=8191&lt,mt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,U))+Math.imul(d,L)|0))<<13)|0;u=((o=Math.imul(d,U))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,U))+Math.imul(m,L)|0,o=Math.imul(m,U);var vt=(u+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(y,L)|0,o=Math.imul(y,U),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,J)|0;var yt=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,U))+Math.imul(M,L)|0,o=Math.imul(M,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0;var gt=(u+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,U))+Math.imul(x,L)|0,o=Math.imul(x,U),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var wt=(u+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(k,L)|0,o=Math.imul(k,U),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(I,L)|0,o=Math.imul(I,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(j,L)|0,o=Math.imul(j,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,V)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,U))+Math.imul(N,L)|0,o=Math.imul(N,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,Y)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(H,L)|0,o=Math.imul(H,U),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,i=i+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var At=(u+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,J))+Math.imul(H,K)|0,o=Math.imul(H,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var Et=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,Y))+Math.imul(H,Q)|0,o=Math.imul(H,Y),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var kt=(u+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,V))+Math.imul(H,W)|0,o=Math.imul(H,V),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Rt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,tt))+Math.imul(H,$)|0,o=Math.imul(H,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(H,rt)|0,o=Math.imul(H,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var It=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(H,ot)|0,o=Math.imul(H,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(H,ht)|0,o=Math.imul(H,ut),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Pt=(u+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,h[0]=bt,h[1]=vt,h[2]=yt,h[3]=gt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=At,h[10]=Et,h[11]=kt,h[12]=Rt,h[13]=Bt,h[14]=It,h[15]=Tt,h[16]=Pt,h[17]=jt,h[18]=Ot,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),d=67108863&c;s=67108863&(d=d+s|0),n+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a<o;a++)i[a]=e[t[a]],n[a]=r[t[a]]},m.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,h=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=h,d=u,l=0;l<a;l++){var p=r[f+l],m=i[f+l],b=r[f+l+a],v=i[f+l+a],y=c*b-d*v;v=c*v+d*b,b=y,r[f+l]=p+b,i[f+l]=m+v,r[f+l+a]=p-b,i[f+l+a]=m-v,l!==s&&(y=h*c-u*d,d=h*d+u*c,c=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,e,r,n){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<n;++a)r[a]=0;i(0===o),i(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),h=new Array(i),u=new Array(i),f=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,u,i),this.transform(a,o,s,h,i,n),this.transform(u,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-h[l]*c[l];h[l]=s[l]*c[l]+h[l]*f[l],s[l]=p}return this.conjugate(s,h,i),this.transform(s,h,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,h=(0|this.words[e])-s<<r;this.words[e]=h|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,h=r;if(n-=a,n=Math.max(0,n),h){for(var u=0;u<a;u++)h.words[u]=this.words[u];h.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-o|c>>>o,f=c&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(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)},o.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},o.prototype.isubn=function(t){if(i("number"==typeof t),i(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,a=t.length+r;this._expand(a);var s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+s;var h=(0|t.words[n])*e;s=((o-=67108863&h)>>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=i.clone()._ishlnsubmul(n,1,h);0===f.negative&&(i=f,s&&(s.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(c)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(c)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(g,v),n(w,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var c=this.pow(f,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=a;0!==l.cmp(s);){for(var m=l,b=0;0!==m.cmp(s);b++)m=m.redSqr();i(b<p);var v=this.pow(c,new o(1).iushln(p-b-1));d=d.redMul(v),c=v.redSqr(),l=l.redMul(c),p=b}return d},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],a=0,s=0,h=e.bitLength()%26;for(0===h&&(h=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var c=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";var i=r(9),n=r(19);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(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 h(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=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var a=t.charCodeAt(n);a<128?r[i++]=a:a<2048?(r[i++]=a>>6|192,r[i++]=63&a|128):o(t,n)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128,r[i++]=a>>6&63|128,r[i++]=63&a|128):(r[i++]=a>>12|224,r[i++]=a>>6&63|128,r[i++]=63&a|128)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=a(n)),r+=h(n.toString(16))}return r},e.zero2=s,e.zero8=h,e.join32=function(t,e,r,n){var o=r-e;i(o%4==0);for(var a=new Array(o/4),s=0,h=e;s<a.length;s++,h+=4){var u;u="big"===n?t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],a[s]=u>>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===e?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},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,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,a=(o<i?1:0)+r+n;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,i){return(e+i>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,o,a,s){var h=0,u=e;return h+=(u=u+i>>>0)<e?1:0,h+=(u=u+o>>>0)<o?1:0,t+r+n+a+(h+=(u=u+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,r,i,n,o,a,s){return e+i+o+s>>>0},e.sum64_5_hi=function(t,e,r,i,n,o,a,s,h,u){var f=0,c=e;return f+=(c=c+i>>>0)<e?1:0,f+=(c=c+o>>>0)<o?1:0,f+=(c=c+s>>>0)<s?1:0,t+r+n+a+h+(f+=(c=c+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,o,a,s,h,u){return e+i+o+s+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=r)},function(t,e,r){var i=r(14);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){var i=r(24),n=r(47);t.exports=r(15)?function(t,e,r){return i.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var h,u=[],f=!1,c=-1;function d(){f&&h&&(f=!1,h.length?u=h.concat(u):c=-1,u.length&&l())}function l(){if(!f){var t=s(d);f=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||f||s(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,r){"use strict";var i=r(5),n=r(9);function o(){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=o,o.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},function(t,e,r){var i=r(2),n=r(7),o=r(22),a=r(10),s=r(25),h=function(t,e,r){var u,f,c,d=t&h.F,l=t&h.G,p=t&h.S,m=t&h.P,b=t&h.B,v=t&h.W,y=l?n:n[e]||(n[e]={}),g=y.prototype,w=l?i:p?i[e]:(i[e]||{}).prototype;for(u in l&&(r=e),r)(f=!d&&w&&void 0!==w[u])&&s(y,u)||(c=f?w[u]:r[u],y[u]=l&&"function"!=typeof w[u]?r[u]:b&&f?o(c,i):v&&w[u]==c?function(t){var e=function(e,r,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):m&&"function"==typeof c?o(Function.call,c):c,m&&((y.virtual||(y.virtual={}))[u]=c,t&h.R&&g&&!g[u]&&a(g,u,c)))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){t.exports=!r(46)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports={}},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,r){"use strict";var i=e;i.base=r(71),i.short=r(72),i.mont=r(73),i.edwards=r(74)},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";(function(t){var r,i,n=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function a(t){try{h(i.next(t))}catch(t){o(t)}}function s(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(a,s)}h((i=i.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};function a(t){if(""===t)throw new Error("Missing DID");var e=t.match(/^did:([a-zA-Z0-9_]+):([[a-zA-Z0-9_.-]+)(\/[^#]*)?(#.*)?$/);if(e){var r={did:e[0],method:e[1],id:e[2]};return e[3]&&(r.path=e[3]),e[4]&&(r.fragment=e[4].slice(1)),r}throw new Error("Invalid DID "+t)}Object.defineProperty(e,"__esModule",{value:!0}),r="object"==typeof window?window:"object"==typeof t?t:{DID_REGISTRY:{}},i=r.DID_REGISTRY?r.DID_REGISTRY:r.DID_REGISTRY={},e.registerMethod=function(t,e){i[t]=e},e.parse=a,e.default=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return e=a(t),(r=i[e.method])?[4,r(t,e)]:[3,2];case 1:return[2,n.sent()];case 2:throw new Error("Unsupported DID method: '"+e.method+"'")}})})}}).call(this,r(6))},function(t,e,r){var i=r(91).Buffer;t.exports=function(t){for(var e={},r=t.length,n=t.charAt(0),o=0;o<t.length;o++){var a=t.charAt(o);if(void 0!==e[a])throw new TypeError(a+" is ambiguous");e[a]=o}function s(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return i.allocUnsafe(0);for(var o=[0],a=0;a<t.length;a++){var s=e[t[a]];if(void 0===s)return;for(var h=0,u=s;h<o.length;++h)u+=o[h]*r,o[h]=255&u,u>>=8;for(;u>0;)o.push(255&u),u>>=8}for(var f=0;t[f]===n&&f<t.length-1;++f)o.push(0);return i.from(o.reverse())}return{encode:function(e){if(0===e.length)return"";for(var i=[0],o=0;o<e.length;++o){for(var a=0,s=e[o];a<i.length;++a)s+=i[a]<<8,i[a]=s%r,s=s/r|0;for(;s>0;)i.push(s%r),s=s/r|0}for(var h="",u=0;0===e[u]&&u<e.length-1;++u)h+=n;for(var f=i.length-1;f>=0;--f)h+=t[i[f]];return h},decodeUnsafe:s,decode:function(t){var e=s(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}},function(t,e,r){var i=r(23);t.exports=function(t,e,r){if(i(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,i){return t.call(e,r,i)};case 3:return function(r,i,n){return t.call(e,r,i,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){var i=r(8),n=r(105),o=r(106),a=Object.defineProperty;e.f=r(15)?Object.defineProperty:function(t,e,r){if(i(t),e=o(e,!0),i(r),n)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var i=r(112),n=r(31);t.exports=function(t){return i(n(t))}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var i=r(37);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},function(t,e,r){var i=e;i.utils=r(5),i.common=r(12),i.sha=r(76),i.ripemd=r(80),i.hmac=r(81),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e){var r=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:r)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e){t.exports=!0},function(t,e,r){var i=r(14),n=r(2).document,o=i(n)&&i(n.createElement);t.exports=function(t){return o?n.createElement(t):{}}},function(t,e,r){var i=r(50)("keys"),n=r(51);t.exports=function(t){return i[t]||(i[t]=n(t))}},function(t,e,r){var i=r(24).f,n=r(25),o=r(3)("toStringTag");t.exports=function(t,e,r){t&&!n(t=r?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,r){"use strict";var i=r(23);function n(t){var e,r;this.promise=new t(function(t,i){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=i}),this.resolve=i(e),this.reject=i(r)}t.exports.f=function(t){return new n(t)}},function(t,e){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,e,r){var i=r(147),n=r(28);t.exports=function(t){if("string"==typeof t||"number"==typeof t){var e=new i(1),r=String(t).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=n(r);if("-"===a.substr(0,1)&&(a=n(a.slice(1)),e=new i(-1,10)),!(a=""===a?"0":a).match(/^-?[0-9]+$/)&&a.match(/^[0-9A-Fa-f]+$/)||a.match(/^[a-fA-F]+$/)||!0===o&&a.match(/^[0-9A-Fa-f]+$/))return new i(a,16).mul(e);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===o)return new i(a,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new i(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(t,e,r){"use strict";var i=e;function n(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}i.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var i=0;i<t.length;i++)r[i]=0|t[i];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16));else for(i=0;i<t.length;i++){var n=t.charCodeAt(i),o=n>>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){"use strict";var i=r(5).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?a(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=a,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,r){"use strict";var i=r(5),n=r(12),o=r(40),a=r(9),s=i.sum32,h=i.sum32_4,u=i.sum32_5,f=o.ch32,c=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,m=o.g1_256,b=n.BlockHash,v=[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 y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}i.inherits(y,b),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=h(m(r[i-2]),r[i-7],p(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],b=this.h[2],v=this.h[3],y=this.h[4],g=this.h[5],w=this.h[6],M=this.h[7];for(a(this.k.length===r.length),i=0;i<r.length;i++){var _=u(M,l(y),f(y,g,w),this.k[i],r[i]),S=s(d(n),c(n,o,b));M=w,w=g,g=y,y=s(v,_),v=b,b=o,o=n,n=s(_,S)}this.h[0]=s(this.h[0],n),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],b),this.h[3]=s(this.h[3],v),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],g),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],M)},y.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";var i=r(5),n=r(12),o=r(9),a=i.rotr64_hi,s=i.rotr64_lo,h=i.shr64_hi,u=i.shr64_lo,f=i.sum64,c=i.sum64_hi,d=i.sum64_lo,l=i.sum64_4_hi,p=i.sum64_4_lo,m=i.sum64_5_hi,b=i.sum64_5_lo,v=n.BlockHash,y=[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 g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,i,n){var o=t&r^~t&n;return o<0&&(o+=4294967296),o}function M(t,e,r,i,n,o){var a=e&i^~e&o;return a<0&&(a+=4294967296),a}function _(t,e,r,i,n){var o=t&r^t&n^r&n;return o<0&&(o+=4294967296),o}function S(t,e,r,i,n,o){var a=e&i^e&o^i&o;return a<0&&(a+=4294967296),a}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(g,v),t.exports=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=I(r[i-4],r[i-3]),o=T(r[i-4],r[i-3]),a=r[i-14],s=r[i-13],h=R(r[i-30],r[i-29]),u=B(r[i-30],r[i-29]),f=r[i-32],c=r[i-31];r[i]=l(n,o,a,s,h,u,f,c),r[i+1]=p(n,o,a,s,h,u,f,c)}},g.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],a=this.h[2],s=this.h[3],h=this.h[4],u=this.h[5],l=this.h[6],p=this.h[7],v=this.h[8],y=this.h[9],g=this.h[10],R=this.h[11],B=this.h[12],I=this.h[13],T=this.h[14],P=this.h[15];o(this.k.length===r.length);for(var j=0;j<r.length;j+=2){var O=T,C=P,N=E(v,y),q=k(v,y),D=w(v,y,g,R,B),H=M(v,y,g,R,B,I),z=this.k[j],L=this.k[j+1],U=r[j],F=r[j+1],K=m(O,C,N,q,D,H,z,L,U,F),J=b(O,C,N,q,D,H,z,L,U,F);O=x(i,n),C=A(i,n),N=_(i,n,a,s,h),q=S(i,n,a,s,h,u);var Z=c(O,C,N,q),Q=d(O,C,N,q);T=B,P=I,B=g,I=R,g=v,R=y,v=c(l,p,K,J),y=d(p,p,K,J),l=h,p=u,h=a,u=s,a=i,s=n,i=c(K,J,Z,Q),n=d(K,J,Z,Q)}f(this.h,0,i,n),f(this.h,2,a,s),f(this.h,4,h,u),f(this.h,6,l,p),f(this.h,8,v,y),f(this.h,10,g,R),f(this.h,12,B,I),f(this.h,14,T,P)},g.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";var i=r(21)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),n=r(21)("0123456789abcdef"),o="undefined"!=typeof window?window.XMLHttpRequest:r(95).XMLHttpRequest,a="0x447885f0",s="0x446d5aa4000000000000000000000000";function h(t,e){var r=new o,i=t||{};r.onreadystatechange=function(){if(4===r.readyState&&1!==r.timeout)if(200!==r.status)e(new Error("[uport-lite] status "+r.status+": "+r.responseText));else try{e(null,JSON.parse(r.responseText))}catch(t){e(new Error("[uport-lite] while parsing data: '"+String(r.responseText)+"', error: "+String(t)))}},i.data?r.open("POST",t.uri):r.open("GET",t.uri),i.accept&&r.setRequestHeader("accept",i.accept),i.data?(r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(i.data))):r.send()}function u(t){var e=i.decode(t),r=e.length-24,o=e.slice(1,r),a=e.slice(r,20+r);return{network:"0x"+n.encode(o),address:"0x"+n.encode(a)}}var f={"0x1":{registry:"0xab5c8051b9a1df1aab0149f8b0630848b7ecabf6",rpcUrl:"https://mainnet.infura.io/v3/e72b472993ff46d3b5b88faa47214d7f"},"0x3":{registry:"0x41566e3a081f5032bdcad470adb797635ddfe1f0",rpcUrl:"https://ropsten.infura.io/v3/e72b472993ff46d3b5b88faa47214d7f"},"0x2a":{registry:"0x5f8e9351dc2d238fb878b6ae43aa740d62fc9758",rpcUrl:"https://kovan.infura.io/v3/e72b472993ff46d3b5b88faa47214d7f"},"0x4":{registry:"0x2cc31912b2b0f3075a87b3640923d45a26cef3ee",rpcUrl:"https://rinkeby.infura.io/v3/e72b472993ff46d3b5b88faa47214d7f"}};t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ipfsGw||"https://ipfs.infura.io/ipfs/",r=t.networks?Object.assign({},f,t.networks):f;function o(t,e,r){return void 0===e?t:r?(t+e).slice(-t.length):(e+t).substring(0,t.length)}function c(t,e){var o=r["0x3"].rpcUrl;return t?h({uri:o,accept:"application/json",data:{method:"eth_call",params:[{to:"0xb9C1598e24650437a3055F7f66AC1820c419a679",data:s+t.slice(2)},"latest"],id:1,jsonrpc:"2.0"}},function(t,r){if(t)return e(t);if(r.error)return e(r.error);var o,a=r.result.slice(130).slice(0,68);return e(null,(o=a,i.encode(n.decode(o))))}):e(null)}function d(t,e,s,f){var c=u(e),d=u(s);if(c.network===d.network){if(r[c.network])return h({uri:""+r[c.network].rpcUrl,accept:"application/json",data:{method:"eth_call",params:[{to:r[c.network].registry,data:function(t,e,r,i){var n,a=t;return a+=o("0000000000000000000000000000000000000000000000000000000000000000",e.split("").map(function(t){return("0"+t.charCodeAt(0).toString(16)).slice(-2)}).join(n||"")),a+=o("0000000000000000000000000000000000000000000000000000000000000000",r.slice(2),!0),a+=o("0000000000000000000000000000000000000000000000000000000000000000",i.slice(2),!0)}(a,t,c.address,d.address)},"latest"],id:1,jsonrpc:"2.0"}},function(t,e){return t?f(t):e.error?f(e.error):0==e.result?f(t):f(null,(r=e.result,i.encode(n.decode("1220"+r.slice(2)))));var r});f(new Error("Network id "+c.network+" is not configured"))}else f(new Error("Issuer and subject must be on the same network"))}function l(t,r){return t&&"0x"!==t?h({uri:""+e+t},r):r()}return function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"uPortProfileIPFS1220";if(!t)return e(null);var n=r||t;return t.match(/0x[0-9a-fA-F]{40}/)?c(t,function(t,r){if(t)return e(t);l(r,e)}):d(i,t,n,function(t,r){if(t)return e(t);l(r,e)})}}},function(t,e,r){"use strict";var i=r(104)(!0);r(45)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=i(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";var i=r(32),n=r(13),o=r(107),a=r(10),s=r(16),h=r(108),u=r(35),f=r(115),c=r(3)("iterator"),d=!([].keys&&"next"in[].keys()),l=function(){return this};t.exports=function(t,e,r,p,m,b,v){h(r,e,p);var y,g,w,M=function(t){if(!d&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},_=e+" Iterator",S="values"==m,x=!1,A=t.prototype,E=A[c]||A["@@iterator"]||m&&A[m],k=E||M(m),R=m?S?M("entries"):k:void 0,B="Array"==e&&A.entries||E;if(B&&(w=f(B.call(new t)))!==Object.prototype&&w.next&&(u(w,_,!0),i||"function"==typeof w[c]||a(w,c,l)),S&&E&&"values"!==E.name&&(x=!0,k=function(){return E.call(this)}),i&&!v||!d&&!x&&A[c]||a(A,c,k),s[e]=k,s[_]=l,m)if(y={values:S?k:M("values"),keys:b?k:M("keys"),entries:R},v)for(g in y)g in A||o(A,g,y[g]);else n(n.P+n.F*(d||x),e,y);return y}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){var i=r(111),n=r(52);t.exports=Object.keys||function(t){return i(t,n)}},function(t,e,r){var i=r(30),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e,r){var i=r(7),n=r(2),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:i.version,mode:r(32)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var r=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+i).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var i=r(2).document;t.exports=i&&i.documentElement},function(t,e,r){r(117);for(var i=r(2),n=r(10),o=r(16),a=r(3)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),h=0;h<s.length;h++){var u=s[h],f=i[u],c=f&&f.prototype;c&&!c[a]&&n(c,a,u),o[u]=o.Array}},function(t,e,r){var i=r(27),n=r(3)("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),n))?r:o?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,r){var i=r(55),n=r(3)("iterator"),o=r(16);t.exports=r(7).getIteratorMethod=function(t){if(null!=t)return t[n]||t["@@iterator"]||o[i(t)]}},function(t,e,r){var i=r(8),n=r(23),o=r(3)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||null==(r=i(a)[o])?e:n(r)}},function(t,e,r){var i,n,o,a=r(22),s=r(125),h=r(53),u=r(33),f=r(2),c=f.process,d=f.setImmediate,l=f.clearImmediate,p=f.MessageChannel,m=f.Dispatch,b=0,v={},y=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},g=function(t){y.call(t.data)};d&&l||(d=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return v[++b]=function(){s("function"==typeof t?t:Function(t),e)},i(b),b},l=function(t){delete v[t]},"process"==r(27)(c)?i=function(t){c.nextTick(a(y,t,1))}:m&&m.now?i=function(t){m.now(a(y,t,1))}:p?(o=(n=new p).port2,n.port1.onmessage=g,i=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(i=function(t){f.postMessage(t+"","*")},f.addEventListener("message",g,!1)):i="onreadystatechange"in u("script")?function(t){h.appendChild(u("script")).onreadystatechange=function(){h.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:d,clear:l}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,r){var i=r(8),n=r(14),o=r(36);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=o.f(t);return(0,r.resolve)(e),r.promise}},function(t,e,r){"use strict";var i=r(149),n=r(150);t.exports=function(t){if(!i(t.then))throw new TypeError("Expected a promise");return function(e){t.then(function(t){n(e,null,t)},function(t){n(e,t)})}}},function(t,e,r){(function(e,r){
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.5.5
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2016
 * @license MIT
 */
!function(i){"use strict";"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_TEST&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[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],h=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],f=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=f(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:d},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new g(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=c(t,e,n)}return r}}],p={},m=0;m<l.length;++m)for(var b=l[m],v=b.bits,y=0;y<v.length;++y)p[b.name+"_"+v[y]]=b.createMethod(v[y],b.padding);function g(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor==i.ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,o=t.length,s=this.blocks,h=this.byteCount,u=this.blockCount,f=0,c=this.s;f<o;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<u+1;++r)s[r]=0;if(e)for(r=this.start;f<o&&r<h;++f)s[r>>2]|=t[f]<<a[3&r++];else for(r=this.start;f<o&&r<h;++f)(n=t.charCodeAt(f))<128?s[r>>2]|=n<<a[3&r++]:n<2048?(s[r>>2]|=(192|n>>6)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]):n<55296||n>=57344?(s[r>>2]|=(224|n>>12)<<a[3&r++],s[r>>2]|=(128|n>>6&63)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++f)),s[r>>2]|=(240|n>>18)<<a[3&r++],s[r>>2]|=(128|n>>12&63)<<a[3&r++],s[r>>2]|=(128|n>>6&63)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]);if(this.lastByteIndex=r,r>=h){for(this.start=r-h,this.block=s[u],r=0;r<u;++r)c[r]^=s[r];w(c),this.reset=!0}else this.start=r}return this},g.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex==this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];w(i)},g.prototype.toString=g.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,a=0,s=0,h="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],h+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];s%e==0&&(w(r),a=0)}return n&&(t=r[a],n>0&&(h+=o[t>>4&15]+o[15&t]),n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(s);for(var h=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)h[a]=r[o];a%e==0&&w(r)}return n&&(h[o]=r[o],t=t.slice(0,s)),t},g.prototype.buffer=g.prototype.arrayBuffer,g.prototype.digest=g.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,a=0,s=0,h=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],h[t]=255&e,h[t+1]=e>>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;s%r==0&&w(i)}return o&&(t=s<<2,e=i[a],o>0&&(h[t]=255&e),o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h};var w=function(t){var e,r,i,n,o,a,h,u,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,E,k,R,B,I,T,P,j,O,C,N,q,D,H,z,L,U,F,K,J,Z,Q,Y,X,W,V,G,$,tt,et,rt,it,nt,ot,at,st,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|d>>>31),r=h^(d<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|p>>>31),r=f^(p<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=d^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],b=t[1],Q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,B=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,V=t[34]<<15|t[35]>>>17,G=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,H=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,Z=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,U=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~v&g,t[1]=b^~y&w,t[10]=A^~k&B,t[11]=E^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~Q&X,t[31]=Z^~Y&W,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=k^~B&T,t[13]=R^~I&P,t[22]=q^~H&L,t[23]=D^~z&U,t[32]=Q^~X&V,t[33]=Y^~W&G,t[42]=it^~ot&st,t[43]=nt^~at&ht,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&j,t[15]=I^~P&O,t[24]=H^~L&F,t[25]=z^~U&K,t[34]=X^~V&$,t[35]=W^~G&tt,t[44]=ot^~st&ut,t[45]=at^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~j&A,t[17]=P^~O&E,t[26]=L^~F&C,t[27]=U^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=j^~A&k,t[19]=O^~E&R,t[28]=F^~C&q,t[29]=K^~N&D,t[38]=$^~J&Q,t[39]=tt^~Z&Y,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(n)t.exports=p;else if(i)for(var M in p)i[M]=p[M]}(this)}).call(this,r(11),r(6))},function(t,e,r){"use strict";(function(e){var i=r(37),n=r(28);function o(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function a(t){return"0x"+o(t.toString(16))}t.exports={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"](function(e){return t.indexOf(e)>=0})},intToBuffer:function(t){var r=a(t);return e.from(r.slice(2),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return e.byteLength(t,"utf8")},isHexPrefixed:i,stripHexPrefix:n,padToEven:o,intToHex:a,fromAscii:function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r).toString(16);e+=i.length<2?"0"+i:i}return"0x"+e},fromUtf8:function(t){return"0x"+o(new e(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(t){var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r<i;r+=2){var n=parseInt(t.substr(r,2),16);e+=String.fromCharCode(n)}return e},toUtf8:function(t){return new e(o(n(t).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(t,e,r){if(!Array.isArray(t))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof t+"'");if("string"!=typeof e)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof e+"'.");for(var i=[],n=0;n<t.length;n++){var o=t[n][e];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");i.push(o)}return i},isHexString:function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}}}).call(this,r(0).Buffer)},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var n,o,a=r(1),s=i(r(90)),h=i(r(96)),u=i(r(163)),f=i(r(43)),c=r(165),d=r(167);!function(t){t.Function="function",t.Event="event",t.Constructor="constructor",t.Fallback="fallback"}(n||(n={})),function(t){t.Pure="pure",t.View="view",t.NonPayable="nonpayable",t.Payable="payable"}(o||(o={}));var l,p=function(t,e){for(var r=t.name+"(",i=t.inputs||[],n=0;n<i.length;n++){var o=i[n],a=o.type+" ";r+=a+="string"===o.type?'"'+e[n]+'"':""+e[n],i.length-1!==n&&(r+=", ")}return r+")"},m=function(t){return function(e){return{at:function(r){var i={};return e.filter(function(t){return t.type===n.Function&&t.name&&!t.constant}).forEach(function(e){e.name&&(i[e.name]=function(){var i={},n=[].slice.call(arguments),o=(e.inputs||[]).length;(function(t){if("object"!=typeof t)return!1;if(0===Object.keys(t).length)return!0;for(var e=0,r=["from","to","data","value","gasPrice","gas"];e<r.length;e+=1)if(r[e]in t)return!0;return!1})(n[o])&&(i=n.splice(o,1)[0]);var a=Object.assign({},i,{to:r,function:p(e,n)});return t?t(a,n[n.length-1]):a})}),Object.assign({},i,{abi:e,address:r})}}}},b=new a.ec("secp256k1");!function(t){t.DISCLOSURE_REQUEST="shareReq",t.DISCLOSURE_RESPONSE="shareResp",t.TYPED_DATA_SIGNATURE_REQUEST="eip712Req",t.VERIFICATION_SIGNATURE_REQUEST="verReq",t.ETH_TX_REQUEST="ethtx",t.PERSONAL_SIGN_REQUEST="personalSigReq"}(l||(l={}));var v=function(t){var e,r=t.did,i=t.address,n=t.privateKey,o=t.signer,a=t.networks,l=t.registry,p=t.ethrConfig;if(o?this.signer=o:n&&(this.signer=d.SimpleSigner(n)),r)this.did=r;else if(i)c.isMNID(i)&&(this.did="did:uport:"+i),i.match("^0x[0-9a-fA-F]{40}$")&&(this.did="did:ethr:"+i);else if(n){var m=b.keyFromPrivate(n),v=d.toEthereumAddress(m.getPublic("hex"));this.did="did:ethr:"+v}s(l||f({networks:a?(e=a,Object.keys(e).forEach(function(t){var r=e[t];if("object"!=typeof r)throw new Error("Network configuration object required");["registry","rpcUrl"].forEach(function(t){if(!r.hasOwnProperty(t))throw new Error("Malformed network config object, object must have '"+t+"' key specified.")})}),e):{}})),h(p||{}),u()};v.createIdentity=function(){var t=b.genKeyPair(),e=t.getPublic("hex"),r=t.getPrivate("hex");return{did:"did:ethr:"+d.toEthereumAddress(e),privateKey:r}},v.prototype.signJWT=function(t,e){return this.did&&this.signer?d.createJWT(t,{issuer:this.did,signer:this.signer,alg:this.did.match("^did:uport:")||c.isMNID(this.did)?"ES256K":"ES256K-R",expiresIn:e}):Promise.reject(new Error("No Signing Identity configured"))},v.prototype.createDisclosureRequest=function(t,e){void 0===t&&(t={}),void 0===e&&(e=600);var r={};if(t.requested&&(r.requested=t.requested),t.verified&&(r.verified=t.verified),t.claims&&(r.claims=t.claims),t.notifications&&(r.permissions=["notifications"]),t.callbackUrl&&(r.callback=t.callbackUrl),t.networkId&&(r.net=t.networkId),t.rpcUrl){if(!t.networkId)return Promise.reject(new Error("rpcUrl was specified but no networkId"));r.rpc=t.rpcUrl}if(t.vc&&(r.vc=t.vc),t.exp&&(r.exp=t.exp),t.accountType){if(!(["general","segregated","keypair","none"].indexOf(t.accountType)>=0))return Promise.reject(new Error("Unsupported accountType "+t.accountType));r.act=t.accountType}return this.signJWT(Object.assign({},r,{type:l.DISCLOSURE_REQUEST}),t.exp?void 0:e)},v.prototype.createVerification=function(t){return this.signJWT({sub:t.sub,claim:t.claim,exp:t.exp,vc:t.vc,callbackUrl:t.callbackUrl})},v.prototype.createVerificationSignatureRequest=function(t,e){return this.signJWT({unsignedClaim:t,sub:e.sub,riss:e.riss,aud:e.aud,vc:e.vc,callback:e.callbackUrl,type:l.VERIFICATION_SIGNATURE_REQUEST,rexp:e.rexp},e.expiresIn)},v.prototype.createTypedDataSignatureRequest=function(t,e){void 0===e&&(e={});var r=e.from,i=e.net,n=e.callback;try{for(var o=0,a=["types","primaryType","message","domain"];o<a.length;o+=1){var s=a[o];if(!t[s])throw new Error("Invalid EIP712 Request, must include '"+s+"'")}return Promise.resolve(this.signJWT({typedData:t,from:r,net:i,callback:n,type:l.TYPED_DATA_SIGNATURE_REQUEST}))}catch(t){return Promise.reject(t)}},v.prototype.createPersonalSignRequest=function(t,e){return void 0===e&&(e={}),this.signJWT({data:t,from:e.from,net:e.net,callback:e.callback,type:l.PERSONAL_SIGN_REQUEST})},v.prototype.createTxRequest=function(t,e){void 0===e&&(e={});var r=e.callbackUrl,i=e.exp;void 0===i&&(i=600);var n=e.networkId,o=e.label,a={};return r&&(a.callback=r),n&&(a.net=n),o&&(a.label=o),this.signJWT(Object.assign({},a,t,{type:l.ETH_TX_REQUEST}),i)},v.prototype.createDisclosureResponse=function(t,e){void 0===t&&(t={}),void 0===e&&(e=600);try{var r=this;function i(){return r.signJWT(Object.assign({},t,{type:l.DISCLOSURE_RESPONSE}),e)}var n=function(){if(t.req)return Promise.resolve(d.verifyJWT(t.req)).then(function(e){e.issuer&&(t.aud=e.issuer)})}();return n&&n.then?n.then(i):i()}catch(t){return Promise.reject(t)}},v.prototype.processDisclosurePayload=function(t){var e=t.doc,r=t.payload;try{var i=this,n=r.own;void 0===n&&(n={});var o=r.capabilities;void 0===o&&(o=[]);var a=r.nad,s=r.dad,h=r.iss,u=r.boxPub,f=r.verified,l=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&-1===e.indexOf(i)&&(r[i]=t[i]);return r}(r,["own","capabilities","aud","req","iat","exp","type","nad","dad","iss","boxPub","verified"]),p=e.uportProfile;void 0===p&&(p={});var m=Object.assign({},{did:h,boxPub:u},n,p,l);s&&(m.deviceKey=s),a&&(m.mnid=a,m.address=c.decode(a).address),1===o.length&&(m.pushToken=o[0]);var b=function(){if(f){var t=[],e=f.map(function(e){return d.verifyJWT(e,{audience:i.did}).catch(function(){return t.push(e),Promise.resolve(void 0)})});return Promise.resolve(Promise.all(e)).then(function(e){var r=[];e.forEach(function(t){t&&r.push(Object.assign({},t.payload,{jwt:t.jwt}))}),m.verified=r,m.invalid=t})}}();return b&&b.then?b.then(function(){return m}):m}catch(t){return Promise.reject(t)}},v.prototype.authenticateDisclosureResponse=function(t,e){try{var r=this;return Promise.resolve(d.verifyJWT(t,{audience:r.did,callbackUrl:e,auth:!0})).then(function(t){var e=t.payload,i=t.doc;if(e.req)return Promise.resolve(d.verifyJWT(e.req,{audience:r.did})).then(function(t){var n=t.payload;if(n.type!==l.DISCLOSURE_REQUEST)throw new Error("Challenge payload type invalid: "+n.type);return r.processDisclosurePayload({payload:e,doc:i})});throw new Error("Challenge was not included in response")})}catch(t){return Promise.reject(t)}},v.prototype.verifyDisclosure=function(t){try{var e=this;return Promise.resolve(d.verifyJWT(t,{audience:e.did})).then(function(t){return e.processDisclosurePayload({payload:t.payload,doc:t.doc})})}catch(t){return Promise.reject(t)}},v.prototype.contract=function(t){var e=this;return m(function(t,r){return t.function&&(t.fn=t.function),delete t.function,e.createTxRequest(t,r)}.bind(this))(t)};var y=d.SimpleSigner,g=m,w={Credentials:v,SimpleSigner:y,ContractFactory:g};e.Credentials=v,e.SimpleSigner=y,e.ContractFactory=g,e.default=w},function(t){t.exports={_args:[["elliptic@6.4.1","/Users/mxu/code/uport-credentials"]],_from:"elliptic@6.4.1",_id:"elliptic@6.4.1",_inBundle:!1,_integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.1",saveSpec:null,fetchSpec:"6.4.1"},_requiredBy:["/","/browserify-sign","/create-ecdh","/did-jwt","/uport-transports/did-jwt"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_spec:"6.4.1",_where:"/Users/mxu/code/uport-credentials",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.1"}},function(t,e,r){"use strict";var i=e,n=r(4),o=r(9),a=r(39);i.assert=o,i.toArray=a.toArray,i.zero2=a.zero2,i.toHex=a.toHex,i.encode=a.encode,i.getNAF=function(t,e){for(var r=[],i=1<<e+1,n=t.clone();n.cmpn(1)>=0;){var o;if(n.isOdd()){var a=n.andln(i-1);o=a>(i>>1)-1?(i>>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?e+1:1,h=1;h<s;h++)r.push(0);n.iushrn(s)}return r},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i=0,n=0;t.cmpn(-i)>0||e.cmpn(-n)>0;){var o,a,s,h=t.andln(3)+i&3,u=e.andln(3)+n&3;3===h&&(h=-1),3===u&&(u=-1),o=0==(1&h)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==u?h:-h,r[0].push(o),a=0==(1&u)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==h?u:-u,r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e){},function(t,e,r){var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(70);if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},function(t,e){},function(t,e,r){"use strict";var i=r(4),n=r(1).utils,o=n.getNAF,a=n.getJSF,s=n.assert;function h(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(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);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=h,h.prototype.point=function(){throw new Error("Not implemented")},h.prototype.validate=function(){throw new Error("Not implemented")},h.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),i=o(e,1),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;for(var a=[],h=0;h<i.length;h+=r.step){var u=0;for(e=h+r.step-1;e>=h;e--)u=(u<<1)+i[e];a.push(u)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=n;d>0;d--){for(h=0;h<a.length;h++){(u=a[h])===d?c=c.mixedAdd(r.points[h]):u===-d&&(c=c.mixedAdd(r.points[h].neg()))}f=f.add(c)}return f.toP()},h.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,a=o(e,r),h=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(e=0;u>=0&&0===a[u];u--)e++;if(u>=0&&e++,h=h.dblp(e),u<0)break;var f=a[u];s(0!==f),h="affine"===t.type?f>0?h.mixedAdd(n[f-1>>1]):h.mixedAdd(n[-f-1>>1].neg()):f>0?h.add(n[f-1>>1]):h.add(n[-f-1>>1].neg())}return"affine"===t.type?h.toP():h},h.prototype._wnafMulAdd=function(t,e,r,i,n){for(var s=this._wnafT1,h=this._wnafT2,u=this._wnafT3,f=0,c=0;c<i;c++){var d=(A=e[c])._getNAFPoints(t);s[c]=d.wnd,h[c]=d.points}for(c=i-1;c>=1;c-=2){var l=c-1,p=c;if(1===s[l]&&1===s[p]){var m=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(m[1]=e[l].add(e[p]),m[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(m[1]=e[l].toJ().mixedAdd(e[p]),m[2]=e[l].add(e[p].neg())):(m[1]=e[l].toJ().mixedAdd(e[p]),m[2]=e[l].toJ().mixedAdd(e[p].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[l],r[p]);f=Math.max(v[0].length,f),u[l]=new Array(f),u[p]=new Array(f);for(var y=0;y<f;y++){var g=0|v[0][y],w=0|v[1][y];u[l][y]=b[3*(g+1)+(w+1)],u[p][y]=0,h[l]=m}}else u[l]=o(r[l],s[l]),u[p]=o(r[p],s[p]),f=Math.max(u[l].length,f),f=Math.max(u[p].length,f)}var M=this.jpoint(null,null,null),_=this._wnafT4;for(c=f;c>=0;c--){for(var S=0;c>=0;){var x=!0;for(y=0;y<i;y++)_[y]=0|u[y][c],0!==_[y]&&(x=!1);if(!x)break;S++,c--}if(c>=0&&S++,M=M.dblp(S),c<0)break;for(y=0;y<i;y++){var A,E=_[y];0!==E&&(E>0?A=h[y][E-1>>1]:E<0&&(A=h[y][-E-1>>1].neg()),M="affine"===A.type?M.mixedAdd(A):M.add(A))}}for(c=0;c<i;c++)h[c]=null;return n?M:M.toP()},h.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},h.prototype.decodePoint=function(t,e){t=n.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?s(t[t.length-1]%2==0):7===t[0]&&s(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},u.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},u.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)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)i=i.dbl();r.push(i)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(t,e,r){"use strict";var i=r(18),n=r(1),o=r(4),a=r(19),s=i.base,h=n.utils.assert;function u(t){s.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(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 f(t,e,r,i){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(r,16),i&&(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 c(t,e,r,i){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(i,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}a(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new o(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new o(t.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))?r=n[0]:(r=n[1],h(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),i=r.redNeg(),n=new o(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,i,n,a,s,h,u,f,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new o(1),m=new o(0),b=new o(0),v=new o(1),y=0;0!==d.cmpn(0);){var g=l.div(d);u=l.sub(g.mul(d)),f=b.sub(g.mul(p));var w=v.sub(g.mul(m));if(!i&&u.cmp(c)<0)e=h.neg(),r=p,i=u.neg(),n=f;else if(i&&2==++y)break;h=u,l=d,d=u,b=p,p=f,v=m,m=w}a=u.neg(),s=f;var M=i.sqr().add(n.sqr());return a.sqr().add(s.sqr()).cmp(M)>=0&&(a=e,s=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:n},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),h=n.mul(r.b),u=o.mul(i.b);return{k1:t.sub(a).sub(s),k2:h.add(u).neg()}},u.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],h=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),h=h.neg(!0)),i[2*o]=s,i[2*o+1]=h,n[2*o]=a.k1,n[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,i,n,2*o,r),f=0;f<2*o;f++)i[f]=null,n[f]=null;return u},a(f,s.BasePoint),u.prototype.point=function(t,e,r){return new f(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},f.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]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},f.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)+">"},f.prototype.isInfinity=function(){return this.inf},f.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 r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},f.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,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new o(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},f.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},f.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))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=i.redSub(n),h=o.redSub(a);if(0===s.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),c=i.redMul(u),d=h.redSqr().redIAdd(f).redISub(c).redISub(c),l=h.redMul(c.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),u=h.redMul(a),f=r.redMul(h),c=s.redSqr().redIAdd(u).redISub(f).redISub(f),d=s.redMul(f.redISub(c)).redISub(n.redMul(u)),l=this.z.redMul(a);return this.curve.jpoint(c,d,l)},c.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,r=0;r<t;r++)e=e.dbl();return e}var i=this.curve.a,n=this.curve.tinv,o=this.x,a=this.y,s=this.z,h=s.redSqr().redSqr(),u=a.redAdd(a);for(r=0;r<t;r++){var f=o.redSqr(),c=u.redSqr(),d=c.redSqr(),l=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(h)),p=o.redMul(c),m=l.redSqr().redISub(p.redAdd(p)),b=p.redISub(m),v=l.redMul(b);v=v.redIAdd(v).redISub(d);var y=u.redMul(s);r+1<t&&(h=h.redMul(d)),o=m,s=y,u=v}return this.curve.jpoint(o,u.redMul(n),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i),h=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=h,e=s.redMul(a.redISub(h)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(f).redISub(d);l=l.redIAdd(l);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),t=m.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),h=s.redSqr().redISub(a).redISub(a);t=h;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=s.redMul(a.redISub(h)).redISub(u),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(f).redMul(this.x.redAdd(f));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(f);var b=c.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),e=l.redMul(p.redISub(t)).redISub(b)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),h=e.redAdd(e),u=(h=h.redIAdd(h)).redMul(a),f=s.redSqr().redISub(u.redAdd(u)),c=u.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=s.redMul(c).redISub(d),p=r.redAdd(r).redMul(i);return this.curve.jpoint(f,l,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),h=i.redIAdd(i);h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var u=n.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(h),f=e.redMul(u);f=(f=f.redIAdd(f)).redIAdd(f);var c=this.x.redMul(s).redISub(f);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(u.redMul(h.redISub(u)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(c,d,l)},c.prototype.mul=function(t,e){return t=new o(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var i=r(18),n=r(4),o=r(19),a=i.base,s=r(1).utils;function h(t){a.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){a.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(h,a),t.exports=h,h.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},o(u,a.BasePoint),h.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},h.prototype.point=function(t,e){return new u(this,t,e)},h.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=n.redMul(i),s=e.z.redMul(o.redAdd(a).redSqr()),h=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,h)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var i=r(18),n=r(1),o=r(4),a=r(19),s=i.base,h=n.utils.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new o(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),h(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,r,i,n){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(e,16),this.y=new o(r,16),this.z=i?new o(i,16):this.curve.one,this.t=n&&new o(n,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},u.prototype.pointFromX=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(n.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var h=s.fromRed().isOdd();return(e&&!h||!e&&h)&&(s=s.redNeg()),this.point(t,s)},u.prototype.pointFromY=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),n=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},a(f,s.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,i){return new f(this,t,e,r,i)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.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)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=i.redAdd(e),a=o.redSub(r),s=i.redSub(e),h=n.redMul(a),u=o.redMul(s),f=n.redMul(s),c=a.redMul(o);return this.curve.point(h,u,c,f)},f.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),h=a.redSub(s).redISub(s);t=i.redSub(n).redISub(o).redMul(h),e=a.redMul(u.redSub(o)),r=a.redMul(h)}}else{var u=n.redAdd(o);s=this.curve._mulC(this.z).redSqr(),h=u.redSub(s).redSub(s);t=this.curve._mulC(i.redISub(u)).redMul(h),e=this.curve._mulC(u).redMul(n.redISub(o)),r=u.redMul(h)}return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=n.redSub(i),s=n.redAdd(i),h=r.redAdd(e),u=o.redMul(a),f=s.redMul(h),c=o.redMul(h),d=a.redMul(s);return this.curve.point(u,f,d,c)},f.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),h=n.redSub(s),u=n.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),c=i.redMul(h).redMul(f);return this.curve.twisted?(e=i.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=h.redMul(u)):(e=i.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(h).redMul(u)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(t,e,r){"use strict";var i,n=e,o=r(29),a=r(1),s=a.utils.assert;function h(t){"short"===t.type?this.curve=new a.curve.short(t):"edwards"===t.type?this.curve=new a.curve.edwards(t):this.curve=new a.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new h(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=h,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(82)}catch(t){i=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},function(t,e,r){"use strict";e.sha1=r(77),e.sha224=r(78),e.sha256=r(41),e.sha384=r(79),e.sha512=r(42)},function(t,e,r){"use strict";var i=r(5),n=r(12),o=r(40),a=i.rotl32,s=i.sum32,h=i.sum32_5,u=o.ft_1,f=n.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(d,f),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=a(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],f=this.h[2],d=this.h[3],l=this.h[4];for(i=0;i<r.length;i++){var p=~~(i/20),m=h(a(n,5),u(p,o,f,d),l,r[i],c[p]);l=d,d=f,f=a(o,30),o=n,n=m}this.h[0]=s(this.h[0],n),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},function(t,e,r){"use strict";var i=r(5),n=r(41);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var i=r(5),n=r(42);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var i=r(5),n=r(12),o=i.rotl32,a=i.sum32,s=i.sum32_3,h=i.sum32_4,u=n.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],f=this.h[4],y=r,g=i,w=n,M=u,_=f,S=0;S<80;S++){var x=a(o(h(r,c(S,i,n,u),t[p[S]+e],d(S)),b[S]),f);r=f,f=u,u=o(n,10),n=i,i=x,x=a(o(h(y,c(79-S,g,w,M),t[m[S]+e],l(S)),v[S]),_),y=_,_=M,M=o(w,10),w=g,g=x}x=s(this.h[1],n,M),this.h[1]=s(this.h[2],u,_),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,g),this.h[4]=s(this.h[0],i,w),this.h[0]=x},f.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.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],m=[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],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var i=r(5),n=r(9);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(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)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";var i=r(4),n=r(84),o=r(1),a=o.utils.assert,s=r(85),h=r(86);function u(t){if(!(this instanceof u))return new u(t);"string"==typeof t&&(a(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.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}t.exports=u,u.prototype.keyPair=function(t){return new s(this,t)},u.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},u.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},u.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new i(2));;){var s=new i(e.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},u.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},u.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),f=new n({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new i(1)),d=0;;d++){var l=o.k?o.k(d):new i(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var m=p.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=l.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new h({r:b,s:v,recoveryParam:y})}}}}}},u.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new h(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),f=u.mul(t).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),c)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(t,e,r,n){a((3&r)===r,"The recovery param is more than two bits"),e=new h(e,n);var o=this.n,s=new i(t),u=e.r,f=e.s,c=1&r,d=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),c):this.curve.pointFromX(u,c);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),m=f.mul(l).umod(o);return this.g.mulAdd(p,u,m)},u.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new h(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var i=r(29),n=r(39),o=r(9);function a(t){if(!(this instanceof a))return new a(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=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=a,a.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},a.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())},a.prototype.reseed=function(t,e,r,i){"string"!=typeof e&&(i=r,r=e,e=null),t=n.toArray(t,e),r=n.toArray(r,i),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(r),this._reseed++,n.encode(a,e)}},function(t,e,r){"use strict";var i=r(4),n=r(1).utils.assert;function o(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)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.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"}},o.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},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(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)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var i=r(4),n=r(1).utils,o=n.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function h(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=e.place;o<i;o++,a++)n<<=8,n|=t[a];return e.place=a,n}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;if(h(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=h(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=h(t,r);if(t.length!==u+r.place)return!1;var f=t.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new i(a),this.s=new i(f),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,e.length),(i=i.concat(e)).push(2),f(i,r.length);var o=i.concat(r),a=[48];return f(a,o.length),a=a.concat(o),n.encode(a,t)}},function(t,e,r){"use strict";var i=r(29),n=r(1),o=n.utils,a=o.assert,s=o.parseBytes,h=r(88),u=r(89);function f(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=n.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),h=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:h,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(t){return h.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return h.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},f.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),n=o.intFromLE(r);return this.curve.pointFromY(n,i)},f.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(t){return o.intFromLE(t)},f.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var i=r(1).utils,n=i.assert,o=i.parseBytes,a=i.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},s.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=s},function(t,e,r){"use strict";var i=r(4),n=r(1).utils,o=n.assert,a=n.cachedProperty,s=n.parseBytes;function h(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(h,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(h,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(h,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(h,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function a(t){try{h(i.next(t))}catch(t){o(t)}}function s(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(a,s)}h((i=i.apply(t,e||[])).next())})},n=this&&this.__generator||function(t,e){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(20),s=o(r(43));function h(t,e){var r=[{id:t+"#keys-1",type:"Secp256k1VerificationKey2018",owner:t,publicKeyHex:e.publicKey.match(/^0x/)?e.publicKey.slice(2):e.publicKey}];e.publicEncKey&&r.push({id:t+"#keys-2",type:"Curve25519EncryptionPublicKey",owner:t,publicKeyBase64:e.publicEncKey});var i={"@context":"https://w3id.org/did/v1",id:t,publicKey:r,authentication:[{type:"Secp256k1SignatureAuthentication2018",publicKey:t+"#keys-1"}]};if(e.name||e.description||e.image){var n=Object.assign({},e);delete n.publicKey,delete n.publicEncKey,i.uportProfile=n}return i}e.convertToDid=h,e.default=function(t){var e=t||s.default(),r=function(t){return new Promise(function(r,i){e(t,function(t,e){return t?i(t):r(e)})})};a.registerMethod("uport",function(t,e){return i(this,void 0,void 0,function(){var i;return n(this,function(n){switch(n.label){case 0:return[4,r(e.id)];case 1:return(i=n.sent())?"https://w3id.org/did/v1"===i["@context"]?[2,i]:"string"==typeof i.publicKey?[2,h(t,i)]:[2,null]:[2,null]}})})})}},function(t,e,r){var i=r(0),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=a),o(n,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){for(var e,r=u(t),i=r[0],a=r[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,i,a)),h=0,f=a>0?i-4:i,c=0;c<f;c+=4)e=n[t.charCodeAt(c)]<<18|n[t.charCodeAt(c+1)]<<12|n[t.charCodeAt(c+2)]<<6|n[t.charCodeAt(c+3)],s[h++]=e>>16&255,s[h++]=e>>8&255,s[h++]=255&e;2===a&&(e=n[t.charCodeAt(c)]<<2|n[t.charCodeAt(c+1)]>>4,s[h++]=255&e);1===a&&(e=n[t.charCodeAt(c)]<<10|n[t.charCodeAt(c+1)]<<4|n[t.charCodeAt(c+2)]>>2,s[h++]=e>>8&255,s[h++]=255&e);return s},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],a=0,s=r-n;a<s;a+=16383)o.push(f(t,a,a+16383>s?s:a+16383));1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,h=a.length;s<h;++s)i[s]=a[s],n[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,a=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,a,s=8*n-i-1,h=(1<<s)-1,u=h>>1,f=-7,c=r?n-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-f)-1,l>>=-f,f+=s;f>0;o=256*o+t[e+c],c+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=i;f>0;a=256*a+t[e+c],c+=d,f-=8);if(0===o)o=1-u;else{if(o===h)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,i),o-=u}return(l?-1:1)*a*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var a,s,h,u=8*o-n-1,f=(1<<u)-1,c=f>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+c>=1?d/h:d*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(e*h-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[r+l]=255&s,l+=p,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[r+l]=255&a,l+=p,a/=256,u-=8);t[r+l-p]|=128*m}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.attrTypes=e.delegateTypes=e.REGISTRY=void 0;var i=m(r(97)),n=m(r(100)),o=m(r(133)),a=m(r(136));e.bytes32toString=v,e.stringToBytes32=y,e.wrapDidDocument=w,e.default=function(){var t=this,e=(S=(0,n.default)(i.default.mark(function t(e){var r,n,a,s,h,u,f,c,d,l,b;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=[],t.next=3,g(e);case 3:n=t.sent;case 4:if(!n){t.next=32;break}return a=n,t.next=8,p.getLogs({address:m,topics:[null,"0x000000000000000000000000"+e.slice(2)],fromBlock:n,toBlock:n});case 8:for(s=t.sent,h=y(s),n=void 0,u=!0,f=!1,c=void 0,t.prev=14,d=(0,o.default)(h);!(u=(l=d.next()).done);u=!0)b=l.value,r.unshift(b),b.previousChange.lt(a)&&(n=b.previousChange);t.next=22;break;case 18:t.prev=18,t.t0=t.catch(14),f=!0,c=t.t0;case 22:t.prev=22,t.prev=23,!u&&d.return&&d.return();case 25:if(t.prev=25,!f){t.next=28;break}throw c;case 28:return t.finish(25);case 29:return t.finish(22);case 30:t.next=4;break;case 32:return t.abrupt("return",r);case 33:case"end":return t.stop()}},t,this,[[14,18,22,30],[23,,25,29]])})),function(t){return S.apply(this,arguments)}),r=(_=(0,n.default)(i.default.mark(function t(r,n){var o,a;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.id.match(/^0x[0-9a-fA-F]{40}$/)){t.next=2;break}throw new Error("Not a valid ethr DID: "+r);case 2:return t.next=4,v.identityOwner(n.id);case 4:return o=t.sent,t.next=7,e(n.id);case 7:return a=t.sent,t.abrupt("return",w(r,o[0],a));case 9:case"end":return t.stop()}},t,this)})),function(t,e){return _.apply(this,arguments)}),a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.provider?t.provider:t.web3?t.web3.currentProvider:new h.default(t.rpcUrl||"https://mainnet.infura.io/ethr-did")}(a),p=new u.default(c),m=a.registry||b,v=new d.default(p)(l.default).at(m),y=f.default.logDecoder(l.default,!1),g=(M=(0,n.default)(i.default.mark(function e(r){var n;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.changed(r);case 2:if(!(n=t.sent)){t.next=5;break}return t.abrupt("return",n[0]);case 5:case"end":return t.stop()}},e,t)})),function(t){return M.apply(this,arguments)});var M;var _;var S;(0,s.registerMethod)("ethr",r)};var s=r(20),h=m(r(141)),u=m(r(143)),f=m(r(153)),c=m(r(4)),d=m(r(157)),l=m(r(162)),p=r(0);function m(t){return t&&t.__esModule?t:{default:t}}var b=e.REGISTRY="0xdca7ef03e98e0dc2b855be647c39abe984fcf21b";function v(t){return p.Buffer.from(t.slice(2),"hex").toString("utf8").replace(/\0+$/,"")}function y(t){var e="0x"+p.Buffer.from(t).slice(0,32).toString("hex");return e+"0".repeat(66-e.length)}e.delegateTypes={Secp256k1SignatureAuthentication2018:y("sigAuth"),Secp256k1VerificationKey2018:y("veriKey")};var g=e.attrTypes={sigAuth:"SignatureAuthentication2018",veriKey:"VerificationKey2018"};function w(t,e,r){var i=new c.default(Math.floor((new Date).getTime()/1e3)),n=[{id:t+"#owner",type:"Secp256k1VerificationKey2018",owner:t,ethereumAddress:e}],s=[{type:"Secp256k1SignatureAuthentication2018",publicKey:t+"#owner"}],h=0,u={},f={},d={},l=!0,m=!1,b=void 0;try{for(var y,w=(0,o.default)(r);!(l=(y=w.next()).done);l=!0){var M=y.value,_=M.validTo,S=M._eventName+"-"+(M.delegateType||M.name)+"-"+(M.delegate||M.value);if(_&&_.gte(i)){if("DIDDelegateChanged"===M._eventName)switch(h++,v(M.delegateType)){case"sigAuth":u[S]={type:"Secp256k1SignatureAuthentication2018",publicKey:t+"#delegate-"+h};case"veriKey":f[S]={id:t+"#delegate-"+h,type:"Secp256k1VerificationKey2018",owner:t,ethereumAddress:M.delegate}}else if("DIDAttributeChanged"===M._eventName){var x=v(M.name).match(/^did\/(pub|auth|svc)\/(\w+)(\/(\w+))?(\/(\w+))?$/);if(x){var A=x[1],E=x[2],k=g[x[4]]||x[4],R=x[6];switch(A){case"pub":var B={id:t+"#delegate-"+ ++h,type:""+E+k,owner:t};switch(R){case null:case void 0:case"hex":B.publicKeyHex=M.value.slice(2);break;case"base64":B.publicKeyBase64=p.Buffer.from(M.value.slice(2),"hex").toString("base64");break;case"base58":B.publicKeyBase58=p.Buffer.from(M.value.slice(2),"hex").toString("base58");break;case"pem":B.publicKeyPem=p.Buffer.from(M.value.slice(2),"hex").toString();break;default:B.value=M.value}f[S]=B;break;case"svc":d[S]={type:E,serviceEndpoint:p.Buffer.from(M.value.slice(2),"hex").toString()}}}}}else h>0&&("DIDDelegateChanged"===M._eventName||"DIDAttributeChanged"===M._eventName&&v(M.name).match(/^did\/pub\//))&&_.lt(i)&&h--,delete u[S],delete f[S],delete d[S]}}catch(t){m=!0,b=t}finally{try{!l&&w.return&&w.return()}finally{if(m)throw b}}var I={"@context":"https://w3id.org/did/v1",id:t,publicKey:n.concat((0,a.default)(f)),authentication:s.concat((0,a.default)(u))};return(0,a.default)(d).length>0&&(I.service=(0,a.default)(d)),I}},function(t,e,r){t.exports=r(98)},function(t,e,r){var i=function(){return this}()||Function("return this")(),n=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,o=n&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,t.exports=r(99),n)i.regeneratorRuntime=o;else try{delete i.regeneratorRuntime}catch(t){i.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var r,i=Object.prototype,n=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",h=o.toStringTag||"@@toStringTag",u="object"==typeof t,f=e.regeneratorRuntime;if(f)u&&(t.exports=f);else{(f=e.regeneratorRuntime=u?t.exports:{}).wrap=w;var c="suspendedStart",d="suspendedYield",l="executing",p="completed",m={},b={};b[a]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(T([])));y&&y!==i&&n.call(y,a)&&(b=y);var g=x.prototype=_.prototype=Object.create(b);S.prototype=g.constructor=x,x.constructor=S,x[h]=S.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===S||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h in t||(t[h]="GeneratorFunction")),t.prototype=Object.create(g),t},f.awrap=function(t){return{__await:t}},A(E.prototype),E.prototype[s]=function(){return this},f.AsyncIterator=E,f.async=function(t,e,r,i){var n=new E(w(t,e,r,i));return f.isGeneratorFunction(e)?n:n.next().then(function(t){return t.done?t.value:n.next()})},A(g),g[h]="Generator",g[a]=function(){return this},g.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var i=e.pop();if(i in t)return r.value=i,r.done=!1,r}return r.done=!0,r}},f.values=T,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,n){return s.type="throw",s.arg=t,e.next=i,n&&(e.method="next",e.arg=r),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var h=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(h&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(h){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),B(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;B(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:T(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=r),m}}}function w(t,e,r,i){var n=e&&e.prototype instanceof _?e:_,o=Object.create(n.prototype),a=new I(i||[]);return o._invoke=function(t,e,r){var i=c;return function(n,o){if(i===l)throw new Error("Generator is already running");if(i===p){if("throw"===n)throw o;return P()}for(r.method=n,r.arg=o;;){var a=r.delegate;if(a){var s=k(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===c)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=l;var h=M(t,e,r);if("normal"===h.type){if(i=r.done?p:d,h.arg===m)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(i=p,r.method="throw",r.arg=h.arg)}}}(t,r,a),o}function M(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function _(){}function S(){}function x(){}function A(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(t){var e;this._invoke=function(r,i){function o(){return new Promise(function(e,o){!function e(r,i,o,a){var s=M(t[r],t,i);if("throw"!==s.type){var h=s.arg,u=h.value;return u&&"object"==typeof u&&n.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(u).then(function(t){h.value=t,o(h)},a)}a(s.arg)}(r,i,e,o)})}return e=e?e.then(o,o):o()}}function k(t,e){var i=t.iterator[e.method];if(i===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var n=M(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,m;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},function(t,e,r){"use strict";e.__esModule=!0;var i,n=r(101),o=(i=n)&&i.__esModule?i:{default:i};e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,r){return function i(n,a){try{var s=e[n](a),h=s.value}catch(t){return void r(t)}if(!s.done)return o.default.resolve(h).then(function(t){i("next",t)},function(t){i("throw",t)});t(h)}("next")})}}},function(t,e,r){t.exports={default:r(102),__esModule:!0}},function(t,e,r){r(103),r(44),r(54),r(120),r(131),r(132),t.exports=r(7).Promise},function(t,e){},function(t,e,r){var i=r(30),n=r(31);t.exports=function(t){return function(e,r){var o,a,s=String(n(e)),h=i(r),u=s.length;return h<0||h>=u?t?"":void 0:(o=s.charCodeAt(h))<55296||o>56319||h+1===u||(a=s.charCodeAt(h+1))<56320||a>57343?t?s.charAt(h):o:t?s.slice(h,h+2):a-56320+(o-55296<<10)+65536}}},function(t,e,r){t.exports=!r(15)&&!r(46)(function(){return 7!=Object.defineProperty(r(33)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var i=r(14);t.exports=function(t,e){if(!i(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!i(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!i(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){t.exports=r(10)},function(t,e,r){"use strict";var i=r(109),n=r(47),o=r(35),a={};r(10)(a,r(3)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=i(a,{next:n(1,r)}),o(t,e+" Iterator")}},function(t,e,r){var i=r(8),n=r(110),o=r(52),a=r(34)("IE_PROTO"),s=function(){},h=function(){var t,e=r(33)("iframe"),i=o.length;for(e.style.display="none",r(53).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),h=t.F;i--;)delete h.prototype[o[i]];return h()};t.exports=Object.create||function(t,e){var r;return null!==t?(s.prototype=i(t),r=new s,s.prototype=null,r[a]=t):r=h(),void 0===e?r:n(r,e)}},function(t,e,r){var i=r(24),n=r(8),o=r(48);t.exports=r(15)?Object.defineProperties:function(t,e){n(t);for(var r,a=o(e),s=a.length,h=0;s>h;)i.f(t,r=a[h++],e[r]);return t}},function(t,e,r){var i=r(25),n=r(26),o=r(113)(!1),a=r(34)("IE_PROTO");t.exports=function(t,e){var r,s=n(t),h=0,u=[];for(r in s)r!=a&&i(s,r)&&u.push(r);for(;e.length>h;)i(s,r=e[h++])&&(~o(u,r)||u.push(r));return u}},function(t,e,r){var i=r(27);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,r){var i=r(26),n=r(49),o=r(114);t.exports=function(t){return function(e,r,a){var s,h=i(e),u=n(h.length),f=o(a,u);if(t&&r!=r){for(;u>f;)if((s=h[f++])!=s)return!0}else for(;u>f;f++)if((t||f in h)&&h[f]===r)return t||f||0;return!t&&-1}}},function(t,e,r){var i=r(30),n=Math.max,o=Math.min;t.exports=function(t,e){return(t=i(t))<0?n(t+e,0):o(t,e)}},function(t,e,r){var i=r(25),n=r(116),o=r(34)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,r){var i=r(31);t.exports=function(t){return Object(i(t))}},function(t,e,r){"use strict";var i=r(118),n=r(119),o=r(16),a=r(26);t.exports=r(45)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):n(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){"use strict";var i,n,o,a,s=r(32),h=r(2),u=r(22),f=r(55),c=r(13),d=r(14),l=r(23),p=r(121),m=r(122),b=r(57),v=r(58).set,y=r(126)(),g=r(36),w=r(59),M=r(127),_=r(60),S=h.TypeError,x=h.process,A=x&&x.versions,E=A&&A.v8||"",k=h.Promise,R="process"==f(x),B=function(){},I=n=g.f,T=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[r(3)("species")]=function(t){t(B,B)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(B)instanceof e&&0!==E.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(t){}}(),P=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},j=function(t,e){if(!t._n){t._n=!0;var r=t._c;y(function(){for(var i=t._v,n=1==t._s,o=0,a=function(e){var r,o,a,s=n?e.ok:e.fail,h=e.resolve,u=e.reject,f=e.domain;try{s?(n||(2==t._h&&N(t),t._h=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),a=!0)),r===e.promise?u(S("Promise-chain cycle")):(o=P(r))?o.call(r,h,u):h(r)):u(i)}catch(t){f&&!a&&f.exit(),u(t)}};r.length>o;)a(r[o++]);t._c=[],t._n=!1,e&&!t._h&&O(t)})}},O=function(t){v.call(h,function(){var e,r,i,n=t._v,o=C(t);if(o&&(e=w(function(){R?x.emit("unhandledRejection",n,t):(r=h.onunhandledrejection)?r({promise:t,reason:n}):(i=h.console)&&i.error&&i.error("Unhandled promise rejection",n)}),t._h=R||C(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},C=function(t){return 1!==t._h&&0===(t._a||t._c).length},N=function(t){v.call(h,function(){var e;R?x.emit("rejectionHandled",t):(e=h.onrejectionhandled)&&e({promise:t,reason:t._v})})},q=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),j(e,!0))},D=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw S("Promise can't be resolved itself");(e=P(t))?y(function(){var i={_w:r,_d:!1};try{e.call(t,u(D,i,1),u(q,i,1))}catch(t){q.call(i,t)}}):(r._v=t,r._s=1,j(r,!1))}catch(t){q.call({_w:r,_d:!1},t)}}};T||(k=function(t){p(this,k,"Promise","_h"),l(t),i.call(this);try{t(u(D,this,1),u(q,this,1))}catch(t){q.call(this,t)}},(i=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(128)(k.prototype,{then:function(t,e){var r=I(b(this,k));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=R?x.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&j(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new i;this.promise=t,this.resolve=u(D,t,1),this.reject=u(q,t,1)},g.f=I=function(t){return t===k||t===a?new o(t):n(t)}),c(c.G+c.W+c.F*!T,{Promise:k}),r(35)(k,"Promise"),r(129)("Promise"),a=r(7).Promise,c(c.S+c.F*!T,"Promise",{reject:function(t){var e=I(this);return(0,e.reject)(t),e.promise}}),c(c.S+c.F*(s||!T),"Promise",{resolve:function(t){return _(s&&this===a?k:this,t)}}),c(c.S+c.F*!(T&&r(130)(function(t){k.all(t).catch(B)})),"Promise",{all:function(t){var e=this,r=I(e),i=r.resolve,n=r.reject,o=w(function(){var r=[],o=0,a=1;m(t,!1,function(t){var s=o++,h=!1;r.push(void 0),a++,e.resolve(t).then(function(t){h||(h=!0,r[s]=t,--a||i(r))},n)}),--a||i(r)});return o.e&&n(o.v),r.promise},race:function(t){var e=this,r=I(e),i=r.reject,n=w(function(){m(t,!1,function(t){e.resolve(t).then(r.resolve,i)})});return n.e&&i(n.v),r.promise}})},function(t,e){t.exports=function(t,e,r,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,e,r){var i=r(22),n=r(123),o=r(124),a=r(8),s=r(49),h=r(56),u={},f={};(e=t.exports=function(t,e,r,c,d){var l,p,m,b,v=d?function(){return t}:h(t),y=i(r,c,e?2:1),g=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(l=s(t.length);l>g;g++)if((b=e?y(a(p=t[g])[0],p[1]):y(t[g]))===u||b===f)return b}else for(m=v.call(t);!(p=m.next()).done;)if((b=n(m,y,p.value,e))===u||b===f)return b}).BREAK=u,e.RETURN=f},function(t,e,r){var i=r(8);t.exports=function(t,e,r,n){try{return n?e(i(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(t,e,r){var i=r(16),n=r(3)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[n]===t)}},function(t,e){t.exports=function(t,e,r){var i=void 0===r;switch(e.length){case 0:return i?t():t.call(r);case 1:return i?t(e[0]):t.call(r,e[0]);case 2:return i?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){var i=r(2),n=r(58).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,h="process"==r(27)(a);t.exports=function(){var t,e,r,u=function(){var i,n;for(h&&(i=a.domain)&&i.exit();t;){n=t.fn,t=t.next;try{n()}catch(i){throw t?r():e=void 0,i}}e=void 0,i&&i.enter()};if(h)r=function(){a.nextTick(u)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var f=s.resolve(void 0);r=function(){f.then(u)}}else r=function(){n.call(i,u)};else{var c=!0,d=document.createTextNode("");new o(u).observe(d,{characterData:!0}),r=function(){d.data=c=!c}}return function(i){var n={fn:i,next:void 0};e&&(e.next=n),t||(t=n,r()),e=n}}},function(t,e,r){var i=r(2).navigator;t.exports=i&&i.userAgent||""},function(t,e,r){var i=r(10);t.exports=function(t,e,r){for(var n in e)r&&t[n]?t[n]=e[n]:i(t,n,e[n]);return t}},function(t,e,r){"use strict";var i=r(2),n=r(7),o=r(24),a=r(15),s=r(3)("species");t.exports=function(t){var e="function"==typeof n[t]?n[t]:i[t];a&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,r){var i=r(3)("iterator"),n=!1;try{var o=[7][i]();o.return=function(){n=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:r=!0}},o[i]=function(){return a},t(o)}catch(t){}return r}},function(t,e,r){"use strict";var i=r(13),n=r(7),o=r(2),a=r(57),s=r(60);i(i.P+i.R,"Promise",{finally:function(t){var e=a(this,n.Promise||o.Promise),r="function"==typeof t;return this.then(r?function(r){return s(e,t()).then(function(){return r})}:t,r?function(r){return s(e,t()).then(function(){throw r})}:t)}})},function(t,e,r){"use strict";var i=r(13),n=r(36),o=r(59);i(i.S,"Promise",{try:function(t){var e=n.f(this),r=o(t);return(r.e?e.reject:e.resolve)(r.v),e.promise}})},function(t,e,r){t.exports={default:r(134),__esModule:!0}},function(t,e,r){r(54),r(44),t.exports=r(135)},function(t,e,r){var i=r(8),n=r(56);t.exports=r(7).getIterator=function(t){var e=n(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,r){t.exports={default:r(137),__esModule:!0}},function(t,e,r){r(138),t.exports=r(7).Object.values},function(t,e,r){var i=r(13),n=r(139)(!1);i(i.S,"Object",{values:function(t){return n(t)}})},function(t,e,r){var i=r(48),n=r(26),o=r(140).f;t.exports=function(t){return function(e){for(var r,a=n(e),s=i(a),h=s.length,u=0,f=[];h>u;)o.call(a,r=s[u++])&&f.push(t?[r,a[r]]:a[r]);return f}}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){"use strict";var i=r(142);function n(t,e){if(!(this instanceof n))throw new Error('[ethjs-provider-http] the HttpProvider instance requires the "new" flag in order to function normally (e.g. `const eth = new Eth(new HttpProvider());`).');if("string"!=typeof t)throw new Error('[ethjs-provider-http] the HttpProvider instance requires that the host be specified (e.g. `new HttpProvider("http://localhost:8545")` or via service like infura `new HttpProvider("http://ropsten.infura.io")`)');this.host=t,this.timeout=e||0}n.prototype.sendAsync=function(t,e){var r=this,n=new i;n.timeout=r.timeout,n.open("POST",r.host,!0),n.setRequestHeader("Content-Type","application/json"),n.onreadystatechange=function(){if(4===n.readyState&&1!==n.timeout){var t=n.responseText,i=null;try{t=JSON.parse(t)}catch(t){i=function(t,e){var r=new Error("[ethjs-provider-http] Invalid JSON RPC response from provider\n    host: "+e+"\n    response: "+String(t.responseText)+" "+JSON.stringify(t.responseText,null,2)+"\n    responseURL: "+t.responseURL+"\n    status: "+t.status+"\n    statusText: "+t.statusText+"\n  ");return r.value=t,r}(n,r.host)}e(i,t)}},n.ontimeout=function(){e("[ethjs-provider-http] CONNECTION TIMEOUT: http request timeout after "+r.timeout+" ms. (i.e. your connect has timed out for whatever reason, check your provider).",null)};try{n.send(JSON.stringify(t))}catch(t){e("[ethjs-provider-http] CONNECTION ERROR: Couldn't connect to node '"+r.host+"': "+JSON.stringify(t,null,2),null)}},t.exports=n},function(t,e){t.exports=XMLHttpRequest},function(t,e,r){"use strict";var i=r(144),n=r(148),o=r(61);function a(t,e){var r=e||{};if(!(this instanceof a))throw new Error('[ethjs-query] the Eth object requires the "new" flag in order to function normally (i.e. `const eth = new Eth(provider);`).');if("object"!=typeof t)throw new Error("[ethjs-query] the Eth object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new Eth(provider);')");this.options=Object.assign({debug:r.debug||!1,logger:r.logger||console,jsonSpace:r.jsonSpace||0}),this.rpc=new n(t),this.setProvider=this.rpc.setProvider}function s(t,e){return function(){var r=null,n=null,a=this,s=[].slice.call(arguments),h=t.replace("eth_","");s.length>0&&"function"==typeof s[s.length-1]&&(r=s.pop());var u=function(){var r=this;return new Promise(function(o,u){if(s.length<e[2])u(new Error("[ethjs-query] method '"+h+"' requires at least "+e[2]+" input (format type "+e[0][0]+"), "+s.length+" provided. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+t.toLowerCase()));else if(s.length>e[0].length)u(new Error("[ethjs-query] method '"+h+"' requires at most "+e[0].length+" params, "+s.length+" provided '"+JSON.stringify(s,null,a.options.jsonSpace)+"'. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+t.toLowerCase()));else{e[3]&&s.length<e[3]&&s.push("latest"),r.log("attempting method formatting for '"+h+"' with inputs "+JSON.stringify(s,null,r.options.jsonSpace));try{n=i.formatInputs(t,s),r.log("method formatting success for '"+h+"' with formatted result: "+JSON.stringify(n,null,r.options.jsonSpace))}catch(t){return void u(new Error("[ethjs-query] while formatting inputs '"+JSON.stringify(s,null,r.options.jsonSpace)+"' for method '"+h+"' error: "+t))}r.rpc.sendAsync({method:t,params:n}).then(function(e){try{r.log("attempting method formatting for '"+h+"' with raw outputs: "+JSON.stringify(e,null,r.options.jsonSpace));var n=i.formatOutputs(t,e);return r.log("method formatting success for '"+h+"' formatted result: "+JSON.stringify(n,null,r.options.jsonSpace)),void o(n)}catch(t){var a=new Error("[ethjs-query] while formatting outputs from RPC '"+JSON.stringify(e,null,r.options.jsonSpace)+"' for method '"+h+"' "+t);return void u(a)}}).catch(function(t){var e=new Error("[ethjs-query] while formatting outputs from RPC '"+JSON.stringify(t,null,r.options.jsonSpace)+"'");u(e)})}})}.call(this);return r?o(u)(r):u}}t.exports=a,a.prototype.log=function(t){this.options.debug&&this.options.logger.log("[ethjs-query log] "+t)},Object.keys(i.schema.methods).forEach(function(t){Object.defineProperty(a.prototype,t.replace("eth_",""),{enumerable:!0,value:s(t,i.schema.methods[t])})})},function(t,e,r){"use strict";var i=r(145),n=r(146),o=r(38),a=r(28),s=n.padToEven,h=n.arrayContainsArray,u=n.getBinarySize;function f(t,e,r){if(-1===["string","number","object"].indexOf(typeof t)||null===t)return t;var i=o(t),n=r&&i.toString(16).length%2?"0":"";if(o(t).isNeg())throw new Error("[ethjs-format] while formatting quantity '"+i.toString(10)+"', invalid negative number. Number must be positive or zero.");return e?"0x"+n+i.toString(16):i}function c(t,e){var r=t;return-1===i.tags.indexOf(t)&&(r=f(t,e)),r}function d(t,e){var r=t,i=0;if("string"==typeof t&&(r="0x"+s(a(t)),i=u(r)),"0x00"===r&&(r="0x0"),"number"==typeof e&&null!==t&&"0x"!==r&&"0x0"!==r&&(!/^[0-9A-Fa-f]+$/.test(a(r))||i!==2+2*e))throw new Error("[ethjs-format] hex string '"+r+"' must be an alphanumeric "+(2+2*e)+" utf8 byte hex (chars: a-fA-F) string, is "+i+" bytes");return r}function l(t,e,r){var n=Object.assign({},e),o=null;if("string"==typeof t&&(o="Boolean|EthSyncing"===t?Object.assign({},i.objects.EthSyncing):"DATA|Transaction"===t?Object.assign({},i.objects.Transaction):Object.assign({},i.objects[t])),!h(Object.keys(e),o.__required))throw new Error("[ethjs-format] object "+JSON.stringify(e)+" must contain properties: "+o.__required.join(", "));return Object.keys(o).forEach(function(t){"__required"!==t&&void 0!==e[t]&&(n[t]=m(o[t],e[t],r))}),n}function p(t,e,r,i){var n=e.slice(),o=t;if("Array|DATA"===t&&(o=["D"]),"FilterChange"===t&&"string"==typeof e[0]&&(o=["D32"]),!0===r&&"number"==typeof i&&e.length<i)throw new Error("array "+JSON.stringify(e)+" must contain at least "+i+" params, but only contains "+e.length+".");return o=o.slice(),e.forEach(function(t,e){var i=0;o.length>1&&(i=e),n[e]=m(o[i],t,r)}),n}function m(t,e,r,i){var n=e;return"Q"===t?n=f(e,r):"QP"===t?n=f(e,r,!0):"Q|T"===t?n=c(e,r):"D"===t?n=d(e):"D20"===t?n=d(e,20):"D32"===t?n=d(e,32):"object"==typeof e&&null!==e&&!1===Array.isArray(e)?n=l(t,e,r):Array.isArray(e)&&(n=p(t,e,r,i)),n}t.exports={schema:i,formatQuantity:f,formatQuantityOrTag:c,formatObject:l,formatArray:p,format:m,formatInputs:function(t,e){return m(i.methods[t][0],e,!0,i.methods[t][2])},formatOutputs:function(t,e){return m(i.methods[t][1],e,!1)}}},function(t){t.exports={methods:{web3_clientVersion:[[],"S"],web3_sha3:[["S"],"D",1],net_version:[[],"S"],net_peerCount:[[],"Q"],net_listening:[[],"B"],personal_sign:[["D","D20","S"],"D",2],personal_ecRecover:[["D","D"],"D20",2],eth_protocolVersion:[[],"S"],eth_syncing:[[],"B|EthSyncing"],eth_coinbase:[[],"D20"],eth_mining:[[],"B"],eth_hashrate:[[],"Q"],eth_gasPrice:[[],"Q"],eth_accounts:[[],["D20"]],eth_blockNumber:[[],"Q"],eth_getBalance:[["D20","Q|T"],"Q",1,2],eth_getStorageAt:[["D20","Q","Q|T"],"D",2,2],eth_getTransactionCount:[["D20","Q|T"],"Q",1,2],eth_getBlockTransactionCountByHash:[["D32"],"Q",1],eth_getBlockTransactionCountByNumber:[["Q|T"],"Q",1],eth_getUncleCountByBlockHash:[["D32"],"Q",1],eth_getUncleCountByBlockNumber:[["Q"],"Q",1],eth_getCode:[["D20","Q|T"],"D",1,2],eth_sign:[["D20","D"],"D",2],eth_signTypedData:[["Array|DATA","D20"],"D",1],eth_sendTransaction:[["SendTransaction"],"D",1],eth_sendRawTransaction:[["D"],"D32",1],eth_call:[["CallTransaction","Q|T"],"D",1,2],eth_estimateGas:[["EstimateTransaction","Q|T"],"Q",1],eth_getBlockByHash:[["D32","B"],"Block",2],eth_getBlockByNumber:[["Q|T","B"],"Block",2],eth_getTransactionByHash:[["D32"],"Transaction",1],eth_getTransactionByBlockHashAndIndex:[["D32","Q"],"Transaction",2],eth_getTransactionByBlockNumberAndIndex:[["Q|T","Q"],"Transaction",2],eth_getTransactionReceipt:[["D32"],"Receipt",1],eth_getUncleByBlockHashAndIndex:[["D32","Q"],"Block",1],eth_getUncleByBlockNumberAndIndex:[["Q|T","Q"],"Block",2],eth_getCompilers:[[],["S"]],eth_compileLLL:[["S"],"D",1],eth_compileSolidity:[["S"],"D",1],eth_compileSerpent:[["S"],"D",1],eth_newFilter:[["Filter"],"Q",1],eth_newBlockFilter:[[],"Q"],eth_newPendingTransactionFilter:[[],"Q"],eth_uninstallFilter:[["QP"],"B",1],eth_getFilterChanges:[["QP"],["FilterChange"],1],eth_getFilterLogs:[["QP"],["FilterChange"],1],eth_getLogs:[["Filter"],["FilterChange"],1],eth_getWork:[[],["D"]],eth_submitWork:[["D","D32","D32"],"B",3],eth_submitHashrate:[["D","D"],"B",2],db_putString:[["S","S","S"],"B",2],db_getString:[["S","S"],"S",2],db_putHex:[["S","S","D"],"B",2],db_getHex:[["S","S"],"D",2],shh_post:[["SHHPost"],"B",1],shh_version:[[],"S"],shh_newIdentity:[[],"D"],shh_hasIdentity:[["D"],"B"],shh_newGroup:[[],"D"],shh_addToGroup:[["D"],"B",1],shh_newFilter:[["SHHFilter"],"Q",1],shh_uninstallFilter:[["Q"],"B",1],shh_getFilterChanges:[["Q"],["SHHFilterChange"],1],shh_getMessages:[["Q"],["SHHFilterChange"],1]},tags:["latest","earliest","pending"],objects:{EthSyncing:{__required:[],startingBlock:"Q",currentBlock:"Q",highestBlock:"Q"},SendTransaction:{__required:["from","data"],from:"D20",to:"D20",gas:"Q",gasPrice:"Q",value:"Q",data:"D",nonce:"Q"},EstimateTransaction:{__required:[],from:"D20",to:"D20",gas:"Q",gasPrice:"Q",value:"Q",data:"D",nonce:"Q"},CallTransaction:{__required:["to"],from:"D20",to:"D20",gas:"Q",gasPrice:"Q",value:"Q",data:"D",nonce:"Q"},Block:{__required:[],number:"Q",hash:"D32",parentHash:"D32",nonce:"D",sha3Uncles:"D",logsBloom:"D",transactionsRoot:"D",stateRoot:"D",receiptsRoot:"D",miner:"D",difficulty:"Q",totalDifficulty:"Q",extraData:"D",size:"Q",gasLimit:"Q",gasUsed:"Q",timestamp:"Q",transactions:["DATA|Transaction"],uncles:["D"]},Transaction:{__required:[],hash:"D32",nonce:"Q",blockHash:"D32",blockNumber:"Q",transactionIndex:"Q",from:"D20",to:"D20",value:"Q",gasPrice:"Q",gas:"Q",input:"D"},Receipt:{__required:[],transactionHash:"D32",transactionIndex:"Q",blockHash:"D32",blockNumber:"Q",cumulativeGasUsed:"Q",gasUsed:"Q",contractAddress:"D20",logs:["FilterChange"]},Filter:{__required:[],fromBlock:"Q|T",toBlock:"Q|T",address:"D20",topics:["D"]},FilterChange:{__required:[],removed:"B",logIndex:"Q",transactionIndex:"Q",transactionHash:"D32",blockHash:"D32",blockNumber:"Q",address:"D20",data:"Array|DATA",topics:["D"]},SHHPost:{__required:["topics","payload","priority","ttl"],from:"D",to:"D",topics:["D"],payload:"D",priority:"Q",ttl:"Q"},SHHFilter:{__required:["topics"],to:"D",topics:["D"]},SHHFilterChange:{__required:[],hash:"D",from:"D",to:"D",expiry:"Q",ttl:"Q",sent:"Q",topics:["D"],payload:"D",workProved:"Q"},SHHMessage:{__required:[],hash:"D",from:"D",to:"D",expiry:"Q",ttl:"Q",sent:"Q",topics:["D"],payload:"D",workProved:"Q"}}}},function(t,e,r){"use strict";(function(e){var i=r(37),n=r(28);function o(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function a(t){return"0x"+o(t.toString(16))}t.exports={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"](function(e){return t.indexOf(e)>=0})},intToBuffer:function(t){var r=a(t);return e.from(r.slice(2),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return e.byteLength(t,"utf8")},isHexPrefixed:i,stripHexPrefix:n,padToEven:o,intToHex:a,fromAscii:function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r).toString(16);e+=i.length<2?"0"+i:i}return"0x"+e},fromUtf8:function(t){return"0x"+o(new e(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(t){var e="",r=0,i=t.length;for("0x"===t.substring(0,2)&&(r=2);r<i;r+=2){var n=parseInt(t.substr(r,2),16);e+=String.fromCharCode(n)}return e},toUtf8:function(t){return new e(o(n(t).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(t,e,r){if(!Array.isArray(t))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof t+"'");if("string"!=typeof e)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof e+"'.");for(var i=[],n=0;n<t.length;n++){var o=t[n][e];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");i.push(o)}return i},isHexString:function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}}}).call(this,r(0).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(t){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var a=t.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){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):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("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 n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=i)u=h(t,f,f+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=h(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],h=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:u[d-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,h="le"===e,u=new t(o),f=this.clone();if(h){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-n;s++)u[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;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?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a<i.length;a++)o=(e=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,a=t.words,s=e.words,h=r.words,u=0,f=0|a[0],c=8191&f,d=f>>>13,l=0|a[1],p=8191&l,m=l>>>13,b=0|a[2],v=8191&b,y=b>>>13,g=0|a[3],w=8191&g,M=g>>>13,_=0|a[4],S=8191&_,x=_>>>13,A=0|a[5],E=8191&A,k=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],P=8191&T,j=T>>>13,O=0|a[8],C=8191&O,N=O>>>13,q=0|a[9],D=8191&q,H=q>>>13,z=0|s[0],L=8191&z,U=z>>>13,F=0|s[1],K=8191&F,J=F>>>13,Z=0|s[2],Q=8191&Z,Y=Z>>>13,X=0|s[3],W=8191&X,V=X>>>13,G=0|s[4],$=8191&G,tt=G>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],ct=8191&ft,dt=ft>>>13,lt=0|s[9],pt=8191&lt,mt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,U))+Math.imul(d,L)|0))<<13)|0;u=((o=Math.imul(d,U))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,U))+Math.imul(m,L)|0,o=Math.imul(m,U);var vt=(u+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(y,L)|0,o=Math.imul(y,U),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,J)|0;var yt=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,U))+Math.imul(M,L)|0,o=Math.imul(M,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0;var gt=(u+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,U))+Math.imul(x,L)|0,o=Math.imul(x,U),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var wt=(u+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(k,L)|0,o=Math.imul(k,U),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(I,L)|0,o=Math.imul(I,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(j,L)|0,o=Math.imul(j,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,V)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,U))+Math.imul(N,L)|0,o=Math.imul(N,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,Y)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(H,L)|0,o=Math.imul(H,U),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,i=i+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var At=(u+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,J))+Math.imul(H,K)|0,o=Math.imul(H,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var Et=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,Y))+Math.imul(H,Q)|0,o=Math.imul(H,Y),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var kt=(u+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,V))+Math.imul(H,W)|0,o=Math.imul(H,V),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Rt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,tt))+Math.imul(H,$)|0,o=Math.imul(H,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(H,rt)|0,o=Math.imul(H,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var It=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(H,ot)|0,o=Math.imul(H,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(H,ht)|0,o=Math.imul(H,ut),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Pt=(u+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,h[0]=bt,h[1]=vt,h[2]=yt,h[3]=gt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=At,h[10]=Et,h[11]=kt,h[12]=Rt,h[13]=Bt,h[14]=It,h[15]=Tt,h[16]=Pt,h[17]=jt,h[18]=Ot,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),d=67108863&c;s=67108863&(d=d+s|0),n+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a<o;a++)i[a]=e[t[a]],n[a]=r[t[a]]},m.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,h=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=h,d=u,l=0;l<a;l++){var p=r[f+l],m=i[f+l],b=r[f+l+a],v=i[f+l+a],y=c*b-d*v;v=c*v+d*b,b=y,r[f+l]=p+b,i[f+l]=m+v,r[f+l+a]=p-b,i[f+l+a]=m-v,l!==s&&(y=h*c-u*d,d=h*d+u*c,c=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,e,r,n){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<n;++a)r[a]=0;i(0===o),i(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),h=new Array(i),u=new Array(i),f=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,u,i),this.transform(a,o,s,h,i,n),this.transform(u,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-h[l]*c[l];h[l]=s[l]*c[l]+h[l]*f[l],s[l]=p}return this.conjugate(s,h,i),this.transform(s,h,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,h=(0|this.words[e])-s<<r;this.words[e]=h|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,h=r;if(n-=a,n=Math.max(0,n),h){for(var u=0;u<a;u++)h.words[u]=this.words[u];h.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-o|c>>>o,f=c&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(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)},o.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},o.prototype.isubn=function(t){if(i("number"==typeof t),i(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,a=t.length+r;this._expand(a);var s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+s;var h=(0|t.words[n])*e;s=((o-=67108863&h)>>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=i.clone()._ishlnsubmul(n,1,h);0===f.negative&&(i=f,s&&(s.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(c)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(c)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(g,v),n(w,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var c=this.pow(f,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=a;0!==l.cmp(s);){for(var m=l,b=0;0!==m.cmp(s);b++)m=m.redSqr();i(b<p);var v=this.pow(c,new o(1).iushln(p-b-1));d=d.redMul(v),c=v.redSqr(),l=l.redMul(c),p=b}return d},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new o(1);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],a=0,s=0,h=e.bitLength()%26;for(0===h&&(h=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var c=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";var i=r(61);function n(t,e){var r=this,i=e||{};if(!(this instanceof n))throw new Error('[ethjs-rpc] the EthRPC object requires the "new" flag in order to function normally (i.e. `const eth = new EthRPC(provider);`).');r.options=Object.assign({jsonSpace:i.jsonSpace||0,max:i.max||9999999999999}),r.idCounter=Math.floor(Math.random()*r.options.max),r.setProvider=function(t){if("object"!=typeof t)throw new Error("[ethjs-rpc] the EthRPC object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new EthRPC(provider);')");r.currentProvider=t},r.setProvider(t)}t.exports=n,n.prototype.sendAsync=function(t,e){var r=this;r.idCounter=r.idCounter%r.options.max;var n,o,a=(n=t,o=r.idCounter++,Object.assign({},{id:o,jsonrpc:"2.0",params:[]},n)),s=new Promise(function(t,e){r.currentProvider.sendAsync(a,function(i,n){var o=n||{};if(i||o.error){var s="[ethjs-rpc] "+(o.error?"rpc":"")+" error with payload "+JSON.stringify(a,null,r.options.jsonSpace)+" "+(i?String(i):JSON.stringify(o.error,null,r.options.jsonSpace)),h=new Error(s);return h.value=i||o.error,void e(h)}t(o.result)})});return e?i(s)(e):s}},function(t,e,r){"use strict";var i=Object.prototype.toString;t.exports=function(t){return"[object Function]"===i.call(t)}},function(t,e,r){"use strict";(function(e){t.exports="function"==typeof e?e:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}}).call(this,r(151).setImmediate)},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(152),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(6))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var i,n,o,a,s,h=1,u={},f=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){p(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},i=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,i=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):i=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(a+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var n={callback:t,args:e};return u[h]=n,i(h),h++},d.clearImmediate=l}function l(t){delete u[t]}function p(t){if(f)setTimeout(p,0,t);else{var e=u[t];if(e){f=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(r,i)}}(e)}finally{l(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(6),r(11))},function(t,e,r){"use strict";(function(e){var i=r(154),n=i.uint256Coder,o=(i.coderBoolean,i.coderFixedBytes,i.coderAddress,i.coderDynamicBytes,i.coderString,i.coderArray,i.paramTypePart,i.getParamCoder);function a(){}function s(t,r){if(t.length!==r.length)throw new Error("[ethjs-abi] while encoding params, types/values mismatch, Your contract requires "+t.length+" types (arguments), and you passed in "+r.length);var i=[];function a(t){return parseInt(32*Math.ceil(t/32))}t.forEach(function(t,e){var n=o(t);i.push({dynamic:n.dynamic,value:n.encode(r[e])})});var s=0,h=0;i.forEach(function(t){t.dynamic?(s+=32,h+=a(t.value.length)):s+=a(t.value.length)});var u=0,f=s,c=new e(s+h);return i.forEach(function(t,e){t.dynamic?(n.encode(f).copy(c,u),u+=32,t.value.copy(c,f),f+=a(t.value.length)):(t.value.copy(c,u),u+=a(t.value.length))}),"0x"+c.toString("hex")}function h(t,e,r){var s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];arguments.length<3&&(r=e,e=t,t=[]),r=i.hexOrBuffer(r);var h=new a,u=0;return e.forEach(function(e,i){var a=o(e);if(a.dynamic){var f=n.decode(r,u),c=a.decode(r,f.value.toNumber());u+=f.consumed}else{c=a.decode(r,u);u+=c.consumed}s&&(h[i]=c.value),t[i]&&(h[t[i]]=c.value)}),h}function u(t){var r=t.name+"("+i.getKeys(t.inputs,"type").join(",")+")";return"0x"+new e(i.keccak256(r),"hex").slice(0,4).toString("hex")}function f(t,e){var r=s(i.getKeys(t.inputs,"type"),e).substring(2);return""+u(t)+r}function c(t){var e=t.name+"("+i.getKeys(t.inputs,"type").join(",")+")";return"0x"+i.keccak256(e)}function d(t,r,n){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=t.inputs.filter(function(t){return!t.indexed}),u=h(i.getKeys(s,"name",!0),i.getKeys(s,"type"),i.hexOrBuffer(r),a),f=t.anonymous?0:1;return t.inputs.filter(function(t){return t.indexed}).map(function(t,r){var i=new e(n[r+f].slice(2),"hex"),a=o(t.type);u[t.name]=a.decode(i,0).value}),u._eventName=t.name,u}function l(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&e.topics[0]===c(t))return d(t,e.data,e.topics,r)}t.exports={encodeParams:s,decodeParams:h,encodeMethod:f,decodeMethod:function(t,e){return h(i.getKeys(t.outputs,"name",!0),i.getKeys(t.outputs,"type"),i.hexOrBuffer(e))},encodeEvent:function(t,e){return f(t,e)},decodeEvent:d,decodeLogItem:l,logDecoder:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};return t.filter(function(t){return"event"===t.type}).map(function(t){r[c(t)]=t}),function(t){return t.map(function(t){return l(r[t.topics[0]],t,e)}).filter(function(t){return t})}},eventSignature:c,encodeSignature:u}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var i=r(155),n=r(38),o=r(156).keccak_256;function a(t){for(var e=t,r=e[0];e.length>0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e}function s(t){var r=t.toString(16);return r.length%2&&(r="0"+r),a(new e(r,"hex"))}function h(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function u(t,r){var i=t;if(!e.isBuffer(i)){if(!h(i)){var n=new Error(r?"[ethjs-abi] invalid "+r:"[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string");throw n.reason="[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)",n.value=i,n}(i=i.substring(2)).length%2&&(i="0"+i),i=new e(i,"hex")}return i}function f(t,r){return{encode:function(i){var o=i;return"object"==typeof o&&o.toString&&(o.toTwos||o.dividedToIntegerBy)&&(o=o.toString(10).split(".")[0]),"string"!=typeof o&&"number"!=typeof o||(o=String(o).split(".")[0]),o=(o=n(o)).toTwos(8*t).maskn(8*t),r&&(o=o.fromTwos(8*t).toTwos(256)),o.toArrayLike(e,"be",32)},decode:function(e,n){var o=32-t,a=new i(e.slice(n+o,n+32));return a=r?a.fromTwos(8*t):a.maskn(8*t),{consumed:32,value:new i(a.toString(10))}}}}var c=f(32,!1),d={encode:function(t){return c.encode(t?1:0)},decode:function(t,e){var r=c.decode(t,e);return{consumed:r.consumed,value:!r.value.isZero()}}};function l(t){return{encode:function(t){var r=t;if(32===(r=u(r)).length)return r;var i=new e(32);return i.fill(0),r.copy(i),i},decode:function(e,r){if(0!==e.length&&e.length<r+32)throw new Error("[ethjs-abi] while decoding fixed bytes, invalid bytes data length: "+t);return{consumed:32,value:"0x"+e.slice(r,r+t).toString("hex")}}}}var p={encode:function(t){var r=t,i=new e(32);if(!h(r,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return r=u(r),i.fill(0),r.copy(i,12),i},decode:function(t,e){if(0===t.length)return{consumed:32,value:"0x"};if(0!==t.length&&t.length<e+32)throw new Error("[ethjs-abi] while decoding address data, invalid address data, invalid byte length "+t.length);return{consumed:32,value:"0x"+t.slice(e+12,e+32).toString("hex")}}};function m(t){var r=parseInt(32*Math.ceil(t.length/32)),i=new e(r-t.length);return i.fill(0),e.concat([c.encode(t.length),t,i])}function b(t,e){if(0!==t.length&&t.length<e+32)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+t.length+" should be less than "+(e+32));var r=c.decode(t,e).value;if(r=r.toNumber(),0!==t.length&&t.length<e+32+r)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+t.length+" should be less than "+(e+32+r));return{consumed:parseInt(32+32*Math.ceil(r/32),10),value:t.slice(e+32,e+32+r)}}var v={encode:function(t){return m(u(t))},decode:function(t,e){var r=b(t,e);return r.value="0x"+r.value.toString("hex"),r},dynamic:!0},y={encode:function(t){return m(new e(t,"utf8"))},decode:function(t,e){var r=b(t,e);return r.value=r.value.toString("utf8"),r},dynamic:!0};function g(t,r){return{encode:function(i){var n=new e(0),o=r;if(!Array.isArray(i))throw new Error("[ethjs-abi] while encoding array, invalid array data, not type Object (Array)");if(-1===o&&(o=i.length,n=c.encode(o)),o!==i.length)throw new Error("[ethjs-abi] while encoding array, size mismatch array length "+o+" does not equal "+i.length);return i.forEach(function(r){n=e.concat([n,t.encode(r)])}),n},decode:function(e,i){var n,o=r,a=i,s=0;-1===o&&(o=(n=c.decode(e,a)).value.toNumber(),s+=n.consumed,a+=n.consumed);for(var h=[],u=0;u<o;u++){var f=t.decode(e,a);s+=f.consumed,a+=f.consumed,h.push(f.value)}return{consumed:s,value:h}},dynamic:-1===r}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:i,bnToBuffer:s,isHexString:h,hexOrBuffer:u,hexlify:function(t){return"number"==typeof t?"0x"+s(new i(t)).toString("hex"):t.mod||t.modulo?"0x"+s(t).toString("hex"):"0x"+u(t).toString("hex")},stripZeros:a,keccak256:o,getKeys:function(t,e,r){var i=[];if(!Array.isArray(t))throw new Error("[ethjs-abi] while getting keys, invalid params value "+JSON.stringify(t));for(var n=0;n<t.length;n++){var o=t[n][e];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("[ethjs-abi] while getKeys found invalid ABI data structure, type value not string");i.push(o)}return i},numberToBN:n,coderNumber:f,uint256Coder:c,coderBoolean:d,coderFixedBytes:l,coderAddress:p,coderDynamicBytes:v,coderString:y,coderArray:g,paramTypePart:w,getParamCoder:function(t){for(var e=t,r=null,i="[ethjs-abi] while getting param coder (getParamCoder) type value "+JSON.stringify(e)+" is either invalid or unsupported by ethjs-abi.";e;){var n=e.match(w);if(!n)throw new Error(i);e=e.substring(n[0].length);var o=n[2]||n[4]||n[5];switch(o){case"int":case"uint":if(r)throw new Error(i);var a=parseInt(n[3]||256);if(0===a||a>256||a%8!=0)throw new Error("[ethjs-abi] while getting param coder for type "+e+", invalid "+o+"<N> width: "+e);r=f(a/8,"int"===o);break;case"bool":if(r)throw new Error(i);r=d;break;case"string":if(r)throw new Error(i);r=y;break;case"bytes":if(r)throw new Error(i);if(n[3]){var s=parseInt(n[3]);if(0===s||s>32)throw new Error("[ethjs-abi] while getting param coder for prefix bytes, invalid type "+e+", size "+s+" should be 0 or greater than 32");r=l(s)}else r=v;break;case"address":if(r)throw new Error(i);r=p;break;case"[]":if(!r||r.dynamic)throw new Error(i);r=g(r,-1);break;default:if(!r||r.dynamic)throw new Error(i);r=g(r,parseInt(n[6]))}}if(!r)throw new Error(i);return r}}}).call(this,r(0).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(t){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var a=t.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){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):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("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 n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=i)u=h(t,f,f+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=h(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],h=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:u[d-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,h="le"===e,u=new t(o),f=this.clone();if(h){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-n;s++)u[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;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?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a<i.length;a++)o=(e=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,a=t.words,s=e.words,h=r.words,u=0,f=0|a[0],c=8191&f,d=f>>>13,l=0|a[1],p=8191&l,m=l>>>13,b=0|a[2],v=8191&b,y=b>>>13,g=0|a[3],w=8191&g,M=g>>>13,_=0|a[4],S=8191&_,x=_>>>13,A=0|a[5],E=8191&A,k=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],P=8191&T,j=T>>>13,O=0|a[8],C=8191&O,N=O>>>13,q=0|a[9],D=8191&q,H=q>>>13,z=0|s[0],L=8191&z,U=z>>>13,F=0|s[1],K=8191&F,J=F>>>13,Z=0|s[2],Q=8191&Z,Y=Z>>>13,X=0|s[3],W=8191&X,V=X>>>13,G=0|s[4],$=8191&G,tt=G>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],ct=8191&ft,dt=ft>>>13,lt=0|s[9],pt=8191&lt,mt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,U))+Math.imul(d,L)|0))<<13)|0;u=((o=Math.imul(d,U))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,U))+Math.imul(m,L)|0,o=Math.imul(m,U);var vt=(u+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(y,L)|0,o=Math.imul(y,U),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,J)|0;var yt=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,U))+Math.imul(M,L)|0,o=Math.imul(M,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0;var gt=(u+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,U))+Math.imul(x,L)|0,o=Math.imul(x,U),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var wt=(u+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(k,L)|0,o=Math.imul(k,U),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(I,L)|0,o=Math.imul(I,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(j,L)|0,o=Math.imul(j,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,V)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,U))+Math.imul(N,L)|0,o=Math.imul(N,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,Y)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(H,L)|0,o=Math.imul(H,U),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,i=i+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var At=(u+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,J))+Math.imul(H,K)|0,o=Math.imul(H,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var Et=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,Y))+Math.imul(H,Q)|0,o=Math.imul(H,Y),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var kt=(u+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,V))+Math.imul(H,W)|0,o=Math.imul(H,V),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Rt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,tt))+Math.imul(H,$)|0,o=Math.imul(H,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(H,rt)|0,o=Math.imul(H,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var It=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(H,ot)|0,o=Math.imul(H,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(H,ht)|0,o=Math.imul(H,ut),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Pt=(u+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,h[0]=bt,h[1]=vt,h[2]=yt,h[3]=gt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=At,h[10]=Et,h[11]=kt,h[12]=Rt,h[13]=Bt,h[14]=It,h[15]=Tt,h[16]=Pt,h[17]=jt,h[18]=Ot,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),d=67108863&c;s=67108863&(d=d+s|0),n+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a<o;a++)i[a]=e[t[a]],n[a]=r[t[a]]},m.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,h=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=h,d=u,l=0;l<a;l++){var p=r[f+l],m=i[f+l],b=r[f+l+a],v=i[f+l+a],y=c*b-d*v;v=c*v+d*b,b=y,r[f+l]=p+b,i[f+l]=m+v,r[f+l+a]=p-b,i[f+l+a]=m-v,l!==s&&(y=h*c-u*d,d=h*d+u*c,c=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,e,r,n){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<n;++a)r[a]=0;i(0===o),i(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),h=new Array(i),u=new Array(i),f=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,u,i),this.transform(a,o,s,h,i,n),this.transform(u,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-h[l]*c[l];h[l]=s[l]*c[l]+h[l]*f[l],s[l]=p}return this.conjugate(s,h,i),this.transform(s,h,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,h=(0|this.words[e])-s<<r;this.words[e]=h|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,h=r;if(n-=a,n=Math.max(0,n),h){for(var u=0;u<a;u++)h.words[u]=this.words[u];h.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-o|c>>>o,f=c&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(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)},o.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},o.prototype.isubn=function(t){if(i("number"==typeof t),i(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,a=t.length+r;this._expand(a);var s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+s;var h=(0|t.words[n])*e;s=((o-=67108863&h)>>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=i.clone()._ishlnsubmul(n,1,h);0===f.negative&&(i=f,s&&(s.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(c)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(c)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(g,v),n(w,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var c=this.pow(f,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=a;0!==l.cmp(s);){for(var m=l,b=0;0!==m.cmp(s);b++)m=m.redSqr();i(b<p);var v=this.pow(c,new o(1).iushln(p-b-1));d=d.redMul(v),c=v.redSqr(),l=l.redMul(c),p=b}return d},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new o(1);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],a=0,s=0,h=e.bitLength()%26;for(0===h&&(h=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var c=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){(function(e,r){
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.5.5
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2016
 * @license MIT
 */
!function(i){"use strict";"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_TEST&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[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],h=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],f=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=f(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:d},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new g(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=c(t,e,n)}return r}}],p={},m=0;m<l.length;++m)for(var b=l[m],v=b.bits,y=0;y<v.length;++y)p[b.name+"_"+v[y]]=b.createMethod(v[y],b.padding);function g(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor==i.ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,o=t.length,s=this.blocks,h=this.byteCount,u=this.blockCount,f=0,c=this.s;f<o;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<u+1;++r)s[r]=0;if(e)for(r=this.start;f<o&&r<h;++f)s[r>>2]|=t[f]<<a[3&r++];else for(r=this.start;f<o&&r<h;++f)(n=t.charCodeAt(f))<128?s[r>>2]|=n<<a[3&r++]:n<2048?(s[r>>2]|=(192|n>>6)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]):n<55296||n>=57344?(s[r>>2]|=(224|n>>12)<<a[3&r++],s[r>>2]|=(128|n>>6&63)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++f)),s[r>>2]|=(240|n>>18)<<a[3&r++],s[r>>2]|=(128|n>>12&63)<<a[3&r++],s[r>>2]|=(128|n>>6&63)<<a[3&r++],s[r>>2]|=(128|63&n)<<a[3&r++]);if(this.lastByteIndex=r,r>=h){for(this.start=r-h,this.block=s[u],r=0;r<u;++r)c[r]^=s[r];w(c),this.reset=!0}else this.start=r}return this},g.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex==this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];w(i)},g.prototype.toString=g.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,a=0,s=0,h="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],h+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];s%e==0&&(w(r),a=0)}return n&&(t=r[a],n>0&&(h+=o[t>>4&15]+o[15&t]),n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(s);for(var h=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)h[a]=r[o];a%e==0&&w(r)}return n&&(h[o]=r[o],t=t.slice(0,s)),t},g.prototype.buffer=g.prototype.arrayBuffer,g.prototype.digest=g.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,a=0,s=0,h=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],h[t]=255&e,h[t+1]=e>>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;s%r==0&&w(i)}return o&&(t=s<<2,e=i[a],o>0&&(h[t]=255&e),o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h};var w=function(t){var e,r,i,n,o,a,h,u,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,E,k,R,B,I,T,P,j,O,C,N,q,D,H,z,L,U,F,K,J,Z,Q,Y,X,W,V,G,$,tt,et,rt,it,nt,ot,at,st,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|d>>>31),r=h^(d<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|p>>>31),r=f^(p<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=d^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],b=t[1],Q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,B=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,V=t[34]<<15|t[35]>>>17,G=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,H=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,Z=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,U=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~v&g,t[1]=b^~y&w,t[10]=A^~k&B,t[11]=E^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~Q&X,t[31]=Z^~Y&W,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=k^~B&T,t[13]=R^~I&P,t[22]=q^~H&L,t[23]=D^~z&U,t[32]=Q^~X&V,t[33]=Y^~W&G,t[42]=it^~ot&st,t[43]=nt^~at&ht,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&j,t[15]=I^~P&O,t[24]=H^~L&F,t[25]=z^~U&K,t[34]=X^~V&$,t[35]=W^~G&tt,t[44]=ot^~st&ut,t[45]=at^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~j&A,t[17]=P^~O&E,t[26]=L^~F&C,t[27]=U^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=j^~A&k,t[19]=O^~E&R,t[28]=F^~C&q,t[29]=K^~N&D,t[38]=$^~J&Q,t[39]=tt^~Z&Y,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(n)t.exports=p;else if(i)for(var M in p)i[M]=p[M]}(this)}).call(this,r(11),r(6))},function(t,e,r){"use strict";var i=r(158),n=r(62).keccak_256,o=r(161),a=r(63).getKeys,s=r(63).arrayContainsArray;function h(t){return!(!("object"==typeof t&&!0===Array.isArray(t)&&t.length>0&&"object"==typeof t[t.length-1])||0!==Object.keys(t[t.length-1]).length&&!s(Object.keys(t[t.length-1]),["from","to","data","value","gasPrice","gas"],!0))}t.exports=function(t){return function(t){return function(e,r,s){if(!Array.isArray(e))throw new Error("[ethjs-contract] Contract ABI must be type Array, got type "+typeof e);if(void 0!==r&&"string"!=typeof r)throw new Error("[ethjs-contract] Contract bytecode must be type String, got type "+typeof r);if(void 0!==s&&"object"!=typeof s)throw new Error("[ethjs-contract] Contract default tx object must be type Object, got type "+typeof e);var u={at:function(u){return new function(){var f=this;f.abi=e||[],f.query=t,f.address=u||"0x",f.bytecode=r||"0x",f.defaultTxObject=s||{},f.filters=new o(t),function(t){return t.filter(function(t){return("function"===t.type||"event"===t.type)&&t.name.length>0})}(e).forEach(function(e){f[e.name]=function(){var r,o,s,u="call",c={},d=function(){},l=[].slice.call(arguments);if("function"==typeof l[l.length-1]&&(d=l.pop()),"function"===e.type)return new Promise(function(r,n){h(l)&&(c=l.pop());var o=Object.assign({},f.defaultTxObject,c,{to:f.address});o.data=i.encodeMethod(e,l),!1===e.constant&&(u="sendTransaction"),t[u](o,function(t,o){if("call"!==u||t)"sendTransaction"!==u||t?(n(t),d(t,null)):(r(o),d(null,o));else try{var a=i.decodeMethod(e,o);r(a),d(null,a)}catch(t){var s=new Error("[ethjs-contract] while formatting incoming raw call data "+JSON.stringify(o)+" "+t);n(s),d(s,null)}})});if("event"===e.type){var p=(r=a(e.inputs,"type",!1),o=["0x"+n(e.name+"("+r.join(",")+")")],s=Object.assign({},l[0])||{},{v:new f.filters.Filter(Object.assign({},s,{decoder:function(t){return i.decodeEvent(e,t,o)},defaultFilterObject:Object.assign({},l[0]||{},{to:f.address,topics:o})}))});if("object"==typeof p)return p.v}}})}},new:function(){var n={},o=function(){},u=[].slice.call(arguments);"function"==typeof u[u.length-1]&&(o=u.pop()),h(u)&&(n=u.pop());var f=function(t){return t.filter(function(t){return"constructor"===t.type})[0]}(e),c=Object.assign({},s,n);if(r&&(c.data=r),f){var d=i.encodeParams(a(f.inputs,"type"),u).substring(2);c.data=""+c.data+d}return t.sendTransaction(c,o)}};return u}}(t)}},function(t,e,r){"use strict";(function(e){var i=r(159),n=i.uint256Coder,o=(i.coderBoolean,i.coderFixedBytes,i.coderAddress,i.coderDynamicBytes,i.coderString,i.coderArray,i.paramTypePart,i.getParamCoder);function a(){}function s(t,r){if(t.length!==r.length)throw new Error("[ethjs-abi] while encoding params, types/values mismatch, Your contract requires "+t.length+" types (arguments), and you passed in "+r.length);var i=[];function a(t){return parseInt(32*Math.ceil(t/32))}t.forEach(function(t,e){var n=o(t);i.push({dynamic:n.dynamic,value:n.encode(r[e])})});var s=0,h=0;i.forEach(function(t){t.dynamic?(s+=32,h+=a(t.value.length)):s+=a(t.value.length)});var u=0,f=s,c=new e(s+h);return i.forEach(function(t,e){t.dynamic?(n.encode(f).copy(c,u),u+=32,t.value.copy(c,f),f+=a(t.value.length)):(t.value.copy(c,u),u+=a(t.value.length))}),"0x"+c.toString("hex")}function h(t,e,r){var s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];arguments.length<3&&(r=e,e=t,t=[]),r=i.hexOrBuffer(r);var h=new a,u=0;return e.forEach(function(e,i){var a=o(e);if(a.dynamic){var f=n.decode(r,u),c=a.decode(r,f.value.toNumber());u+=f.consumed}else{c=a.decode(r,u);u+=c.consumed}s&&(h[i]=c.value),t[i]&&(h[t[i]]=c.value)}),h}function u(t,r){var n=t.name+"("+i.getKeys(t.inputs,"type").join(",")+")";return""+("0x"+new e(i.keccak256(n),"hex").slice(0,4).toString("hex"))+s(i.getKeys(t.inputs,"type"),r).substring(2)}function f(t){var e=t.name+"("+i.getKeys(t.inputs,"type").join(",")+")";return"0x"+i.keccak256(e)}function c(t,r,n){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=t.inputs.filter(function(t){return!t.indexed}),u=h(i.getKeys(s,"name",!0),i.getKeys(s,"type"),i.hexOrBuffer(r),a),f=t.anonymous?0:1;return t.inputs.filter(function(t){return t.indexed}).map(function(t,r){var i=new e(n[r+f].slice(2),"hex"),a=o(t.type);u[t.name]=a.decode(i,0).value}),u._eventName=t.name,u}function d(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&e.topics[0]===f(t))return c(t,e.data,e.topics,r)}t.exports={encodeParams:s,decodeParams:h,encodeMethod:u,decodeMethod:function(t,e){return h(i.getKeys(t.outputs,"name",!0),i.getKeys(t.outputs,"type"),i.hexOrBuffer(e))},encodeEvent:function(t,e){return u(t,e)},decodeEvent:c,decodeLogItem:d,logDecoder:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};return t.filter(function(t){return"event"===t.type}).map(function(t){r[f(t)]=t}),function(t){return t.map(function(t){return d(r[t.topics[0]],t,e)}).filter(function(t){return t})}},eventSignature:f}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var i=r(160),n=r(38),o=r(62).keccak_256;function a(t){for(var e=t,r=e[0];e.length>0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e}function s(t){var r=t.toString(16);return r.length%2&&(r="0"+r),a(new e(r,"hex"))}function h(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function u(t,r){var i=t;if(!e.isBuffer(i)){if(!h(i)){var n=new Error(r?"[ethjs-abi] invalid "+r:"[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string");throw n.reason="[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)",n.value=i,n}(i=i.substring(2)).length%2&&(i="0"+i),i=new e(i,"hex")}return i}function f(t,r){return{encode:function(i){var o=i;return"object"==typeof o&&o.toString&&(o.toTwos||o.dividedToIntegerBy)&&(o=o.toString(10).split(".")[0]),"string"!=typeof o&&"number"!=typeof o||(o=String(o).split(".")[0]),o=(o=n(o)).toTwos(8*t).maskn(8*t),r&&(o=o.fromTwos(8*t).toTwos(256)),o.toArrayLike(e,"be",32)},decode:function(e,n){var o=32-t,a=new i(e.slice(n+o,n+32));return a=r?a.fromTwos(8*t):a.maskn(8*t),{consumed:32,value:new i(a.toString(10))}}}}var c=f(32,!1),d={encode:function(t){return c.encode(t?1:0)},decode:function(t,e){var r=c.decode(t,e);return{consumed:r.consumed,value:!r.value.isZero()}}};function l(t){return{encode:function(t){var r=t;if(32===(r=u(r)).length)return r;var i=new e(32);return i.fill(0),r.copy(i),i},decode:function(e,r){if(0!==e.length&&e.length<r+32)throw new Error("[ethjs-abi] while decoding fixed bytes, invalid bytes data length: "+t);return{consumed:32,value:"0x"+e.slice(r,r+t).toString("hex")}}}}var p={encode:function(t){var r=t,i=new e(32);if(!h(r,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return r=u(r),i.fill(0),r.copy(i,12),i},decode:function(t,e){if(0===t.length)return{consumed:32,value:"0x"};if(0!==t.length&&t.length<e+32)throw new Error("[ethjs-abi] while decoding address data, invalid address data, invalid byte length "+t.length);return{consumed:32,value:"0x"+t.slice(e+12,e+32).toString("hex")}}};function m(t){var r=parseInt(32*Math.ceil(t.length/32)),i=new e(r-t.length);return i.fill(0),e.concat([c.encode(t.length),t,i])}function b(t,e){if(0!==t.length&&t.length<e+32)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+t.length+" should be less than "+(e+32));var r=c.decode(t,e).value;if(r=r.toNumber(),0!==t.length&&t.length<e+32+r)throw new Error("[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: "+t.length+" should be less than "+(e+32+r));return{consumed:parseInt(32+32*Math.ceil(r/32),10),value:t.slice(e+32,e+32+r)}}var v={encode:function(t){return m(u(t))},decode:function(t,e){var r=b(t,e);return r.value="0x"+r.value.toString("hex"),r},dynamic:!0},y={encode:function(t){return m(new e(t,"utf8"))},decode:function(t,e){var r=b(t,e);return r.value=r.value.toString("utf8"),r},dynamic:!0};function g(t,r){return{encode:function(i){var n=new e(0),o=r;if(!Array.isArray(i))throw new Error("[ethjs-abi] while encoding array, invalid array data, not type Object (Array)");if(-1===o&&(o=i.length,n=c.encode(o)),o!==i.length)throw new Error("[ethjs-abi] while encoding array, size mismatch array length "+o+" does not equal "+i.length);return i.forEach(function(r){n=e.concat([n,t.encode(r)])}),n},decode:function(e,i){var n,o=r,a=i,s=0;-1===o&&(o=(n=c.decode(e,a)).value.toNumber(),s+=n.consumed,a+=n.consumed);for(var h=[],u=0;u<o;u++){var f=t.decode(e,a);s+=f.consumed,a+=f.consumed,h.push(f.value)}return{consumed:s,value:h}},dynamic:-1===r}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:i,bnToBuffer:s,isHexString:h,hexOrBuffer:u,hexlify:function(t){return"number"==typeof t?"0x"+s(new i(t)).toString("hex"):t.mod||t.modulo?"0x"+s(t).toString("hex"):"0x"+u(t).toString("hex")},stripZeros:a,keccak256:o,getKeys:function(t,e,r){var i=[];if(!Array.isArray(t))throw new Error("[ethjs-abi] while getting keys, invalid params value "+JSON.stringify(t));for(var n=0;n<t.length;n++){var o=t[n][e];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("[ethjs-abi] while getKeys found invalid ABI data structure, type value not string");i.push(o)}return i},numberToBN:n,coderNumber:f,uint256Coder:c,coderBoolean:d,coderFixedBytes:l,coderAddress:p,coderDynamicBytes:v,coderString:y,coderArray:g,paramTypePart:w,getParamCoder:function(t){for(var e=t,r=null,i="[ethjs-abi] while getting param coder (getParamCoder) type value "+JSON.stringify(e)+" is either invalid or unsupported by ethjs-abi.";e;){var n=e.match(w);if(!n)throw new Error(i);e=e.substring(n[0].length);var o=n[2]||n[4]||n[5];switch(o){case"int":case"uint":if(r)throw new Error(i);var a=parseInt(n[3]||256);if(0===a||a>256||a%8!=0)throw new Error("[ethjs-abi] while getting param coder for type "+e+", invalid "+o+"<N> width: "+e);r=f(a/8,"int"===o);break;case"bool":if(r)throw new Error(i);r=d;break;case"string":if(r)throw new Error(i);r=y;break;case"bytes":if(r)throw new Error(i);if(n[3]){var s=parseInt(n[3]);if(0===s||s>32)throw new Error("[ethjs-abi] while getting param coder for prefix bytes, invalid type "+e+", size "+s+" should be 0 or greater than 32");r=l(s)}else r=v;break;case"address":if(r)throw new Error(i);r=p;break;case"[]":if(!r||r.dynamic)throw new Error(i);r=g(r,-1);break;default:if(!r||r.dynamic)throw new Error(i);r=g(r,parseInt(n[6]))}}if(!r)throw new Error(i);return r}}}).call(this,r(0).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(t){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var a=t.charCodeAt(o)-48;i<<=4,i|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){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):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("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 n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)a=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=i)u=h(t,f,f+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var c=1;for(u=h(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,h=a/67108864|0;r.words[0]=s;for(var u=1;u<i;u++){for(var f=h>>>26,c=67108863&h,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[u]=0|c,h=0|f}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],h=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?u[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?m+r:u[d-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,h="le"===e,u=new t(o),f=this.clone();if(h){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-n;s++)u[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;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?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a<i.length;a++)o=(e=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var i,n,o,a=t.words,s=e.words,h=r.words,u=0,f=0|a[0],c=8191&f,d=f>>>13,l=0|a[1],p=8191&l,m=l>>>13,b=0|a[2],v=8191&b,y=b>>>13,g=0|a[3],w=8191&g,M=g>>>13,_=0|a[4],S=8191&_,x=_>>>13,A=0|a[5],E=8191&A,k=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],P=8191&T,j=T>>>13,O=0|a[8],C=8191&O,N=O>>>13,q=0|a[9],D=8191&q,H=q>>>13,z=0|s[0],L=8191&z,U=z>>>13,F=0|s[1],K=8191&F,J=F>>>13,Z=0|s[2],Q=8191&Z,Y=Z>>>13,X=0|s[3],W=8191&X,V=X>>>13,G=0|s[4],$=8191&G,tt=G>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ht=8191&st,ut=st>>>13,ft=0|s[8],ct=8191&ft,dt=ft>>>13,lt=0|s[9],pt=8191&lt,mt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,U))+Math.imul(d,L)|0))<<13)|0;u=((o=Math.imul(d,U))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,U))+Math.imul(m,L)|0,o=Math.imul(m,U);var vt=(u+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;u=((o=o+Math.imul(d,J)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,L),n=(n=Math.imul(v,U))+Math.imul(y,L)|0,o=Math.imul(y,U),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,J)|0;var yt=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,U))+Math.imul(M,L)|0,o=Math.imul(M,U),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,J)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0;var gt=(u+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,U))+Math.imul(x,L)|0,o=Math.imul(x,U),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,V)|0;var wt=(u+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,L),n=(n=Math.imul(E,U))+Math.imul(k,L)|0,o=Math.imul(k,U),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,V)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var Mt=(u+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(B,L),n=(n=Math.imul(B,U))+Math.imul(I,L)|0,o=Math.imul(I,U),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var _t=(u+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,U))+Math.imul(j,L)|0,o=Math.imul(j,U),i=i+Math.imul(B,K)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,V)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(v,rt)|0,n=(n=n+Math.imul(v,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(u+(i=i+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,ut)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,U))+Math.imul(N,L)|0,o=Math.imul(N,U),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,Y)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,V)|0,i=i+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,i=i+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var xt=(u+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(D,L),n=(n=Math.imul(D,U))+Math.imul(H,L)|0,o=Math.imul(H,U),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,i=i+Math.imul(v,ht)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ut)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var At=(u+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,J))+Math.imul(H,K)|0,o=Math.imul(H,J),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,Y)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,V)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ut)|0,i=i+Math.imul(v,ct)|0,n=(n=n+Math.imul(v,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var Et=(u+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,Y))+Math.imul(H,Q)|0,o=Math.imul(H,Y),i=i+Math.imul(C,W)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ut)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ut)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var kt=(u+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,W),n=(n=Math.imul(D,V))+Math.imul(H,W)|0,o=Math.imul(H,V),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,dt)|0;var Rt=(u+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(D,$),n=(n=Math.imul(D,tt))+Math.imul(H,$)|0,o=Math.imul(H,tt),i=i+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,i=i+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,ut)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;u=((o=o+Math.imul(x,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(D,rt),n=(n=Math.imul(D,it))+Math.imul(H,rt)|0,o=Math.imul(H,it),i=i+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,ut)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var It=(u+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(D,ot),n=(n=Math.imul(D,at))+Math.imul(H,ot)|0,o=Math.imul(H,at),i=i+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ht),n=(n=Math.imul(D,ut))+Math.imul(H,ht)|0,o=Math.imul(H,ut),i=i+Math.imul(C,ct)|0,n=(n=n+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Pt=(u+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var jt=(u+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(u+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return u=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,h[0]=bt,h[1]=vt,h[2]=yt,h[3]=gt,h[4]=wt,h[5]=Mt,h[6]=_t,h[7]=St,h[8]=xt,h[9]=At,h[10]=Et,h[11]=kt,h[12]=Rt,h[13]=Bt,h[14]=It,h[15]=Tt,h[16]=Pt,h[17]=jt,h[18]=Ot,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,h=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=h;u++){var f=o-u,c=(0|t.words[f])*(0|e.words[u]),d=67108863&c;s=67108863&(d=d+s|0),n+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a<o;a++)i[a]=e[t[a]],n[a]=r[t[a]]},m.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,h=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=h,d=u,l=0;l<a;l++){var p=r[f+l],m=i[f+l],b=r[f+l+a],v=i[f+l+a],y=c*b-d*v;v=c*v+d*b,b=y,r[f+l]=p+b,i[f+l]=m+v,r[f+l+a]=p-b,i[f+l+a]=m-v,l!==s&&(y=h*c-u*d,d=h*d+u*c,c=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},m.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},m.prototype.convert13b=function(t,e,r,n){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<n;++a)r[a]=0;i(0===o),i(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),h=new Array(i),u=new Array(i),f=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,a,i),this.convert13b(e.words,e.length,u,i),this.transform(a,o,s,h,i,n),this.transform(u,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-h[l]*c[l];h[l]=s[l]*c[l]+h[l]*f[l],s[l]=p}return this.conjugate(s,h,i),this.transform(s,h,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,h=(0|this.words[e])-s<<r;this.words[e]=h|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,h=r;if(n-=a,n=Math.max(0,n),h){for(var u=0;u<a;u++)h.words[u]=this.words[u];h.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=n);u--){var c=0|this.words[u];this.words[u]=f<<26-o|c>>>o,f=c&s}return h&&0!==f&&(h.words[h.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(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)},o.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},o.prototype.isubn=function(t){if(i("number"==typeof t),i(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()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,a=t.length+r;this._expand(a);var s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+s;var h=(0|t.words[n])*e;s=((o-=67108863&h)>>26)-(h/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,h=i.length-n.length;if("mod"!==e){(s=new o(null)).length=h+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=i.clone()._ishlnsubmul(n,1,h);0===f.negative&&(i=f,s&&(s.words[h]=1));for(var c=h-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),h=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(c)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(f),h.isub(c)),s.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(h)):(r.isub(e),s.isub(n),h.isub(a))}return{a:s,b:h,gcd:r.iushln(u)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),h=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(h),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.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},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},n(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(g,v),n(w,v),n(M,v),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return b[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),h=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(h);)f.redIAdd(h);for(var c=this.pow(f,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=a;0!==l.cmp(s);){for(var m=l,b=0;0!==m.cmp(s);b++)m=m.redSqr();i(b<p);var v=this.pow(c,new o(1).iushln(p-b-1));d=d.redMul(v),c=v.redSqr(),l=l.redMul(c),p=b}return d},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new o(1);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],a=0,s=0,h=e.bitLength()%26;for(0===h&&(h=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],f=h-1;f>=0;f--){var c=u>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,_),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(17)(t))},function(t,e,r){"use strict";function i(t,e){function r(t){var r=this;r.filterId=null,r.options=Object.assign({delay:300,decoder:function(t){return t},defaultFilterObject:{}},t||{}),r.watchers={},r.interval=setInterval(function(){null!==r.filterId&&Object.keys(r.watchers).length>0&&e.getFilterChanges(r.filterId,function(t,e){var i=[],n=null;if(!t)try{e.forEach(function(t,n){i[n]=e[n],i[n].data=r.options.decoder(i[n].data)})}catch(t){n=new Error("[ethjs-filter] while decoding filter change event data from RPC '"+JSON.stringify(i)+"': "+t)}Object.keys(r.watchers).forEach(function(o){var a=r.watchers[o];!0!==a.stop?n?(a.reject(n),a.callback(n,null)):(t?a.reject(t):Array.isArray(i)&&e.length>0&&a.resolve(i),a.callback(t,i)):delete r.watchers[o]})})},r.options.delay)}return r.prototype.at=function(t){this.filterId=t},r.prototype.watch=function(t){var e=t||function(){},r=this,i=Math.random().toString(36).substring(7),n=new Promise(function(t,n){r.watchers[i]={resolve:t,reject:n,callback:e,stop:!1}});return n.stopWatching=function(){r.watchers[i].stop=!0},n},r.prototype.uninstall=function(t){var r=this,i=t||function(){};return r.watchers=Object.assign({}),clearInterval(r.interval),new Promise(function(t,n){e.uninstallFilter(r.filterId,function(e,r){e?n(e):t(r),i(e,r)})})},r.prototype.new=function(){var r=function(){},i=this,n=[],o=[].slice.call(arguments);return"function"==typeof o[o.length-1]&&(r=o.pop()),"Filter"===t&&n.push(Object.assign(i.options.defaultFilterObject,o[o.length-1]||{})),new Promise(function(o,a){n.push(function(t,e){t?a(t):(i.filterId=e,o(e)),r(t,e)}),e["new"+t].apply(e,n)})},r}t.exports=function t(e){if(!(this instanceof t))throw new Error("the EthFilter object must be instantiated with `new` flag.. (e.g. `const filters = new EthFilter(query);`)");if("object"!=typeof e)throw new Error("the EthFilter object must be instantiated with an EthQuery instance (e.g. `const filters = new EthFilter(new EthQuery(provider));`). See github.com/ethjs/ethjs-query for more details..");this.Filter=i("Filter",e),this.BlockFilter=i("BlockFilter",e),this.PendingTransactionFilter=i("PendingTransactionFilter",e)}},function(t){t.exports=[{constant:!0,inputs:[{name:"",type:"address"}],name:"owners",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"bytes32"},{name:"",type:"address"}],name:"delegates",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"nonce",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"changed",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"owner",type:"address"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDOwnerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"delegateType",type:"bytes32"},{indexed:!1,name:"delegate",type:"address"},{indexed:!1,name:"validTo",type:"uint256"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDDelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"name",type:"bytes32"},{indexed:!1,name:"value",type:"bytes"},{indexed:!1,name:"validTo",type:"uint256"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDAttributeChanged",type:"event"},{constant:!0,inputs:[{name:"identity",type:"address"}],name:"identityOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"validDelegate",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"newOwner",type:"address"}],name:"changeOwner",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"newOwner",type:"address"}],name:"changeOwnerSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"},{name:"validity",type:"uint256"}],name:"addDelegate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"},{name:"validity",type:"uint256"}],name:"addDelegateSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"revokeDelegate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"revokeDelegateSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"},{name:"validity",type:"uint256"}],name:"setAttribute",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"},{name:"validity",type:"uint256"}],name:"setAttributeSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"}],name:"revokeAttribute",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"}],name:"revokeAttributeSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}]},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function a(t){try{h(i.next(t))}catch(t){o(t)}}function s(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(a,s)}h((i=i.apply(t,e||[])).next())})},n=this&&this.__generator||function(t,e){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(20),a="/.well-known/did.json";function s(t){return new Promise(function(e,i){var n=new("undefined"!=typeof window?window.XMLHttpRequest:r(164).XMLHttpRequest);n.open("GET",t),n.onreadystatechange=function(){n&&4===n.readyState&&(200===n.status?e(n.responseText):i(new Error(("Invalid http response status "+n.status+" "+n.responseText).trim())))},n.setRequestHeader("accept","application/json"),n.send()})}e.default=function(){o.registerMethod("https",function(t,e){return i(this,void 0,void 0,function(){var r,i,o,h;return n(this,function(n){switch(n.label){case 0:r="https://"+e.id+a,i=null,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,s(r)];case 2:return i=n.sent(),[3,4];case 3:throw o=n.sent(),new Error("DID must resolve to a valid https URL: "+o.message);case 4:h=null;try{h=JSON.parse(i)}catch(t){throw new Error("DID must resolve to a JSON document")}if("https://w3id.org/did/v1"!==h["@context"])throw new Error("DID document missing context");if(h.id!==t)throw new Error("DID document id does not match requested did");if(!(Array.isArray(h.publicKey)&&h.publicKey.length>0))throw new Error("DID document has no public keys");return[2,h]}})})})}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encode=function(t){var e=t.network,r=t.address,i=[new n.Buffer("01","hex"),a.decode(e.slice(2)),new n.Buffer(r.slice(2),"hex")];return i.push(s(i)),o.encode(n.Buffer.concat(i))},e.decode=function(t){var e=n.Buffer.from(o.decode(t)),r=e.length-24,i=e.slice(0,1),h=e.slice(1,r),u=e.slice(r,20+r);if(e.slice(r+20).equals(s([i,h,u])))return{network:"0x"+a.encode(h),address:"0x"+u.toString("hex")};throw new Error("Invalid address checksum")},e.isMNID=function(t){try{var e=n.Buffer.from(o.decode(t));return e.length>24&&1===e[0]}catch(t){return!1}};var i=r(166),n=r(0),o=r(21)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a=r(21)("0123456789abcdef");function s(t){return new n.Buffer((0,i.sha3_256)(n.Buffer.concat(t)),"hex").slice(0,4)}},function(t,e,r){(function(e,r){
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.5.7
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2016
 * @license MIT
 */
!function(){"use strict";var i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[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],h=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],f=function(t,e,r){return function(i){return new M(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new M(t,e,n).update(i)[r]()}},d=function(t,e){var r=f(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:d},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new M(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<u.length;++i){var n=u[i];r[n]=c(t,e,n)}return r}}],p={},m=[],b=0;b<l.length;++b)for(var v=l[b],y=v.bits,g=0;g<y.length;++g){var w=v.name+"_"+y[g];m.push(w),p[w]=v.createMethod(y[g],v.padding)}function M(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,s=this.byteCount,h=this.blockCount,u=0,f=this.s;u<n;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<h+1;++r)o[r]=0;if(e)for(r=this.start;u<n&&r<s;++u)o[r>>2]|=t[u]<<a[3&r++];else for(r=this.start;u<n&&r<s;++u)(i=t.charCodeAt(u))<128?o[r>>2]|=i<<a[3&r++]:i<2048?(o[r>>2]|=(192|i>>6)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]):i<55296||i>=57344?(o[r>>2]|=(224|i>>12)<<a[3&r++],o[r>>2]|=(128|i>>6&63)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++u)),o[r>>2]|=(240|i>>18)<<a[3&r++],o[r>>2]|=(128|i>>12&63)<<a[3&r++],o[r>>2]|=(128|i>>6&63)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]);if(this.lastByteIndex=r,r>=s){for(this.start=r-s,this.block=o[h],r=0;r<h;++r)f[r]^=o[r];_(f),this.reset=!0}else this.start=r}return this},M.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];_(i)},M.prototype.toString=M.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,a=0,s=0,h="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],h+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];s%e==0&&(_(r),a=0)}return n&&(t=r[a],n>0&&(h+=o[t>>4&15]+o[15&t]),n>1&&(h+=o[t>>12&15]+o[t>>8&15]),n>2&&(h+=o[t>>20&15]+o[t>>16&15])),h},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(s);for(var h=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)h[a]=r[o];a%e==0&&_(r)}return n&&(h[o]=r[o],t=t.slice(0,s)),t},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.digest=M.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,a=0,s=0,h=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],h[t]=255&e,h[t+1]=e>>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;s%r==0&&_(i)}return o&&(t=s<<2,e=i[a],o>0&&(h[t]=255&e),o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h};var _=function(t){var e,r,i,n,o,a,h,u,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,E,k,R,B,I,T,P,j,O,C,N,q,D,H,z,L,U,F,K,J,Z,Q,Y,X,W,V,G,$,tt,et,rt,it,nt,ot,at,st,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],h=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|h>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(h<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|d>>>31),r=h^(d<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|p>>>31),r=f^(p<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=d^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],b=t[1],Q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,B=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,V=t[34]<<15|t[35]>>>17,G=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,H=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,Z=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,U=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=m^~v&g,t[1]=b^~y&w,t[10]=A^~k&B,t[11]=E^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~Q&X,t[31]=Z^~Y&W,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=k^~B&T,t[13]=R^~I&P,t[22]=q^~H&L,t[23]=D^~z&U,t[32]=Q^~X&V,t[33]=Y^~W&G,t[42]=it^~ot&st,t[43]=nt^~at&ht,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&j,t[15]=I^~P&O,t[24]=H^~L&F,t[25]=z^~U&K,t[34]=X^~V&$,t[35]=W^~G&tt,t[44]=ot^~st&ut,t[45]=at^~ht&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~j&A,t[17]=P^~O&E,t[26]=L^~F&C,t[27]=U^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=j^~A&k,t[19]=O^~E&R,t[28]=F^~C&q,t[29]=K^~N&D,t[38]=$^~J&Q,t[39]=tt^~Z&Y,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(n)t.exports=p;else for(b=0;b<m.length;++b)i[m[b]]=p[m[b]]}()}).call(this,r(11),r(6))},function(t,e,r){(function(t){function i(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var n=r(168),o=r(169),a=r(1),s=i(r(170)),h=r(172),u=r(0),f=i(r(173)),c=i(r(20));function d(t){return u.Buffer.from(n.sha256.arrayBuffer(t))}function l(t){return"0x"+(e=u.Buffer.from(t.slice(2),"hex"),u.Buffer.from(o.keccak_256.arrayBuffer(e))).slice(-20).toString("hex");var e}var p=new a.ec("secp256k1");function m(t,e){return void 0===e&&(e=64),t.length===e?t:"0".repeat(e-t.length)+t}function b(e){return new Uint8Array(Array.prototype.slice.call(t.from(e,"base64"),0))}var v=new a.ec("secp256k1");function y(t,e){void 0===e&&(e=!1);var r=f.toBuffer(t);if(r.length!==(e?65:64))throw new Error("wrong signature length");var i={r:r.slice(0,32).toString("hex"),s:r.slice(32,64).toString("hex")};return e&&(i.recoveryParam=r[64]),i}var g={ES256K:function(t,e,r){var i=d(t),n=y(e),o=r.find(function(t){return v.keyFromPublic(t.publicKeyHex,"hex").verify(i,n)});if(!o)throw new Error("Signature invalid for JWT");return o},"ES256K-R":function(t,e,r){var i=y(e,!0),n=d(t),o=v.recoverPubKey(n,i,i.recoveryParam),a=o.encode("hex"),s=o.encode("hex",!0),h=l(a),u=r.find(function(t){var e=t.publicKeyHex;return e===a||e===s||t.ethereumAddress===h});if(!u)throw new Error("Signature invalid for JWT");return u},Ed25519:function(t,e,r){var i=h.encode(t),n=b(f.toBase64(e)),o=r.find(function(t){return s.sign.detached.verify(i,n,b(t.publicKeyBase64))});if(!o)throw new Error("Signature invalid for JWT");return o}};function w(t){var e=g[t];if(!e)throw new Error("Unsupported algorithm "+t);return e}function M(t){return"object"==typeof t&&"r"in t&&"s"in t}function _(t){return function(e,r){try{return Promise.resolve(r(e)).then(function(e){if(M(e))return function(r){var i=e.r,n=e.s,o=e.recoveryParam,a=u.Buffer.alloc(t?65:64);if(u.Buffer.from(i,"hex").copy(a,0),u.Buffer.from(n,"hex").copy(a,32),t){if(void 0===o)throw new Error("Signer did not return a recoveryParam");a[64]=o}return f.encode(a)}();throw new Error("expected a signer function that returns a signature object instead of string")})}catch(t){return Promise.reject(t)}}}w.toSignatureObject=y;var S={ES256K:_(),"ES256K-R":_(!0),Ed25519:function(t,e){try{return Promise.resolve(e(t)).then(function(t){if(M(t))throw new Error("expected a signer function that returns a string instead of signature object");return t})}catch(t){return Promise.reject(t)}}},x={ES256K:["Secp256k1VerificationKey2018","Secp256k1SignatureVerificationKey2018","EcdsaPublicKeySecp256k1"],"ES256K-R":["Secp256k1VerificationKey2018","Secp256k1SignatureVerificationKey2018","EcdsaPublicKeySecp256k1"],Ed25519:["ED25519SignatureVerification"]};function A(t){return f.encode(JSON.stringify(t))}function E(t){return t.match(/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/)}function k(t){if(t.match(/^did:/))return t;if(E(t))return"did:uport:"+t;throw new Error("Not a valid DID '"+t+"'")}function R(t){if(!t)throw new Error("no JWT passed into decodeJWT");var e=t.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(e)return{header:JSON.parse(f.decode(e[1])),payload:JSON.parse(f.decode(e[2])),signature:e[3],data:e[1]+"."+e[2]};throw new Error("Incorrect format JWT")}e.SimpleSigner=function(t){var e=p.keyFromPrivate(t);return function(t){try{var r=e.sign(d(t)),i=r.s,n=r.recoveryParam;return Promise.resolve({r:m(r.r.toString("hex")),s:m(i.toString("hex")),recoveryParam:n})}catch(t){return Promise.reject(t)}}},e.NaclSigner=function(t){var e=b(t);return function(t){try{var r=h.encode(t),i=s.sign.detached(r,e),n=f.encode(u.Buffer.from(i));return Promise.resolve(n)}catch(t){return Promise.reject(t)}}},e.verifyJWT=function(t,e){void 0===e&&(e={auth:null,audience:null,callbackUrl:null});try{var r=e.audience?k(e.audience):void 0,i=R(t),n=i.payload,o=i.header,a=i.signature,s=i.data;return Promise.resolve(function(t,e,r){try{var i=x[t];if(!i||0===i.length)throw new Error("No supported signature types for algorithm "+t);var n=k(e);return Promise.resolve(c(n)).then(function(e){if(!e)throw new Error("Unable to resolve DID document for "+n);var o=!r||(e.authentication||[]).map(function(t){return t.publicKey}),a=(e.publicKey||[]).filter(function(t){var e=t.type,n=t.id;return i.find(function(t){return t===e&&(!r||Array.isArray(o)&&o.indexOf(n)>=0)})});if(r&&(!a||0===a.length))throw new Error("DID document for "+n+" does not have public keys suitable for authenticationg user");if(!a||0===a.length)throw new Error("DID document for "+n+" does not have public keys for "+t);return{authenticators:a,issuer:n,doc:e}})}catch(t){return Promise.reject(t)}}(o.alg,n.iss,e.auth)).then(function(i){var h,u=i.doc,f=i.authenticators,c=i.issuer,d=w(o.alg)(s,a,f),l=Math.floor(Date.now()/1e3);if(d){if(n.iat&&n.iat>l+300)throw new Error("JWT not valid yet (issued in the future): iat: "+n.iat+" > now: "+l);if(n.exp&&n.exp<=l-300)throw new Error("JWT has expired: exp: "+n.exp+" < now: "+l);if(n.aud)if((h=n.aud)&&(h.match(/^did:/)||E(h))){if(!r)throw new Error("JWT audience is required but your app address has not been configured");if(r!==k(n.aud))throw new Error("JWT audience does not match your DID: aud: "+n.aud+" !== yours: "+r)}else{if(!e.callbackUrl)throw new Error("JWT audience matching your callback url is required but one wasn't passed in");if(n.aud!==e.callbackUrl)throw new Error("JWT audience does not match the callback url: aud: "+n.aud+" !== url: "+e.callbackUrl)}return{payload:n,doc:u,issuer:c,signer:d,jwt:t}}})}catch(t){return Promise.reject(t)}},e.createJWT=function(t,e){var r=e.issuer,i=e.signer,n=e.alg,o=e.expiresIn;try{if(!i)throw new Error("No Signer functionality has been configured");if(!r)throw new Error("No issuing DID has been configured");var a={typ:"JWT",alg:n||"ES256K"},s={iat:Math.floor(Date.now()/1e3),exp:void 0};if(o){if("number"!=typeof o)throw new Error("JWT expiresIn is not a number");s.exp=s.iat+Math.floor(o)}var h=[A(a),A(Object.assign({},s,t,{iss:r}))].join("."),u=function(t){var e=S[t];if(!e)throw new Error("Unsupported algorithm "+t);return e}(a.alg);return Promise.resolve(u(h,i)).then(function(t){return[h,t].join(".")})}catch(t){return Promise.reject(t)}},e.decodeJWT=R,e.toEthereumAddress=l}).call(this,r(0).Buffer)},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
/**
 * [js-sha256]{@link https://github.com/emn178/js-sha256}
 *
 * @version 0.9.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2014-2017
 * @license MIT
 */
/**
 * [js-sha256]{@link https://github.com/emn178/js-sha256}
 *
 * @version 0.9.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2014-2017
 * @license MIT
 */
!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(64),ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var i=OUTPUT_TYPES[r];e[i]=createOutputMethod(i,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,i){return new HmacSha256(r,e,!0).update(i)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var i=OUTPUT_TYPES[r];e[i]=createHmacOutputMethod(i,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,r){var i,n=typeof t;if("string"===n){var o,a=[],s=t.length,h=0;for(i=0;i<s;++i)(o=t.charCodeAt(i))<128?a[h++]=o:o<2048?(a[h++]=192|o>>6,a[h++]=128|63&o):o<55296||o>=57344?(a[h++]=224|o>>12,a[h++]=128|o>>6&63,a[h++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++i)),a[h++]=240|o>>18,a[h++]=128|o>>12&63,a[h++]=128|o>>6&63,a[h++]=128|63&o);t=a}else{if("object"!==n)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var u=[],f=[];for(i=0;i<64;++i){var c=t[i]||0;u[i]=92^c,f[i]=54^c}Sha256.call(this,e,r),this.update(f),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var i,n,o=0,a=t.length,s=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e)for(n=this.start;o<a&&n<64;++o)s[n>>2]|=t[o]<<SHIFT[3&n++];else for(n=this.start;o<a&&n<64;++o)(i=t.charCodeAt(o))<128?s[n>>2]|=i<<SHIFT[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<SHIFT[3&n++],s[n>>2]|=(128|63&i)<<SHIFT[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<SHIFT[3&n++],s[n>>2]|=(128|i>>6&63)<<SHIFT[3&n++],s[n>>2]|=(128|63&i)<<SHIFT[3&n++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++o)),s[n>>2]|=(240|i>>18)<<SHIFT[3&n++],s[n>>2]|=(128|i>>12&63)<<SHIFT[3&n++],s[n>>2]|=(128|i>>6&63)<<SHIFT[3&n++],s[n>>2]|=(128|63&i)<<SHIFT[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=s[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,r,i,n,o,a,s,h,u=this.h0,f=this.h1,c=this.h2,d=this.h3,l=this.h4,p=this.h5,m=this.h6,b=this.h7,v=this.blocks;for(t=16;t<64;++t)e=((n=v[t-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,r=((n=v[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,v[t]=v[t-16]+e+v[t-7]+r<<0;for(h=f&c,t=0;t<64;t+=4)this.first?(this.is224?(o=300032,b=(n=v[0]-1413257819)-150054599<<0,d=n+24177077<<0):(o=704751109,b=(n=v[0]-210244248)-1521486534<<0,d=n+143694565<<0),this.first=!1):(e=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(o=u&f)^u&c^h,b=d+(n=b+(r=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&p^~l&m)+K[t]+v[t])<<0,d=n+(e+i)<<0),e=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(a=d&u)^d&f^o,m=c+(n=m+(r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&l^~b&p)+K[t+1]+v[t+1])<<0,e=((c=n+(e+i)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),i=(s=c&d)^c&u^a,p=f+(n=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&b^~m&l)+K[t+2]+v[t+2])<<0,e=((f=n+(e+i)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),i=(h=f&c)^f&d^s,l=u+(n=l+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&b)+K[t+3]+v[t+3])<<0,u=n+(e+i)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+f<<0,this.h2=this.h2+c<<0,this.h3=this.h3+d<<0,this.h4=this.h4+l<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+b<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,o=this.h5,a=this.h6,s=this.h7,h=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(h+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),h},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,o=this.h5,a=this.h6,s=this.h7,h=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||h.push(s>>24&255,s>>16&255,s>>8&255,255&s),h},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(11),__webpack_require__(6))},function(t,e,r){(function(i,n){var o;
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.8.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2018
 * @license MIT
 */
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.8.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2018
 * @license MIT
 */
!function(){"use strict";var a="input is invalid type",s="object"==typeof window,h=s?window:{};h.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"==typeof self;!h.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?h=n:u&&(h=self);var f=!h.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,c=r(64),d=!h.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],b=[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],v=[224,256,384,512],y=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!h.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!d||!h.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var M=function(t,e,r){return function(i){return new N(t,e,t).update(i)[r]()}},_=function(t,e,r){return function(i,n){return new N(t,e,n).update(i)[r]()}},S=function(t,e,r){return function(e,i,n,o){return R["cshake"+t].update(e,i,n,o)[r]()}},x=function(t,e,r){return function(e,i,n,o){return R["kmac"+t].update(e,i,n,o)[r]()}},A=function(t,e,r,i){for(var n=0;n<g.length;++n){var o=g[n];t[o]=e(r,i,o)}return t},E=function(t,e){var r=M(t,e,"hex");return r.create=function(){return new N(t,e,t)},r.update=function(t){return r.create().update(t)},A(r,M,t,e)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:E},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:E},{name:"shake",padding:[31,7936,2031616,520093696],bits:y,createMethod:function(t,e){var r=_(t,e,"hex");return r.create=function(r){return new N(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},A(r,_,t,e)}},{name:"cshake",padding:p,bits:y,createMethod:function(t,e){var r=w[t],i=S(t,0,"hex");return i.create=function(i,n,o){return n||o?new N(t,e,i).bytepad([n,o],r):R["shake"+t].create(i)},i.update=function(t,e,r,n){return i.create(e,r,n).update(t)},A(i,S,t,e)}},{name:"kmac",padding:p,bits:y,createMethod:function(t,e){var r=w[t],i=x(t,0,"hex");return i.create=function(i,n,o){return new q(t,e,n).bytepad(["KMAC",o],r).bytepad([i],r)},i.update=function(t,e,r,n){return i.create(t,r,n).update(e)},A(i,x,t,e)}}],R={},B=[],I=0;I<k.length;++I)for(var T=k[I],P=T.bits,j=0;j<P.length;++j){var O=T.name+"_"+P[j];if(B.push(O),R[O]=T.createMethod(P[j],T.padding),"sha3"!==T.name){var C=T.name+P[j];B.push(C),R[C]=R[O]}}function N(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function q(t,e,r){N.call(this,t,e,r)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(a);if(null===t)throw new Error(a);if(d&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||d&&ArrayBuffer.isView(t)))throw new Error(a);e=!0}for(var i,n,o=this.blocks,s=this.byteCount,h=t.length,u=this.blockCount,f=0,c=this.s;f<h;){if(this.reset)for(this.reset=!1,o[0]=this.block,i=1;i<u+1;++i)o[i]=0;if(e)for(i=this.start;f<h&&i<s;++f)o[i>>2]|=t[f]<<m[3&i++];else for(i=this.start;f<h&&i<s;++f)(n=t.charCodeAt(f))<128?o[i>>2]|=n<<m[3&i++]:n<2048?(o[i>>2]|=(192|n>>6)<<m[3&i++],o[i>>2]|=(128|63&n)<<m[3&i++]):n<55296||n>=57344?(o[i>>2]|=(224|n>>12)<<m[3&i++],o[i>>2]|=(128|n>>6&63)<<m[3&i++],o[i>>2]|=(128|63&n)<<m[3&i++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++f)),o[i>>2]|=(240|n>>18)<<m[3&i++],o[i>>2]|=(128|n>>12&63)<<m[3&i++],o[i>>2]|=(128|n>>6&63)<<m[3&i++],o[i>>2]|=(128|63&n)<<m[3&i++]);if(this.lastByteIndex=i,i>=s){for(this.start=i-s,this.block=o[u],i=0;i<u;++i)c[i]^=o[i];D(c),this.reset=!0}else this.start=i}return this},N.prototype.encode=function(t,e){var r=255&t,i=1,n=[r];for(r=255&(t>>=8);r>0;)n.unshift(r),r=255&(t>>=8),++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},N.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(a);if(null===t)throw new Error(a);if(d&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||d&&ArrayBuffer.isView(t)))throw new Error(a);e=!0}var i=0,n=t.length;if(e)i=n;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),i+=4)}return i+=this.encode(8*i),this.update(t),i},N.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i<t.length;++i)r+=this.encodeString(t[i]);var n=e-r%e,o=[];return o.length=n,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];D(i)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,a=0,s="";a<i;){for(o=0;o<e&&a<i;++o,++a)t=r[o],s+=l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15];a%e==0&&(D(r),o=0)}return n&&(t=r[o],s+=l[t>>4&15]+l[15&t],n>1&&(s+=l[t>>12&15]+l[t>>8&15]),n>2&&(s+=l[t>>20&15]+l[t>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(s);for(var h=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)h[a]=r[o];a%e==0&&D(r)}return n&&(h[o]=r[o],t=t.slice(0,s)),t},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,a=0,s=0,h=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],h[t]=255&e,h[t+1]=e>>8&255,h[t+2]=e>>16&255,h[t+3]=e>>24&255;s%r==0&&D(i)}return o&&(t=s<<2,e=i[a],h[t]=255&e,o>1&&(h[t+1]=e>>8&255),o>2&&(h[t+2]=e>>16&255)),h},q.prototype=new N,q.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var D=function(t){var e,r,i,n,o,a,s,h,u,f,c,d,l,p,m,v,y,g,w,M,_,S,x,A,E,k,R,B,I,T,P,j,O,C,N,q,D,H,z,L,U,F,K,J,Z,Q,Y,X,W,V,G,$,tt,et,rt,it,nt,ot,at,st,ht,ut,ft;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|u>>>31),r=o^(u<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(f<<1|c>>>31),r=s^(c<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(d<<1|l>>>31),r=u^(l<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],Q=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,B=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ht=t[30]<<9|t[31]>>>23,F=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,N=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,q=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,V=t[34]<<15|t[35]>>>17,G=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,E=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,H=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,J=t[8]<<27|t[9]>>>5,Z=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,L=t[38]<<8|t[39]>>>24,U=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~v&g,t[1]=m^~y&w,t[10]=A^~k&B,t[11]=E^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~Q&X,t[31]=Z^~Y&W,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=k^~B&T,t[13]=R^~I&P,t[22]=q^~H&L,t[23]=D^~z&U,t[32]=Q^~X&V,t[33]=Y^~W&G,t[42]=it^~ot&st,t[43]=nt^~at&ht,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&j,t[15]=I^~P&O,t[24]=H^~L&F,t[25]=z^~U&K,t[34]=X^~V&$,t[35]=W^~G&tt,t[44]=ot^~st&ut,t[45]=at^~ht&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=T^~j&A,t[17]=P^~O&E,t[26]=L^~F&C,t[27]=U^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ut&et,t[47]=ht^~ft&rt,t[8]=S^~p&v,t[9]=x^~m&y,t[18]=j^~A&k,t[19]=O^~E&R,t[28]=F^~C&q,t[29]=K^~N&D,t[38]=$^~J&Q,t[39]=tt^~Z&Y,t[48]=ut^~et&it,t[49]=ft^~rt&nt,t[0]^=b[i],t[1]^=b[i+1]};if(f)t.exports=R;else{for(I=0;I<B.length;++I)h[B[I]]=R[B[I]];c&&(void 0===(o=function(){return R}.call(e,r,e,t))||(t.exports=o))}}()}).call(this,r(11),r(6))},function(t,e,r){!function(t){"use strict";var e=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},i=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var a=e(),s=e([1]),h=e([56129,1]),u=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),f=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),c=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e,r,i){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=i>>24&255,t[e+5]=i>>16&255,t[e+6]=i>>8&255,t[e+7]=255&i}function m(t,e,r,i,n){var o,a=0;for(o=0;o<n;o++)a|=t[e+o]^r[i+o];return(1&a-1>>>8)-1}function b(t,e,r,i){return m(t,e,r,i,16)}function v(t,e,r,i){return m(t,e,r,i,32)}function y(t,e,r,i){!function(t,e,r,i){for(var n,o=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,c=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,d=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,b=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,g=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,M=o,_=a,S=s,x=h,A=u,E=f,k=c,R=d,B=l,I=p,T=m,P=b,j=v,O=y,C=g,N=w,q=0;q<20;q+=2)M^=(n=(j^=(n=(B^=(n=(A^=(n=M+j|0)<<7|n>>>25)+M|0)<<9|n>>>23)+A|0)<<13|n>>>19)+B|0)<<18|n>>>14,E^=(n=(_^=(n=(O^=(n=(I^=(n=E+_|0)<<7|n>>>25)+E|0)<<9|n>>>23)+I|0)<<13|n>>>19)+O|0)<<18|n>>>14,T^=(n=(k^=(n=(S^=(n=(C^=(n=T+k|0)<<7|n>>>25)+T|0)<<9|n>>>23)+C|0)<<13|n>>>19)+S|0)<<18|n>>>14,N^=(n=(P^=(n=(R^=(n=(x^=(n=N+P|0)<<7|n>>>25)+N|0)<<9|n>>>23)+x|0)<<13|n>>>19)+R|0)<<18|n>>>14,M^=(n=(x^=(n=(S^=(n=(_^=(n=M+x|0)<<7|n>>>25)+M|0)<<9|n>>>23)+_|0)<<13|n>>>19)+S|0)<<18|n>>>14,E^=(n=(A^=(n=(R^=(n=(k^=(n=E+A|0)<<7|n>>>25)+E|0)<<9|n>>>23)+k|0)<<13|n>>>19)+R|0)<<18|n>>>14,T^=(n=(I^=(n=(B^=(n=(P^=(n=T+I|0)<<7|n>>>25)+T|0)<<9|n>>>23)+P|0)<<13|n>>>19)+B|0)<<18|n>>>14,N^=(n=(C^=(n=(O^=(n=(j^=(n=N+C|0)<<7|n>>>25)+N|0)<<9|n>>>23)+j|0)<<13|n>>>19)+O|0)<<18|n>>>14;M=M+o|0,_=_+a|0,S=S+s|0,x=x+h|0,A=A+u|0,E=E+f|0,k=k+c|0,R=R+d|0,B=B+l|0,I=I+p|0,T=T+m|0,P=P+b|0,j=j+v|0,O=O+y|0,C=C+g|0,N=N+w|0,t[0]=M>>>0&255,t[1]=M>>>8&255,t[2]=M>>>16&255,t[3]=M>>>24&255,t[4]=_>>>0&255,t[5]=_>>>8&255,t[6]=_>>>16&255,t[7]=_>>>24&255,t[8]=S>>>0&255,t[9]=S>>>8&255,t[10]=S>>>16&255,t[11]=S>>>24&255,t[12]=x>>>0&255,t[13]=x>>>8&255,t[14]=x>>>16&255,t[15]=x>>>24&255,t[16]=A>>>0&255,t[17]=A>>>8&255,t[18]=A>>>16&255,t[19]=A>>>24&255,t[20]=E>>>0&255,t[21]=E>>>8&255,t[22]=E>>>16&255,t[23]=E>>>24&255,t[24]=k>>>0&255,t[25]=k>>>8&255,t[26]=k>>>16&255,t[27]=k>>>24&255,t[28]=R>>>0&255,t[29]=R>>>8&255,t[30]=R>>>16&255,t[31]=R>>>24&255,t[32]=B>>>0&255,t[33]=B>>>8&255,t[34]=B>>>16&255,t[35]=B>>>24&255,t[36]=I>>>0&255,t[37]=I>>>8&255,t[38]=I>>>16&255,t[39]=I>>>24&255,t[40]=T>>>0&255,t[41]=T>>>8&255,t[42]=T>>>16&255,t[43]=T>>>24&255,t[44]=P>>>0&255,t[45]=P>>>8&255,t[46]=P>>>16&255,t[47]=P>>>24&255,t[48]=j>>>0&255,t[49]=j>>>8&255,t[50]=j>>>16&255,t[51]=j>>>24&255,t[52]=O>>>0&255,t[53]=O>>>8&255,t[54]=O>>>16&255,t[55]=O>>>24&255,t[56]=C>>>0&255,t[57]=C>>>8&255,t[58]=C>>>16&255,t[59]=C>>>24&255,t[60]=N>>>0&255,t[61]=N>>>8&255,t[62]=N>>>16&255,t[63]=N>>>24&255}(t,e,r,i)}function g(t,e,r,i){!function(t,e,r,i){for(var n,o=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,h=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,c=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,d=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,b=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,v=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,g=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,M=0;M<20;M+=2)o^=(n=(v^=(n=(l^=(n=(u^=(n=o+v|0)<<7|n>>>25)+o|0)<<9|n>>>23)+u|0)<<13|n>>>19)+l|0)<<18|n>>>14,f^=(n=(a^=(n=(y^=(n=(p^=(n=f+a|0)<<7|n>>>25)+f|0)<<9|n>>>23)+p|0)<<13|n>>>19)+y|0)<<18|n>>>14,m^=(n=(c^=(n=(s^=(n=(g^=(n=m+c|0)<<7|n>>>25)+m|0)<<9|n>>>23)+g|0)<<13|n>>>19)+s|0)<<18|n>>>14,w^=(n=(b^=(n=(d^=(n=(h^=(n=w+b|0)<<7|n>>>25)+w|0)<<9|n>>>23)+h|0)<<13|n>>>19)+d|0)<<18|n>>>14,o^=(n=(h^=(n=(s^=(n=(a^=(n=o+h|0)<<7|n>>>25)+o|0)<<9|n>>>23)+a|0)<<13|n>>>19)+s|0)<<18|n>>>14,f^=(n=(u^=(n=(d^=(n=(c^=(n=f+u|0)<<7|n>>>25)+f|0)<<9|n>>>23)+c|0)<<13|n>>>19)+d|0)<<18|n>>>14,m^=(n=(p^=(n=(l^=(n=(b^=(n=m+p|0)<<7|n>>>25)+m|0)<<9|n>>>23)+b|0)<<13|n>>>19)+l|0)<<18|n>>>14,w^=(n=(g^=(n=(y^=(n=(v^=(n=w+g|0)<<7|n>>>25)+w|0)<<9|n>>>23)+v|0)<<13|n>>>19)+y|0)<<18|n>>>14;t[0]=o>>>0&255,t[1]=o>>>8&255,t[2]=o>>>16&255,t[3]=o>>>24&255,t[4]=f>>>0&255,t[5]=f>>>8&255,t[6]=f>>>16&255,t[7]=f>>>24&255,t[8]=m>>>0&255,t[9]=m>>>8&255,t[10]=m>>>16&255,t[11]=m>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=c>>>0&255,t[17]=c>>>8&255,t[18]=c>>>16&255,t[19]=c>>>24&255,t[20]=d>>>0&255,t[21]=d>>>8&255,t[22]=d>>>16&255,t[23]=d>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255}(t,e,r,i)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function M(t,e,r,i,n,o,a){var s,h,u=new Uint8Array(16),f=new Uint8Array(64);for(h=0;h<16;h++)u[h]=0;for(h=0;h<8;h++)u[h]=o[h];for(;n>=64;){for(y(f,u,a,w),h=0;h<64;h++)t[e+h]=r[i+h]^f[h];for(s=1,h=8;h<16;h++)s=s+(255&u[h])|0,u[h]=255&s,s>>>=8;n-=64,e+=64,i+=64}if(n>0)for(y(f,u,a,w),h=0;h<n;h++)t[e+h]=r[i+h]^f[h];return 0}function _(t,e,r,i,n){var o,a,s=new Uint8Array(16),h=new Uint8Array(64);for(a=0;a<16;a++)s[a]=0;for(a=0;a<8;a++)s[a]=i[a];for(;r>=64;){for(y(h,s,n,w),a=0;a<64;a++)t[e+a]=h[a];for(o=1,a=8;a<16;a++)o=o+(255&s[a])|0,s[a]=255&o,o>>>=8;r-=64,e+=64}if(r>0)for(y(h,s,n,w),a=0;a<r;a++)t[e+a]=h[a];return 0}function S(t,e,r,i,n){var o=new Uint8Array(32);g(o,i,n,w);for(var a=new Uint8Array(8),s=0;s<8;s++)a[s]=i[s+16];return _(t,e,r,a,o)}function x(t,e,r,i,n,o,a){var s=new Uint8Array(32);g(s,o,a,w);for(var h=new Uint8Array(8),u=0;u<8;u++)h[u]=o[u+16];return M(t,e,r,i,n,h,s)}var A=function(t){var e,r,i,n,o,a,s,h;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,r=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|r<<3),i=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|i<<6),n=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(i>>>7|n<<9),o=255&t[8]|(255&t[9])<<8,this.r[4]=255&(n>>>4|o<<12),this.r[5]=o>>>1&8190,a=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(o>>>14|a<<2),s=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(a>>>11|s<<5),h=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(s>>>8|h<<8),this.r[9]=h>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function E(t,e,r,i,n,o){var a=new A(o);return a.update(r,i,n),a.finish(t,e),0}function k(t,e,r,i,n,o){var a=new Uint8Array(16);return E(a,0,r,i,n,o),b(t,e,a,0)}function R(t,e,r,i,n){var o;if(r<32)return-1;for(x(t,0,e,0,r,i,n),E(t,16,t,32,r-32,t),o=0;o<16;o++)t[o]=0;return 0}function B(t,e,r,i,n){var o,a=new Uint8Array(32);if(r<32)return-1;if(S(a,0,32,i,n),0!==k(e,16,e,32,r-32,a))return-1;for(x(t,0,e,0,r,i,n),o=0;o<32;o++)t[o]=0;return 0}function I(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function T(t){var e,r,i=1;for(e=0;e<16;e++)r=t[e]+i+65535,i=Math.floor(r/65536),t[e]=r-65536*i;t[0]+=i-1+37*(i-1)}function P(t,e,r){for(var i,n=~(r-1),o=0;o<16;o++)i=n&(t[o]^e[o]),t[o]^=i,e[o]^=i}function j(t,r){var i,n,o,a=e(),s=e();for(i=0;i<16;i++)s[i]=r[i];for(T(s),T(s),T(s),n=0;n<2;n++){for(a[0]=s[0]-65517,i=1;i<15;i++)a[i]=s[i]-65535-(a[i-1]>>16&1),a[i-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),o=a[15]>>16&1,a[14]&=65535,P(s,a,1-o)}for(i=0;i<16;i++)t[2*i]=255&s[i],t[2*i+1]=s[i]>>8}function O(t,e){var r=new Uint8Array(32),i=new Uint8Array(32);return j(r,t),j(i,e),v(r,0,i,0)}function C(t){var e=new Uint8Array(32);return j(e,t),1&e[0]}function N(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function q(t,e,r){for(var i=0;i<16;i++)t[i]=e[i]+r[i]}function D(t,e,r){for(var i=0;i<16;i++)t[i]=e[i]-r[i]}function H(t,e,r){var i,n,o=0,a=0,s=0,h=0,u=0,f=0,c=0,d=0,l=0,p=0,m=0,b=0,v=0,y=0,g=0,w=0,M=0,_=0,S=0,x=0,A=0,E=0,k=0,R=0,B=0,I=0,T=0,P=0,j=0,O=0,C=0,N=r[0],q=r[1],D=r[2],H=r[3],z=r[4],L=r[5],U=r[6],F=r[7],K=r[8],J=r[9],Z=r[10],Q=r[11],Y=r[12],X=r[13],W=r[14],V=r[15];o+=(i=e[0])*N,a+=i*q,s+=i*D,h+=i*H,u+=i*z,f+=i*L,c+=i*U,d+=i*F,l+=i*K,p+=i*J,m+=i*Z,b+=i*Q,v+=i*Y,y+=i*X,g+=i*W,w+=i*V,a+=(i=e[1])*N,s+=i*q,h+=i*D,u+=i*H,f+=i*z,c+=i*L,d+=i*U,l+=i*F,p+=i*K,m+=i*J,b+=i*Z,v+=i*Q,y+=i*Y,g+=i*X,w+=i*W,M+=i*V,s+=(i=e[2])*N,h+=i*q,u+=i*D,f+=i*H,c+=i*z,d+=i*L,l+=i*U,p+=i*F,m+=i*K,b+=i*J,v+=i*Z,y+=i*Q,g+=i*Y,w+=i*X,M+=i*W,_+=i*V,h+=(i=e[3])*N,u+=i*q,f+=i*D,c+=i*H,d+=i*z,l+=i*L,p+=i*U,m+=i*F,b+=i*K,v+=i*J,y+=i*Z,g+=i*Q,w+=i*Y,M+=i*X,_+=i*W,S+=i*V,u+=(i=e[4])*N,f+=i*q,c+=i*D,d+=i*H,l+=i*z,p+=i*L,m+=i*U,b+=i*F,v+=i*K,y+=i*J,g+=i*Z,w+=i*Q,M+=i*Y,_+=i*X,S+=i*W,x+=i*V,f+=(i=e[5])*N,c+=i*q,d+=i*D,l+=i*H,p+=i*z,m+=i*L,b+=i*U,v+=i*F,y+=i*K,g+=i*J,w+=i*Z,M+=i*Q,_+=i*Y,S+=i*X,x+=i*W,A+=i*V,c+=(i=e[6])*N,d+=i*q,l+=i*D,p+=i*H,m+=i*z,b+=i*L,v+=i*U,y+=i*F,g+=i*K,w+=i*J,M+=i*Z,_+=i*Q,S+=i*Y,x+=i*X,A+=i*W,E+=i*V,d+=(i=e[7])*N,l+=i*q,p+=i*D,m+=i*H,b+=i*z,v+=i*L,y+=i*U,g+=i*F,w+=i*K,M+=i*J,_+=i*Z,S+=i*Q,x+=i*Y,A+=i*X,E+=i*W,k+=i*V,l+=(i=e[8])*N,p+=i*q,m+=i*D,b+=i*H,v+=i*z,y+=i*L,g+=i*U,w+=i*F,M+=i*K,_+=i*J,S+=i*Z,x+=i*Q,A+=i*Y,E+=i*X,k+=i*W,R+=i*V,p+=(i=e[9])*N,m+=i*q,b+=i*D,v+=i*H,y+=i*z,g+=i*L,w+=i*U,M+=i*F,_+=i*K,S+=i*J,x+=i*Z,A+=i*Q,E+=i*Y,k+=i*X,R+=i*W,B+=i*V,m+=(i=e[10])*N,b+=i*q,v+=i*D,y+=i*H,g+=i*z,w+=i*L,M+=i*U,_+=i*F,S+=i*K,x+=i*J,A+=i*Z,E+=i*Q,k+=i*Y,R+=i*X,B+=i*W,I+=i*V,b+=(i=e[11])*N,v+=i*q,y+=i*D,g+=i*H,w+=i*z,M+=i*L,_+=i*U,S+=i*F,x+=i*K,A+=i*J,E+=i*Z,k+=i*Q,R+=i*Y,B+=i*X,I+=i*W,T+=i*V,v+=(i=e[12])*N,y+=i*q,g+=i*D,w+=i*H,M+=i*z,_+=i*L,S+=i*U,x+=i*F,A+=i*K,E+=i*J,k+=i*Z,R+=i*Q,B+=i*Y,I+=i*X,T+=i*W,P+=i*V,y+=(i=e[13])*N,g+=i*q,w+=i*D,M+=i*H,_+=i*z,S+=i*L,x+=i*U,A+=i*F,E+=i*K,k+=i*J,R+=i*Z,B+=i*Q,I+=i*Y,T+=i*X,P+=i*W,j+=i*V,g+=(i=e[14])*N,w+=i*q,M+=i*D,_+=i*H,S+=i*z,x+=i*L,A+=i*U,E+=i*F,k+=i*K,R+=i*J,B+=i*Z,I+=i*Q,T+=i*Y,P+=i*X,j+=i*W,O+=i*V,w+=(i=e[15])*N,a+=38*(_+=i*D),s+=38*(S+=i*H),h+=38*(x+=i*z),u+=38*(A+=i*L),f+=38*(E+=i*U),c+=38*(k+=i*F),d+=38*(R+=i*K),l+=38*(B+=i*J),p+=38*(I+=i*Z),m+=38*(T+=i*Q),b+=38*(P+=i*Y),v+=38*(j+=i*X),y+=38*(O+=i*W),g+=38*(C+=i*V),o=(i=(o+=38*(M+=i*q))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),a=(i=a+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),o=(i=(o+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(i/65536)),a=(i=a+n+65535)-65536*(n=Math.floor(i/65536)),s=(i=s+n+65535)-65536*(n=Math.floor(i/65536)),h=(i=h+n+65535)-65536*(n=Math.floor(i/65536)),u=(i=u+n+65535)-65536*(n=Math.floor(i/65536)),f=(i=f+n+65535)-65536*(n=Math.floor(i/65536)),c=(i=c+n+65535)-65536*(n=Math.floor(i/65536)),d=(i=d+n+65535)-65536*(n=Math.floor(i/65536)),l=(i=l+n+65535)-65536*(n=Math.floor(i/65536)),p=(i=p+n+65535)-65536*(n=Math.floor(i/65536)),m=(i=m+n+65535)-65536*(n=Math.floor(i/65536)),b=(i=b+n+65535)-65536*(n=Math.floor(i/65536)),v=(i=v+n+65535)-65536*(n=Math.floor(i/65536)),y=(i=y+n+65535)-65536*(n=Math.floor(i/65536)),g=(i=g+n+65535)-65536*(n=Math.floor(i/65536)),w=(i=w+n+65535)-65536*(n=Math.floor(i/65536)),o+=n-1+37*(n-1),t[0]=o,t[1]=a,t[2]=s,t[3]=h,t[4]=u,t[5]=f,t[6]=c,t[7]=d,t[8]=l,t[9]=p,t[10]=m,t[11]=b,t[12]=v,t[13]=y,t[14]=g,t[15]=w}function z(t,e){H(t,e,e)}function L(t,r){var i,n=e();for(i=0;i<16;i++)n[i]=r[i];for(i=253;i>=0;i--)z(n,n),2!==i&&4!==i&&H(n,n,r);for(i=0;i<16;i++)t[i]=n[i]}function U(t,r,i){var n,o,a=new Uint8Array(32),s=new Float64Array(80),u=e(),f=e(),c=e(),d=e(),l=e(),p=e();for(o=0;o<31;o++)a[o]=r[o];for(a[31]=127&r[31]|64,a[0]&=248,N(s,i),o=0;o<16;o++)f[o]=s[o],d[o]=u[o]=c[o]=0;for(u[0]=d[0]=1,o=254;o>=0;--o)P(u,f,n=a[o>>>3]>>>(7&o)&1),P(c,d,n),q(l,u,c),D(u,u,c),q(c,f,d),D(f,f,d),z(d,l),z(p,u),H(u,c,u),H(c,f,l),q(l,u,c),D(u,u,c),z(f,u),D(c,d,p),H(u,c,h),q(u,u,d),H(c,c,u),H(u,d,p),H(d,f,s),z(f,l),P(u,f,n),P(c,d,n);for(o=0;o<16;o++)s[o+16]=u[o],s[o+32]=c[o],s[o+48]=f[o],s[o+64]=d[o];var m=s.subarray(32),b=s.subarray(16);return L(m,m),H(b,b,m),j(t,b),0}function F(t,e){return U(t,e,o)}function K(t,e){return i(e,32),F(t,e)}function J(t,e,r){var i=new Uint8Array(32);return U(i,r,e),g(t,n,i,w)}A.prototype.blocks=function(t,e,r){for(var i,n,o,a,s,h,u,f,c,d,l,p,m,b,v,y,g,w,M,_=this.fin?0:2048,S=this.h[0],x=this.h[1],A=this.h[2],E=this.h[3],k=this.h[4],R=this.h[5],B=this.h[6],I=this.h[7],T=this.h[8],P=this.h[9],j=this.r[0],O=this.r[1],C=this.r[2],N=this.r[3],q=this.r[4],D=this.r[5],H=this.r[6],z=this.r[7],L=this.r[8],U=this.r[9];r>=16;)d=c=0,d+=(S+=8191&(i=255&t[e+0]|(255&t[e+1])<<8))*j,d+=(x+=8191&(i>>>13|(n=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*U),d+=(A+=8191&(n>>>10|(o=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*L),d+=(E+=8191&(o>>>7|(a=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*z),c=(d+=(k+=8191&(a>>>4|(s=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*H))>>>13,d&=8191,d+=(R+=s>>>1&8191)*(5*D),d+=(B+=8191&(s>>>14|(h=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*q),d+=(I+=8191&(h>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*N),d+=(T+=8191&(u>>>8|(f=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*C),l=c+=(d+=(P+=f>>>5|_)*(5*O))>>>13,l+=S*O,l+=x*j,l+=A*(5*U),l+=E*(5*L),c=(l+=k*(5*z))>>>13,l&=8191,l+=R*(5*H),l+=B*(5*D),l+=I*(5*q),l+=T*(5*N),c+=(l+=P*(5*C))>>>13,l&=8191,p=c,p+=S*C,p+=x*O,p+=A*j,p+=E*(5*U),c=(p+=k*(5*L))>>>13,p&=8191,p+=R*(5*z),p+=B*(5*H),p+=I*(5*D),p+=T*(5*q),m=c+=(p+=P*(5*N))>>>13,m+=S*N,m+=x*C,m+=A*O,m+=E*j,c=(m+=k*(5*U))>>>13,m&=8191,m+=R*(5*L),m+=B*(5*z),m+=I*(5*H),m+=T*(5*D),b=c+=(m+=P*(5*q))>>>13,b+=S*q,b+=x*N,b+=A*C,b+=E*O,c=(b+=k*j)>>>13,b&=8191,b+=R*(5*U),b+=B*(5*L),b+=I*(5*z),b+=T*(5*H),v=c+=(b+=P*(5*D))>>>13,v+=S*D,v+=x*q,v+=A*N,v+=E*C,c=(v+=k*O)>>>13,v&=8191,v+=R*j,v+=B*(5*U),v+=I*(5*L),v+=T*(5*z),y=c+=(v+=P*(5*H))>>>13,y+=S*H,y+=x*D,y+=A*q,y+=E*N,c=(y+=k*C)>>>13,y&=8191,y+=R*O,y+=B*j,y+=I*(5*U),y+=T*(5*L),g=c+=(y+=P*(5*z))>>>13,g+=S*z,g+=x*H,g+=A*D,g+=E*q,c=(g+=k*N)>>>13,g&=8191,g+=R*C,g+=B*O,g+=I*j,g+=T*(5*U),w=c+=(g+=P*(5*L))>>>13,w+=S*L,w+=x*z,w+=A*H,w+=E*D,c=(w+=k*q)>>>13,w&=8191,w+=R*N,w+=B*C,w+=I*O,w+=T*j,M=c+=(w+=P*(5*U))>>>13,M+=S*U,M+=x*L,M+=A*z,M+=E*H,c=(M+=k*D)>>>13,M&=8191,M+=R*q,M+=B*N,M+=I*C,M+=T*O,S=d=8191&(c=(c=((c+=(M+=P*j)>>>13)<<2)+c|0)+(d&=8191)|0),x=l+=c>>>=13,A=p&=8191,E=m&=8191,k=b&=8191,R=v&=8191,B=y&=8191,I=g&=8191,T=w&=8191,P=M&=8191,e+=16,r-=16;this.h[0]=S,this.h[1]=x,this.h[2]=A,this.h[3]=E,this.h[4]=k,this.h[5]=R,this.h[6]=B,this.h[7]=I,this.h[8]=T,this.h[9]=P},A.prototype.finish=function(t,e){var r,i,n,o,a=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,o=1;o<10;o++)a[o]=this.h[o]+r,r=a[o]>>>13,a[o]&=8191;for(a[9]-=8192,i=(1^r)-1,o=0;o<10;o++)a[o]&=i;for(i=~i,o=0;o<10;o++)this.h[o]=this.h[o]&i|a[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,o=1;o<8;o++)n=(this.h[o]+this.pad[o]|0)+(n>>>16)|0,this.h[o]=65535&n;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},A.prototype.update=function(t,e,r){var i,n;if(this.leftover){for((n=16-this.leftover)>r&&(n=r),i=0;i<n;i++)this.buffer[this.leftover+i]=t[e+i];if(r-=n,e+=n,this.leftover+=n,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(n=r-r%16,this.blocks(t,e,n),e+=n,r-=n),r){for(i=0;i<r;i++)this.buffer[this.leftover+i]=t[e+i];this.leftover+=r}};var Z=R,Q=B;var Y=[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 X(t,e,r,i){for(var n,o,a,s,h,u,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,E,k,R,B,I=new Int32Array(16),T=new Int32Array(16),P=t[0],j=t[1],O=t[2],C=t[3],N=t[4],q=t[5],D=t[6],H=t[7],z=e[0],L=e[1],U=e[2],F=e[3],K=e[4],J=e[5],Z=e[6],Q=e[7],X=0;i>=128;){for(_=0;_<16;_++)S=8*_+X,I[_]=r[S+0]<<24|r[S+1]<<16|r[S+2]<<8|r[S+3],T[_]=r[S+4]<<24|r[S+5]<<16|r[S+6]<<8|r[S+7];for(_=0;_<80;_++)if(n=P,o=j,a=O,s=C,h=N,u=q,f=D,H,d=z,l=L,p=U,m=F,b=K,v=J,y=Z,Q,E=65535&(A=Q),k=A>>>16,R=65535&(x=H),B=x>>>16,E+=65535&(A=(K>>>14|N<<18)^(K>>>18|N<<14)^(N>>>9|K<<23)),k+=A>>>16,R+=65535&(x=(N>>>14|K<<18)^(N>>>18|K<<14)^(K>>>9|N<<23)),B+=x>>>16,E+=65535&(A=K&J^~K&Z),k+=A>>>16,R+=65535&(x=N&q^~N&D),B+=x>>>16,x=Y[2*_],E+=65535&(A=Y[2*_+1]),k+=A>>>16,R+=65535&x,B+=x>>>16,x=I[_%16],k+=(A=T[_%16])>>>16,R+=65535&x,B+=x>>>16,R+=(k+=(E+=65535&A)>>>16)>>>16,E=65535&(A=M=65535&E|k<<16),k=A>>>16,R=65535&(x=w=65535&R|(B+=R>>>16)<<16),B=x>>>16,E+=65535&(A=(z>>>28|P<<4)^(P>>>2|z<<30)^(P>>>7|z<<25)),k+=A>>>16,R+=65535&(x=(P>>>28|z<<4)^(z>>>2|P<<30)^(z>>>7|P<<25)),B+=x>>>16,k+=(A=z&L^z&U^L&U)>>>16,R+=65535&(x=P&j^P&O^j&O),B+=x>>>16,c=65535&(R+=(k+=(E+=65535&A)>>>16)>>>16)|(B+=R>>>16)<<16,g=65535&E|k<<16,E=65535&(A=m),k=A>>>16,R=65535&(x=s),B=x>>>16,k+=(A=M)>>>16,R+=65535&(x=w),B+=x>>>16,j=n,O=o,C=a,N=s=65535&(R+=(k+=(E+=65535&A)>>>16)>>>16)|(B+=R>>>16)<<16,q=h,D=u,H=f,P=c,L=d,U=l,F=p,K=m=65535&E|k<<16,J=b,Z=v,Q=y,z=g,_%16==15)for(S=0;S<16;S++)x=I[S],E=65535&(A=T[S]),k=A>>>16,R=65535&x,B=x>>>16,x=I[(S+9)%16],E+=65535&(A=T[(S+9)%16]),k+=A>>>16,R+=65535&x,B+=x>>>16,w=I[(S+1)%16],E+=65535&(A=((M=T[(S+1)%16])>>>1|w<<31)^(M>>>8|w<<24)^(M>>>7|w<<25)),k+=A>>>16,R+=65535&(x=(w>>>1|M<<31)^(w>>>8|M<<24)^w>>>7),B+=x>>>16,w=I[(S+14)%16],k+=(A=((M=T[(S+14)%16])>>>19|w<<13)^(w>>>29|M<<3)^(M>>>6|w<<26))>>>16,R+=65535&(x=(w>>>19|M<<13)^(M>>>29|w<<3)^w>>>6),B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,I[S]=65535&R|B<<16,T[S]=65535&E|k<<16;E=65535&(A=z),k=A>>>16,R=65535&(x=P),B=x>>>16,x=t[0],k+=(A=e[0])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[0]=P=65535&R|B<<16,e[0]=z=65535&E|k<<16,E=65535&(A=L),k=A>>>16,R=65535&(x=j),B=x>>>16,x=t[1],k+=(A=e[1])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[1]=j=65535&R|B<<16,e[1]=L=65535&E|k<<16,E=65535&(A=U),k=A>>>16,R=65535&(x=O),B=x>>>16,x=t[2],k+=(A=e[2])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[2]=O=65535&R|B<<16,e[2]=U=65535&E|k<<16,E=65535&(A=F),k=A>>>16,R=65535&(x=C),B=x>>>16,x=t[3],k+=(A=e[3])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[3]=C=65535&R|B<<16,e[3]=F=65535&E|k<<16,E=65535&(A=K),k=A>>>16,R=65535&(x=N),B=x>>>16,x=t[4],k+=(A=e[4])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[4]=N=65535&R|B<<16,e[4]=K=65535&E|k<<16,E=65535&(A=J),k=A>>>16,R=65535&(x=q),B=x>>>16,x=t[5],k+=(A=e[5])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[5]=q=65535&R|B<<16,e[5]=J=65535&E|k<<16,E=65535&(A=Z),k=A>>>16,R=65535&(x=D),B=x>>>16,x=t[6],k+=(A=e[6])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[6]=D=65535&R|B<<16,e[6]=Z=65535&E|k<<16,E=65535&(A=Q),k=A>>>16,R=65535&(x=H),B=x>>>16,x=t[7],k+=(A=e[7])>>>16,R+=65535&x,B+=x>>>16,B+=(R+=(k+=(E+=65535&A)>>>16)>>>16)>>>16,t[7]=H=65535&R|B<<16,e[7]=Q=65535&E|k<<16,X+=128,i-=128}return i}function W(t,e,r){var i,n=new Int32Array(8),o=new Int32Array(8),a=new Uint8Array(256),s=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,X(n,o,e,r),r%=128,i=0;i<r;i++)a[i]=e[s-r+i];for(a[r]=128,a[(r=256-128*(r<112?1:0))-9]=0,p(a,r-8,s/536870912|0,s<<3),X(n,o,a,r),i=0;i<8;i++)p(t,8*i,n[i],o[i]);return 0}function V(t,r){var i=e(),n=e(),o=e(),a=e(),s=e(),h=e(),u=e(),c=e(),d=e();D(i,t[1],t[0]),D(d,r[1],r[0]),H(i,i,d),q(n,t[0],t[1]),q(d,r[0],r[1]),H(n,n,d),H(o,t[3],r[3]),H(o,o,f),H(a,t[2],r[2]),q(a,a,a),D(s,n,i),D(h,a,o),q(u,a,o),q(c,n,i),H(t[0],s,h),H(t[1],c,u),H(t[2],u,h),H(t[3],s,c)}function G(t,e,r){var i;for(i=0;i<4;i++)P(t[i],e[i],r)}function $(t,r){var i=e(),n=e(),o=e();L(o,r[2]),H(i,r[0],o),H(n,r[1],o),j(t,n),t[31]^=C(i)<<7}function tt(t,e,r){var i,n;for(I(t[0],a),I(t[1],s),I(t[2],s),I(t[3],a),n=255;n>=0;--n)G(t,e,i=r[n/8|0]>>(7&n)&1),V(e,t),V(t,t),G(t,e,i)}function et(t,r){var i=[e(),e(),e(),e()];I(i[0],c),I(i[1],d),I(i[2],s),H(i[3],c,d),tt(t,i,r)}function rt(t,r,n){var o,a=new Uint8Array(64),s=[e(),e(),e(),e()];for(n||i(r,32),W(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,et(s,a),$(t,s),o=0;o<32;o++)r[o+32]=t[o];return 0}var it=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function nt(t,e){var r,i,n,o;for(i=63;i>=32;--i){for(r=0,n=i-32,o=i-12;n<o;++n)e[n]+=r-16*e[i]*it[n-(i-32)],r=e[n]+128>>8,e[n]-=256*r;e[n]+=r,e[i]=0}for(r=0,n=0;n<32;n++)e[n]+=r-(e[31]>>4)*it[n],r=e[n]>>8,e[n]&=255;for(n=0;n<32;n++)e[n]-=r*it[n];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function ot(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;nt(t,r)}function at(t,r,i,n){var o,a,s=new Uint8Array(64),h=new Uint8Array(64),u=new Uint8Array(64),f=new Float64Array(64),c=[e(),e(),e(),e()];W(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=i+64;for(o=0;o<i;o++)t[64+o]=r[o];for(o=0;o<32;o++)t[32+o]=s[32+o];for(W(u,t.subarray(32),i+32),ot(u),et(c,u),$(t,c),o=32;o<64;o++)t[o]=n[o];for(W(h,t,i+64),ot(h),o=0;o<64;o++)f[o]=0;for(o=0;o<32;o++)f[o]=u[o];for(o=0;o<32;o++)for(a=0;a<32;a++)f[o+a]+=h[o]*s[a];return nt(t.subarray(32),f),d}function st(t,r){var i=e(),n=e(),o=e(),h=e(),f=e(),c=e(),d=e();return I(t[2],s),N(t[1],r),z(o,t[1]),H(h,o,u),D(o,o,t[2]),q(h,t[2],h),z(f,h),z(c,f),H(d,c,f),H(i,d,o),H(i,i,h),function(t,r){var i,n=e();for(i=0;i<16;i++)n[i]=r[i];for(i=250;i>=0;i--)z(n,n),1!==i&&H(n,n,r);for(i=0;i<16;i++)t[i]=n[i]}(i,i),H(i,i,o),H(i,i,h),H(i,i,h),H(t[0],i,h),z(n,t[0]),H(n,n,h),O(n,o)&&H(t[0],t[0],l),z(n,t[0]),H(n,n,h),O(n,o)?-1:(C(t[0])===r[31]>>7&&D(t[0],a,t[0]),H(t[3],t[0],t[1]),0)}function ht(t,r,i,n){var o,a=new Uint8Array(32),s=new Uint8Array(64),h=[e(),e(),e(),e()],u=[e(),e(),e(),e()];if(-1,i<64)return-1;if(st(u,n))return-1;for(o=0;o<i;o++)t[o]=r[o];for(o=0;o<32;o++)t[o+32]=n[o];if(W(s,t,i),ot(s),tt(h,u,s),et(u,r.subarray(32)),V(h,u),$(a,h),i-=64,v(r,0,a,0)){for(o=0;o<i;o++)t[o]=0;return-1}for(o=0;o<i;o++)t[o]=r[o+64];return i}var ut=32,ft=24,ct=32,dt=32,lt=ft;function pt(t,e){if(t.length!==ut)throw new Error("bad key size");if(e.length!==ft)throw new Error("bad nonce size")}function mt(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function bt(t){for(var e=0;e<t.length;e++)t[e]=0}t.lowlevel={crypto_core_hsalsa20:g,crypto_stream_xor:x,crypto_stream:S,crypto_stream_salsa20_xor:M,crypto_stream_salsa20:_,crypto_onetimeauth:E,crypto_onetimeauth_verify:k,crypto_verify_16:b,crypto_verify_32:v,crypto_secretbox:R,crypto_secretbox_open:B,crypto_scalarmult:U,crypto_scalarmult_base:F,crypto_box_beforenm:J,crypto_box_afternm:Z,crypto_box:function(t,e,r,i,n,o){var a=new Uint8Array(32);return J(a,n,o),Z(t,e,r,i,a)},crypto_box_open:function(t,e,r,i,n,o){var a=new Uint8Array(32);return J(a,n,o),Q(t,e,r,i,a)},crypto_box_keypair:K,crypto_hash:W,crypto_sign:at,crypto_sign_keypair:rt,crypto_sign_open:ht,crypto_secretbox_KEYBYTES:ut,crypto_secretbox_NONCEBYTES:ft,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:ct,crypto_box_SECRETKEYBYTES:dt,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:lt,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64},t.randomBytes=function(t){var e=new Uint8Array(t);return i(e,t),e},t.secretbox=function(t,e,r){mt(t,e,r),pt(r,e);for(var i=new Uint8Array(32+t.length),n=new Uint8Array(i.length),o=0;o<t.length;o++)i[o+32]=t[o];return R(n,i,i.length,e,r),n.subarray(16)},t.secretbox.open=function(t,e,r){mt(t,e,r),pt(r,e);for(var i=new Uint8Array(16+t.length),n=new Uint8Array(i.length),o=0;o<t.length;o++)i[o+16]=t[o];return i.length<32?null:0!==B(n,i,i.length,e,r)?null:n.subarray(32)},t.secretbox.keyLength=ut,t.secretbox.nonceLength=ft,t.secretbox.overheadLength=16,t.scalarMult=function(t,e){if(mt(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var r=new Uint8Array(32);return U(r,t,e),r},t.scalarMult.base=function(t){if(mt(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return F(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,r,i,n){var o=t.box.before(i,n);return t.secretbox(e,r,o)},t.box.before=function(t,e){mt(t,e),function(t,e){if(t.length!==ct)throw new Error("bad public key size");if(e.length!==dt)throw new Error("bad secret key size")}(t,e);var r=new Uint8Array(32);return J(r,t,e),r},t.box.after=t.secretbox,t.box.open=function(e,r,i,n){var o=t.box.before(i,n);return t.secretbox.open(e,r,o)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(ct),e=new Uint8Array(dt);return K(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(mt(t),t.length!==dt)throw new Error("bad secret key size");var e=new Uint8Array(ct);return F(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=ct,t.box.secretKeyLength=dt,t.box.sharedKeyLength=32,t.box.nonceLength=lt,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(mt(t,e),64!==e.length)throw new Error("bad secret key size");var r=new Uint8Array(64+t.length);return at(r,t,t.length,e),r},t.sign.open=function(t,e){if(mt(t,e),32!==e.length)throw new Error("bad public key size");var r=new Uint8Array(t.length),i=ht(r,t,t.length,e);if(i<0)return null;for(var n=new Uint8Array(i),o=0;o<n.length;o++)n[o]=r[o];return n},t.sign.detached=function(e,r){for(var i=t.sign(e,r),n=new Uint8Array(64),o=0;o<n.length;o++)n[o]=i[o];return n},t.sign.detached.verify=function(t,e,r){if(mt(t,e,r),64!==e.length)throw new Error("bad signature size");if(32!==r.length)throw new Error("bad public key size");var i,n=new Uint8Array(64+t.length),o=new Uint8Array(64+t.length);for(i=0;i<64;i++)n[i]=e[i];for(i=0;i<t.length;i++)n[i+64]=t[i];return ht(o,n,n.length,r)>=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(mt(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),r=0;r<e.length;r++)e[r]=t[32+r];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(mt(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(32),r=new Uint8Array(64),i=0;i<32;i++)r[i]=t[i];return rt(e,r,!0),{publicKey:e,secretKey:r}},t.sign.publicKeyLength=32,t.sign.secretKeyLength=64,t.sign.seedLength=32,t.sign.signatureLength=64,t.hash=function(t){mt(t);var e=new Uint8Array(64);return W(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return mt(t,e),0!==t.length&&0!==e.length&&(t.length===e.length&&0===m(t,0,e,0,t.length))},t.setPRNG=function(t){i=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){t.setPRNG(function(t,r){var i,n=new Uint8Array(r);for(i=0;i<r;i+=65536)e.getRandomValues(n.subarray(i,i+Math.min(r-i,65536)));for(i=0;i<r;i++)t[i]=n[i];bt(n)})}else(e=r(171))&&e.randomBytes&&t.setPRNG(function(t,r){var i,n=e.randomBytes(r);for(i=0;i<r;i++)t[i]=n[i];bt(n)})}()}(t.exports?t.exports:self.nacl=self.nacl||{})},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="utf8: invalid string",n="utf8: invalid source encoding";function o(t){for(var e=0,r=0;r<t.length;r++){var n=t.charCodeAt(r);if(n<128)e+=1;else if(n<2048)e+=2;else if(n<55296)e+=3;else{if(!(n<=57343))throw new Error(i);if(r>=t.length-1)throw new Error(i);r++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),r=0,i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e[r++]=n:n<2048?(e[r++]=192|n>>6,e[r++]=128|63&n):n<55296?(e[r++]=224|n>>12,e[r++]=128|n>>6&63,e[r++]=128|63&n):(i++,n=(1023&n)<<10,n|=1023&t.charCodeAt(i),n+=65536,e[r++]=240|n>>18,e[r++]=128|n>>12&63,e[r++]=128|n>>6&63,e[r++]=128|63&n)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];if(128&i){var o=void 0;if(i<224){if(r>=t.length)throw new Error(n);if(128!=(192&(a=t[++r])))throw new Error(n);i=(31&i)<<6|63&a,o=128}else if(i<240){if(r>=t.length-1)throw new Error(n);var a=t[++r],s=t[++r];if(128!=(192&a)||128!=(192&s))throw new Error(n);i=(15&i)<<12|(63&a)<<6|63&s,o=2048}else{if(!(i<248))throw new Error(n);if(r>=t.length-2)throw new Error(n);a=t[++r],s=t[++r];var h=t[++r];if(128!=(192&a)||128!=(192&s)||128!=(192&h))throw new Error(n);i=(15&i)<<18|(63&a)<<12|(63&s)<<6|63&h,o=65536}if(i<o||i>=55296&&i<=57343)throw new Error(n);if(i>=65536){if(i>1114111)throw new Error(n);i-=65536,e.push(String.fromCharCode(55296|i>>10)),i=56320|1023&i}}e.push(String.fromCharCode(i))}return e.join("")}},function(t,e,r){t.exports=r(174).default,t.exports.default=t.exports},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),n=r(175);function o(t,e){return void 0===e&&(e="utf8"),i.Buffer.isBuffer(t)?s(t.toString("base64")):s(i.Buffer.from(t,e).toString("base64"))}function a(t){return t=t.toString(),n.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function s(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var h=o;h.encode=o,h.decode=function(t,e){return void 0===e&&(e="utf8"),i.Buffer.from(a(t),"base64").toString(e)},h.toBase64=a,h.fromBase64=s,h.toBuffer=function(t){return i.Buffer.from(a(t),"base64")},e.default=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(0);e.default=function(t){var e=t.length,r=e%4;if(!r)return t;var n=e,o=4-r,a=e+o,s=i.Buffer.alloc(a);for(s.write(t);o--;)s.write("=",n++);return s.toString()}}])});