text: !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=97)}([function(t,e){var r=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},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(169),n=r(170),o=r(171);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(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 h(this,t,e,r)}function h(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);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.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(!u.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(u.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||function(t){return t!=t}(e.length)?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}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)),!u.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(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var 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=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,u.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,u=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,u/=2,r/=2}function h(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var f=-1;for(o=r;o<s;o++)if(h(t,o)===h(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var c=!0,d=0;d<u;d++)if(h(t,o+d)!==h(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 F(z(e,t.length-r),t,r,i)}function w(t,e,r,i){return F(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 F(L(e),t,r,i)}function S(t,e,r,i){return F(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,u,h=t[n],f=null,c=h>239?4:h>223?3:h>191?2:1;if(n+c<=r)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[n+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(u=(15&h)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&h)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}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<=k)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=k));return r}(i)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return h(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(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)},u.allocUnsafe=function(t){return c(null,t)},u.allocUnsafeSlow=function(t){return c(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var 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},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=u.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,n),n+=a.length}return i},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)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},u.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 E(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)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",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+">"},u.prototype.compare=function(t,e,r,i,n){if(!u.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(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;for(var o=n-i,a=r-e,s=Math.min(o,a),h=this.slice(i,n),f=t.slice(e,r),c=0;c<s;++c)if(h[c]!==f[c]){o=h[c],a=f[c];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function E(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 j(t,e,r,i,n,o){if(!u.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 P(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}u.prototype.slice=function(t,e){var r,i=this.length;if(t=~~t,e=void 0===e?i:~~e,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),e<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var n=e-t;r=new u(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+t]}return r},u.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},u.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},u.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},u.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]},u.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])},u.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},u.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},u.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.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},u.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},u.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},u.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]},u.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),n.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),n.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||j(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},u.prototype.writeUIntBE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||j(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},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);j(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},u.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},u.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||!u.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},u.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&&!u.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=u.isBuffer(t)?t:z(new u(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 F(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(11))},function(t,e,r){"use strict";var i=e;i.version=r(144).version,i.utils=r(145),i.rand=r(147),i.curve=r(38),i.curves=r(153),i.ec=r(161),i.eddsa=r(165)},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(47)("wks"),n=r(34),o=r(3).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){var i=r(3),n=r(0),o=r(23),a=r(12),s=r(14),u=function(t,e,r){var h,f,c,d=t&u.F,l=t&u.G,p=t&u.S,m=t&u.P,b=t&u.B,v=t&u.W,y=l?n:n[e]||(n[e]={}),g=y.prototype,w=l?i:p?i[e]:(i[e]||{}).prototype;for(h in l&&(r=e),r)(f=!d&&w&&void 0!==w[h])&&s(y,h)||(c=f?w[h]:r[h],y[h]=l&&"function"!=typeof w[h]?r[h]:b&&f?o(c,i):v&&w[h]==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={}))[h]=c,t&u.R&&g&&!g[h]&&a(g,h,c)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},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(146).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 u(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,h=0,f=r;f<s;f+=i)h=u(t,f,f+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==a){var c=1;for(h=u(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},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 h=["","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,u=a/67108864|0;r.words[0]=s;for(var h=1;h<i;h++){for(var f=u>>>26,c=67108863&u,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+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:h[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,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s<o;s++)h[s]=0}else{for(s=0;s<o-n;s++)h[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[o-s-1]=a}return h},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,u=r.words,h=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],k=8191&A,E=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],j=8191&T,P=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,F=z>>>13,U=0|s[1],K=8191&U,J=U>>>13,Z=0|s[2],X=8191&Z,Q=Z>>>13,W=0|s[3],Y=8191&W,V=W>>>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],ut=8191&st,ht=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=(h+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(d,L)|0))<<13)|0;h=((o=Math.imul(d,F))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var vt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;h=((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,F))+Math.imul(y,L)|0,o=Math.imul(y,F),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=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Q)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(M,L)|0,o=Math.imul(M,F),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,X)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var gt=(h+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Y)|0))<<13)|0;h=((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,F))+Math.imul(x,L)|0,o=Math.imul(x,F),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,X)|0,n=(n=n+Math.imul(v,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,L),n=(n=Math.imul(k,F))+Math.imul(E,L)|0,o=Math.imul(E,F),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,X)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Q)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,Y)|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=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((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,F))+Math.imul(I,L)|0,o=Math.imul(I,F),i=i+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Y)|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=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(j,L),n=(n=Math.imul(j,F))+Math.imul(P,L)|0,o=Math.imul(P,F),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(k,X)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Q)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,Y)|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=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ut)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,F))+Math.imul(N,L)|0,o=Math.imul(N,F),i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(B,X)|0,n=(n=n+Math.imul(B,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((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,F))+Math.imul(H,L)|0,o=Math.imul(H,F),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(j,X)|0,n=(n=n+Math.imul(j,Q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|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=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((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,X)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,Q)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,V)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,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(k,rt)|0,n=(n=n+Math.imul(k,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|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 kt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,X),n=(n=Math.imul(D,Q))+Math.imul(H,X)|0,o=Math.imul(H,Q),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,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(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|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 Et=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,V))+Math.imul(H,Y)|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(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,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(k,ut)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|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=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((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(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var Bt=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((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(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|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=(h+(i=i+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ut),n=(n=Math.imul(D,ht))+Math.imul(H,ut)|0,o=Math.imul(H,ht),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 jt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Ot=(h+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return h=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=bt,u[1]=vt,u[2]=yt,u[3]=gt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=xt,u[9]=At,u[10]=kt,u[11]=Et,u[12]=Rt,u[13]=Bt,u[14]=It,u[15]=Tt,u[16]=jt,u[17]=Pt,u[18]=Ot,0!==h&&(u[19]=h,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,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),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,u=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=u,d=h,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=u*c-h*d,d=u*d+h*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),u=new Array(i),h=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,h,i),this.transform(a,o,s,u,i,n),this.transform(h,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-u[l]*c[l];u[l]=s[l]*c[l]+u[l]*f[l],s[l]=p}return this.conjugate(s,u,i),this.transform(s,u,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,u=(0|this.words[e])-s<<r;this.words[e]=u|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,u=r;if(n-=a,n=Math.max(0,n),u){for(var h=0;h<a;h++)u.words[h]=this.words[h];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&s}return u&&0!==f&&(u.words[u.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 u=(0|t.words[n])*e;s=((o-=67108863&u)>>26)-(u/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,u=i.length-n.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var f=i.clone()._ishlnsubmul(n,1,u);0===f.negative&&(i=f,s&&(s.words[u]=1));for(var c=u-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),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;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()||u.isOdd())&&(s.iadd(f),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(u)):(r.isub(e),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},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),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),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(u),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),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);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,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>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}u=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)}}(void 0===t||t,this)}).call(this,r(37)(t))},function(t,e,r){"use strict";var i=r(18),n=r(39);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(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),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var 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)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];"little"===e&&(n=o(n)),r+=s(n.toString(16))}return r},e.zero2=a,e.zero8=s,e.join32=function(t,e,r,n){var o=r-e;i(o%4==0);for(var a=new Array(o/4),s=0,u=e;s<a.length;s++,u+=4){var h;h="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],a[s]=h>>>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 u=0,h=e;return u+=(h=h+i>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+n+a+(u+=(h=h+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,u,h){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+u+(f+=(c=c+h>>>0)<h?1:0)>>>0},e.sum64_5_lo=function(t,e,r,i,n,o,a,s,u,h){return e+i+o+s+h>>>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,r){var i=r(9),n=r(63),o=r(44),a=Object.defineProperty;e.f=r(10)?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,r){var i=r(13);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){t.exports=!r(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=r(8),n=r(24);t.exports=r(10)?function(t,e,r){return i.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var i=r(67),n=r(42);t.exports=function(t){return i(n(t))}},function(t,e,r){t.exports=r(123)},function(t,e,r){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(r(28));e.default=function(t){return function(){var e=t.apply(this,arguments);return new i.default(function(t,r){return function n(o,a){try{var s=e[o](a),u=s.value}catch(t){return void r(t)}if(!s.done)return i.default.resolve(u).then(function(t){n("next",t)},function(t){n("throw",t)});t(u)}("next")})}}},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){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var i=r(66),n=r(48);t.exports=Object.keys||function(t){return i(t,n)}},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 u,h=[],f=!1,c=-1;function d(){f&&u&&(f=!1,u.length?h=u.concat(h):c=-1,h.length&&l())}function l(){if(!f){var t=s(d);f=!0;for(var e=h.length;e;){for(u=h,h=[];++c<e;)u&&u[c].run();c=-1,e=h.length}u=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];h.push(new p(t,e)),1!==h.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){t.exports=!0},function(t,e,r){var i=r(33);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,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports={}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){t.exports={default:r(125),__esModule:!0}},function(t,e,r){"use strict";var i=r(7),n=r(18);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(176).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 u=0,h=s;u<o.length;++u)h+=o[u]*r,o[u]=255&h,h>>=8;for(;h>0;)o.push(255&h),h>>=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 u="",h=0;0===e[h]&&h<e.length-1;++h)u+=n;for(var f=i.length-1;f>=0;--f)u+=t[i[f]];return u},decodeUnsafe:s,decode:function(t){var e=s(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(r(28));e.registerMethod=o,e.parse=a,e.resolve=s;var n={};function o(t,e){n[t]=e}function a(t){if(!t||""===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)}function s(t){return new i.default(function(e,r){var i=a(t),o=n[i.method];if(o)return o(t,i).then(e,r);r(new Error("Unsupported DID method: '"+i.method+"'"))})}e.default=s,s.registerMethod=o,s.parse=a,t.exports=s},function(t,e,r){"use strict";var i=r(101)(!0);r(62)(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){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},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,r){var i=r(8).f,n=r(14),o=r(4)("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){var i=r(42);t.exports=function(t){return Object(i(t))}},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(149),i.short=r(150),i.mont=r(151),i.edwards=r(152)},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){var i=r(59);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},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(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,r){var i=r(13),n=r(3).document,o=i(n)&&i(n.createElement);t.exports=function(t){return o?n.createElement(t):{}}},function(t,e,r){var i=r(13);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){var i=r(41),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},function(t,e,r){var i=r(47)("keys"),n=r(34);t.exports=function(t){return i[t]||(i[t]=n(t))}},function(t,e,r){var i=r(0),n=r(3),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(22)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){r(107);for(var i=r(3),n=r(12),o=r(25),a=r(4)("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(","),u=0;u<s.length;u++){var h=s[u],f=i[h],c=f&&f.prototype;c&&!c[a]&&n(c,a,h),o[h]=o.Array}},function(t,e,r){e.f=r(4)},function(t,e,r){var i=r(3),n=r(0),o=r(22),a=r(50),s=r(8).f;t.exports=function(t){var e=n.Symbol||(n.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var i=r(72),n=r(4)("iterator"),o=r(25);t.exports=r(0).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||o[i(t)]}},function(t,e,r){"use strict";var i=r(33);t.exports.f=function(t){return new function(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)}},function(t,e,r){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(r(80));e.default=i.default||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},function(t,e,r){var i=e;i.utils=r(7),i.common=r(29),i.sha=r(154),i.ripemd=r(158),i.hmac=r(159),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,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.sha256=function(e){return t.from(i.sha256.arrayBuffer(e))},e.keccak=o,e.toEthereumAddress=function(e){return"0x"+o(t.from(e.slice(2),"hex")).slice(-20).toString("hex")};var i=r(172),n=r(87);function o(e){return t.from(n.keccak_256.buffer(e))}}).call(this,r(1).Buffer)},function(t,e,r){t.exports=r(178).default,t.exports.default=t.exports},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(199),n=r(40);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";e.__esModule=!0;var i=a(r(99)),n=a(r(110)),o="function"==typeof n.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof n.default&&t.constructor===n.default&&t!==n.default.prototype?"symbol":typeof t};function a(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof n.default&&"symbol"===o(i.default)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof n.default&&t.constructor===n.default&&t!==n.default.prototype?"symbol":void 0===t?"undefined":o(t)}},function(t,e,r){"use strict";var i=r(22),n=r(5),o=r(64),a=r(12),s=r(25),u=r(102),h=r(35),f=r(106),c=r(4)("iterator"),d=!([].keys&&"next"in[].keys()),l=function(){return this};t.exports=function(t,e,r,p,m,b,v){u(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,k=A[c]||A["@@iterator"]||m&&A[m],E=k||M(m),R=m?S?M("entries"):E:void 0,B="Array"==e&&A.entries||k;if(B&&(w=f(B.call(new t)))!==Object.prototype&&w.next&&(h(w,_,!0),i||"function"==typeof w[c]||a(w,c,l)),S&&k&&"values"!==k.name&&(x=!0,E=function(){return k.call(this)}),i&&!v||!d&&!x&&A[c]||a(A,c,E),s[e]=E,s[_]=l,m)if(y={values:S?E:M("values"),keys:b?E: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,r){t.exports=!r(10)&&!r(19)(function(){return 7!=Object.defineProperty(r(43)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){t.exports=r(12)},function(t,e,r){var i=r(9),n=r(103),o=r(48),a=r(46)("IE_PROTO"),s=function(){},u=function(){var t,e=r(43)("iframe"),i=o.length;for(e.style.display="none",r(68).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;i--;)delete u.prototype[o[i]];return u()};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=u(),void 0===e?r:n(r,e)}},function(t,e,r){var i=r(14),n=r(15),o=r(104)(!1),a=r(46)("IE_PROTO");t.exports=function(t,e){var r,s=n(t),u=0,h=[];for(r in s)r!=a&&i(s,r)&&h.push(r);for(;e.length>u;)i(s,r=e[u++])&&(~o(h,r)||h.push(r));return h}},function(t,e,r){var i=r(26);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,r){var i=r(3).document;t.exports=i&&i.documentElement},function(t,e,r){var i=r(66),n=r(48).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},function(t,e){},function(t,e,r){t.exports={default:r(120),__esModule:!0}},function(t,e,r){var i=r(26),n=r(4)("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(9);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(25),n=r(4)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[n]===t)}},function(t,e,r){var i=r(9),n=r(33),o=r(4)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||void 0==(r=i(a)[o])?e:n(r)}},function(t,e,r){var i,n,o,a=r(23),s=r(129),u=r(68),h=r(43),f=r(3),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(26)(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 h("script")?function(t){u.appendChild(h("script")).onreadystatechange=function(){u.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(9),n=r(13),o=r(54);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){var i=r(4)("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){t.exports={default:r(136),__esModule:!0}},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(7).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(7),n=r(29),o=r(82),a=r(18),s=i.sum32,u=i.sum32_4,h=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]=u(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 _=h(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(7),n=r(29),o=r(18),a=i.rotr64_hi,s=i.rotr64_lo,u=i.shr64_hi,h=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 k(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function E(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)^u(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=s(t,e,1)^s(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,19)^s(e,t,29)^h(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],u=R(r[i-30],r[i-29]),h=B(r[i-30],r[i-29]),f=r[i-32],c=r[i-31];r[i]=l(n,o,a,s,u,h,f,c),r[i+1]=p(n,o,a,s,u,h,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],u=this.h[4],h=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],j=this.h[15];o(this.k.length===r.length);for(var P=0;P<r.length;P+=2){var O=T,C=j,N=k(v,y),q=E(v,y),D=w(v,y,g,R,B),H=M(v,y,g,R,B,I),z=this.k[P],L=this.k[P+1],F=r[P],U=r[P+1],K=m(O,C,N,q,D,H,z,L,F,U),J=b(O,C,N,q,D,H,z,L,F,U);O=x(i,n),C=A(i,n),N=_(i,n,a,s,u),q=S(i,n,a,s,u,h);var Z=c(O,C,N,q),X=d(O,C,N,q);T=B,j=I,B=g,I=R,g=v,R=y,v=c(l,p,K,J),y=d(p,p,K,J),l=u,p=h,u=a,h=s,a=i,s=n,i=c(K,J,Z,X),n=d(K,J,Z,X)}f(this.h,0,i,n),f(this.h,2,a,s),f(this.h,4,u,h),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,j)},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=function(t){return t&&t.__esModule?t:{default:t}}(r(168)),n=r(173);t.exports={SimpleSigner:i.default,verifyJWT:n.verifyJWT,createJWT:n.createJWT,decodeJWT:n.decodeJWT}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,r){(function(i,n){var o;
  /**
   * [js-sha3]{@link https://github.com/emn178/js-sha3}
   *
   * @version 0.7.0
   * @author Chen, Yi-Cyuan [emn178@gmail.com]
   * @copyright Chen, Yi-Cyuan 2015-2017
   * @license MIT
   */
  /**
   * [js-sha3]{@link https://github.com/emn178/js-sha3}
   *
   * @version 0.7.0
   * @author Chen, Yi-Cyuan [emn178@gmail.com]
   * @copyright Chen, Yi-Cyuan 2015-2017
   * @license MIT
   */
  !function(){"use strict";var a="input is invalid type",s="object"==typeof window,u=s?window:{};u.JS_SHA3_NO_WINDOW&&(s=!1);var h=!s&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?u=n:h&&(u=self);var f=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,c=r(86),d=!u.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};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!d||!u.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},k=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)},E=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:k},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:k},{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<E.length;++I)for(var T=E[I],j=T.bits,P=0;P<j.length;++P){var O=T.name+"_"+j[P];if(B.push(O),R[O]=T.createMethod(j[P],T.padding),"sha3"!==T.name){var C=T.name+j[P];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){var e,r=typeof t;if("string"!==r){if("object"!==r)throw a;if(null===t)throw a;if(d&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||d&&ArrayBuffer.isView(t)))throw a;e=!0}for(var i,n,o=this.blocks,s=this.byteCount,u=t.length,h=this.blockCount,f=0,c=this.s;f<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,i=1;i<h+1;++i)o[i]=0;if(e)for(i=this.start;f<u&&i<s;++f)o[i>>2]|=t[f]<<m[3&i++];else for(i=this.start;f<u&&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[h],i=0;i<h;++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 a;if(null===t)throw a;if(d&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||d&&ArrayBuffer.isView(t)))throw 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 u=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)u[a]=r[o];a%e==0&&D(r)}return n&&(u[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,u=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&D(i)}return o&&(t=s<<2,e=i[a],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},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,u,h,f,c,d,l,p,m,v,y,g,w,M,_,S,x,A,k,E,R,B,I,T,j,P,O,C,N,q,D,H,z,L,F,U,K,J,Z,X,Q,W,Y,V,G,$,tt,et,rt,it,nt,ot,at,st,ut,ht,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],u=t[4]^t[14]^t[24]^t[34]^t[44],h=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^(u<<1|h>>>31),r=o^(h<<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^(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=u^(d<<1|l>>>31),r=h^(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],X=t[11]<<4|t[10]>>>28,Q=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,ut=t[30]<<9|t[31]>>>23,U=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,W=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,j=t[32]<<13|t[33]>>>19,ht=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,P=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,k=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,E=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,F=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^~E&B,t[11]=k^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~X&W,t[31]=Z^~Q&Y,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=E^~B&T,t[13]=R^~I&j,t[22]=q^~H&L,t[23]=D^~z&F,t[32]=X^~W&V,t[33]=Q^~Y&G,t[42]=it^~ot&st,t[43]=nt^~at&ut,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&P,t[15]=I^~j&O,t[24]=H^~L&U,t[25]=z^~F&K,t[34]=W^~V&$,t[35]=Y^~G&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~S&p,t[7]=_^~x&m,t[16]=T^~P&A,t[17]=j^~O&k,t[26]=L^~U&C,t[27]=F^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=S^~p&v,t[9]=x^~m&y,t[18]=P^~A&E,t[19]=O^~k&R,t[28]=U^~C&q,t[29]=K^~N&D,t[38]=$^~J&X,t[39]=tt^~Z&Q,t[48]=ht^~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)u[B[I]]=R[B[I]];c&&(void 0===(o=function(){return R}.call(e,r,e,t))||(t.exports=o))}}()}).call(this,r(21),r(11))},function(t,e,r){t.exports={default:r(174),__esModule:!0}},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),u=e.slice(1,r),h=e.slice(r,20+r);if(e.slice(r+20).equals(s([i,u,h])))return{network:"0x"+a.encode(u),address:"0x"+h.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(175),n=r(1),o=r(30)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),a=r(30)("0123456789abcdef");function s(t){return new n.Buffer((0,i.sha3_256)(n.Buffer.concat(t)),"hex").slice(0,4)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(r(28)),n=s(r(80));e.convertToDid=u;var o=r(31),a=s(r(91));function s(t){return t&&t.__esModule?t:{default:t}}function u(t,e){var r=[{id:t+"#keys-1",type:"EcdsaPublicKeySecp256k1",owner:t,publicKeyHex:e.publicKey.slice(2)}];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};if(e.name||e.description||e.image){var o=(0,n.default)({},e);delete o.publicKey,delete o.publicEncKey,i.uportProfile=o}return i}t.exports=function(t){var e=t||(0,a.default)(),r=function(t){return new i.default(function(r,i){e(t,function(t,e){return t?i(t):r(e)})})};(0,o.registerMethod)("uport",function(t,e){return new i.default(function(i,n){r(e.id).then(function(e){return e?"https://w3id.org/did/v1"===e["@context"]?i(e):"string"==typeof e.publicKey?i(u(t,e)):void 0:i()},n)})})}},function(t,e,r){"use strict";var i=r(30)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),n=r(30)("0123456789abcdef"),o="undefined"!=typeof window?window.XMLHttpRequest:r(181).XMLHttpRequest,a="0x447885f0",s="0x446d5aa4000000000000000000000000";function u(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 h(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"},"0x3":{registry:"0x41566e3a081f5032bdcad470adb797635ddfe1f0",rpcUrl:"https://ropsten.infura.io"},"0x2a":{registry:"0x5f8e9351dc2d238fb878b6ae43aa740d62fc9758",rpcUrl:"https://kovan.infura.io"},"0x4":{registry:"0x2cc31912b2b0f3075a87b3640923d45a26cef3ee",rpcUrl:"https://rinkeby.infura.io"}};t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.infuraKey||"uport-lite-library",r=t.ipfsGw||"https://ipfs.infura.io/ipfs/",o=t.networks?Object.assign({},f,t.networks):f;function c(t,e,r){return void 0===e?t:r?(t+e).slice(-t.length):(e+t).substring(0,t.length)}function d(t,r){return t?u({uri:"https://ropsten.infura.io/"+e,accept:"application/json",data:{method:"eth_call",params:[{to:"0xb9C1598e24650437a3055F7f66AC1820c419a679",data:s+t.slice(2)},"latest"],id:1,jsonrpc:"2.0"}},function(t,e){if(t)return r(t);if(e.error)return r(e.error);var o=e.result.slice(130).slice(0,68);return r(null,function(t){return i.encode(n.decode(t))}(o))}):r(null)}function l(t,r,s,f){var d=h(r),l=h(s);if(d.network===l.network){if(o[d.network]){var p=o[d.network].rpcUrl,m=o[d.network].registry,b=function(t,e,r,i){var n=t;return n+=c("0000000000000000000000000000000000000000000000000000000000000000",function(t,e){return t.split("").map(function(t){return("0"+t.charCodeAt(0).toString(16)).slice(-2)}).join(e||"")}(e)),n+=c("0000000000000000000000000000000000000000000000000000000000000000",r.slice(2),!0),n+=c("0000000000000000000000000000000000000000000000000000000000000000",i.slice(2),!0)}(a,t,d.address,l.address);return u({uri:p+"/"+e,accept:"application/json",data:{method:"eth_call",params:[{to:m,data:b},"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,function(t){return i.encode(n.decode("1220"+t.slice(2)))}(e.result))})}f(new Error("Network id "+d.network+" is not configured"))}else f(new Error("Issuer and subject must be on the same network"))}function p(t,e){return t&&"0x"!==t?u({uri:""+r+t},e):e()}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}/)?d(t,function(t,r){if(t)return e(t);p(r,e)}):l(i,t,n,function(t,r){if(t)return e(t);p(r,e)})}}},function(t,e,r){t.exports={default:r(187),__esModule:!0}},function(t,e,r){"use strict";var i=r(201),n=r(202);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],u=[224,256,384,512],h=["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<h.length;++i){var n=h[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,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<h.length;++i){var n=h[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,u=this.byteCount,h=this.blockCount,f=0,c=this.s;f<o;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<h+1;++r)s[r]=0;if(e)for(r=this.start;f<o&&r<u;++f)s[r>>2]|=t[f]<<a[3&r++];else for(r=this.start;f<o&&r<u;++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>=u){for(this.start=r-u,this.block=s[h],r=0;r<h;++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,u="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],u+=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&&(u+=o[t>>4&15]+o[15&t]),n>1&&(u+=o[t>>12&15]+o[t>>8&15]),n>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},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 u=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)u[a]=r[o];a%e==0&&w(r)}return n&&(u[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,u=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&w(i)}return o&&(t=s<<2,e=i[a],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var w=function(t){var e,r,i,n,o,a,u,h,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,k,E,R,B,I,T,j,P,O,C,N,q,D,H,z,L,F,U,K,J,Z,X,Q,W,Y,V,G,$,tt,et,rt,it,nt,ot,at,st,ut,ht,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],u=t[3]^t[13]^t[23]^t[33]^t[43],h=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|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<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|f>>>31),r=o^(f<<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^(c<<1|d>>>31),r=u^(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=h^(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],X=t[11]<<4|t[10]>>>28,Q=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,ut=t[30]<<9|t[31]>>>23,U=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,W=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,j=t[32]<<13|t[33]>>>19,ht=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,P=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,k=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,E=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,F=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^~E&B,t[11]=k^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~X&W,t[31]=Z^~Q&Y,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=E^~B&T,t[13]=R^~I&j,t[22]=q^~H&L,t[23]=D^~z&F,t[32]=X^~W&V,t[33]=Q^~Y&G,t[42]=it^~ot&st,t[43]=nt^~at&ut,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&P,t[15]=I^~j&O,t[24]=H^~L&U,t[25]=z^~F&K,t[34]=W^~V&$,t[35]=Y^~G&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~P&A,t[17]=j^~O&k,t[26]=L^~U&C,t[27]=F^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=P^~A&E,t[19]=O^~k&R,t[28]=U^~C&q,t[29]=K^~N&D,t[38]=$^~J&X,t[39]=tt^~Z&Q,t[48]=ht^~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(21),r(11))},function(t,e,r){"use strict";(function(e){var i=r(59),n=r(40);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(1).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContractFactory=void 0;var i=u(r(217)),n=u(r(55)),o=u(r(92)),a=u(r(71)),s=u(r(61));function u(t){return t&&t.__esModule?t:{default:t}}var h=function(t){if("object"!==(void 0===t?"undefined":(0,s.default)(t)))return!1;if(0===(0,a.default)(t).length)return!0;var e=!0,r=!1,i=void 0;try{for(var n,u=(0,o.default)(["from","to","data","value","gasPrice","gas"]);!(e=(n=u.next()).done);e=!0){if(n.value in t)return!0}}catch(t){r=!0,i=t}finally{try{!e&&u.return&&u.return()}finally{if(r)throw i}}return!1},f=function(t){return t.filter(function(t){return("function"===t.type||"event"===t.type)&&t.name.length>0})},c=function(t,e){for(var r=t.name+"(",i=0;i<t.inputs.length;i++){var n=t.inputs[i],o=n.type+" ";"string"===n.type?o+='"'+e[i]+'"':(n.type,o+=""+e[i]),r+=o,t.inputs.length-1!==i&&(r+=", ")}return r+")"};e.ContractFactory=function(t){return function(e){var r={at:function(r){return new function(){var o=this;o.abi=e||[],o.address=r||"0x",f(e).forEach(function(e){o[e.name]=function(){if(!0===e.constant)throw new Error("A call does not return the txobject, no transaction necessary.");if("event"===e.type)throw new Error("An event does not return the txobject, events not supported");var r={},a=[].slice.call(arguments),s=e.inputs.length;if("function"===e.type){h(a[s])&&(r=a.splice(s,1)[0]);var u=(0,n.default)({},r,{to:o.address,function:c(e,a)});if(!t)return u;var f=a.slice(s);return t.apply(void 0,[u].concat((0,i.default)(f)))}}})}}};return r}}},function(t,e,r){"use strict";var i=function(t){return t&&t.__esModule?t:{default:t}}(r(98)),n=r(85),o=r(96);t.exports={Credentials:i.default,SimpleSigner:n.SimpleSigner,ContractFactory:o.ContractFactory}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=M(r(61)),n=M(r(71)),o=M(r(16)),a=M(r(17)),s=M(r(55)),u=M(r(28)),h=M(r(139)),f=M(r(140)),c=r(2),d=r(85),l=r(57),p=M(r(90)),m=M(r(182)),b=M(r(186)),v=M(r(215)),y=M(r(91)),g=r(89),w=r(96);function M(t){return t&&t.__esModule?t:{default:t}}var _=new c.ec("secp256k1"),S="shareReq",x="shareResp",A="eip712Req",k="verReq",E="ethtx",R=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.did,n=r.address,o=r.privateKey,a=r.signer,s=r.networks,u=r.registry,f=r.ethrConfig,c=r.muportConfig;if((0,h.default)(this,t),a?this.signer=a:o&&(this.signer=(0,d.SimpleSigner)(o)),i)this.did=i;else if(n)(0,g.isMNID)(n)&&(this.did="did:uport:"+n),n.match("^0x[0-9a-fA-F]{40}$")&&(this.did="did:ethr:"+n);else if(o){var w=_.keyFromPrivate(o),M=(0,l.toEthereumAddress)(w.getPublic("hex"));this.did="did:ethr:"+M}this.signJWT=function(t,r){return(0,d.createJWT)(t,{issuer:e.did,signer:e.signer,alg:e.did.match("^did:uport:")||(0,g.isMNID)(e.did)?"ES256K":"ES256K-R",expiresIn:r})},(0,p.default)(u||(0,y.default)({networks:s?B(s):{}})),(0,b.default)(f||{}),(0,m.default)(c||{}),(0,v.default)()}return(0,f.default)(t,[{key:"createDisclosureRequest",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:600,r={};if(t.requested&&(r.requested=t.requested),t.verified&&(r.verified=t.verified),t.notifications&&(r.permissions=["notifications"]),t.callbackUrl&&(r.callback=t.callbackUrl),t.network_id&&(r.net=t.network_id),t.vc&&(r.vc=t.vc),t.exp&&(r.exp=t.exp),t.accountType){if(!(["general","segregated","keypair","none"].indexOf(t.accountType)>=0))return u.default.reject(new Error("Unsupported accountType "+t.accountType));r.act=t.accountType}return this.signJWT((0,s.default)({},r,{type:S}),t.exp?void 0:e)}},{key:"createVerification",value:function(t){var e=t.sub,r=t.claim,i=t.exp,n=t.vc;return this.signJWT({sub:e,claim:r,exp:i,vc:n})}},{key:"createVerificationSignatureRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.aud,i=e.sub,n=e.riss,o=e.callbackUrl,a=e.vc;return this.signJWT({unsignedClaim:t,sub:i,riss:n,aud:r,vc:a,callback:o,type:k})}},{key:"createTypedDataSignatureRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.sub,i=e.aud,n=e.callbackUrl;return this.signJWT({typedData:t,sub:r,aud:i,callback:n,type:A})}},{key:"createTxRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.callbackUrl,i=e.exp,n=void 0===i?600:i,o=e.networkId,a=e.label,u={};return r&&(u.callback=r),o&&(u.net=o),a&&(u.label=a),this.signJWT((0,s.default)({},u,t,{type:E}),n)}},{key:"createDisclosureResponse",value:function(){var t=(0,a.default)(o.default.mark(function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:600;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.req){t.next=5;break}return t.next=3,(0,d.verifyJWT)(r.req);case 3:(e=t.sent).issuer&&(r.aud=e.issuer);case 5:return t.abrupt("return",this.signJWT((0,s.default)({},r,{type:x}),i));case 6:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"processDisclosurePayload",value:function(){var t=(0,a.default)(o.default.mark(function t(e){var r,i,n=this,a=e.doc,h=e.payload;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,s.default)({},a.uportProfile||{},h.own||{},h.capabilities&&1===h.capabilities.length?{pushToken:h.capabilities[0]}:{},{did:h.iss,boxPub:h.boxPub}),h.nad&&(r.mnid=h.nad,r.address=(0,g.decode)(h.nad).address),h.dad&&(r.deviceKey=h.dad),!h.verified){t.next=10;break}return t.next=6,u.default.all(h.verified.map(function(t){return(0,d.verifyJWT)(t,{audience:n.did})}));case 6:return i=t.sent,t.abrupt("return",(0,s.default)({},r,{verified:i.map(function(t){return(0,s.default)({},t.payload,{jwt:t.jwt})})}));case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"authenticateDisclosureResponse",value:function(){var t=(0,a.default)(o.default.mark(function t(e){var r,i,n,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,d.verifyJWT)(e,{audience:this.did,callbackUrl:s,auth:!0});case 2:if(r=t.sent,i=r.payload,n=r.doc,!i.req){t.next=20;break}return t.next=8,(0,d.verifyJWT)(i.req);case 8:if((a=t.sent).payload.iss===this.did){t.next=13;break}throw new Error("Challenge issuer does not match current identity: "+a.payload.iss+" !== "+this.did);case 13:if(a.payload.type===S){t.next=17;break}throw new Error("Challenge payload type invalid: "+a.payload.type);case 17:return t.abrupt("return",this.processDisclosurePayload({payload:i,doc:n}));case 18:t.next=21;break;case 20:throw new Error("Challenge was not included in response");case 21:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"verifyDisclosure",value:function(){var t=(0,a.default)(o.default.mark(function t(e){var r,i,n;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,d.verifyJWT)(e,{audience:this.did});case 2:return r=t.sent,i=r.payload,n=r.doc,t.abrupt("return",this.processDisclosurePayload({payload:i,doc:n}));case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"contract",value:function(t){var e=this;return(0,w.ContractFactory)(function(t,r){return t.function&&(t.fn=t.function),delete t.function,e.createTxRequest(t,r)}.bind(this))(t)}}],[{key:"createIdentity",value:function(){var t=_.genKeyPair(),e=t.getPublic("hex"),r=t.getPrivate("hex");return{did:"did:ethr:"+(0,l.toEthereumAddress)(e),privateKey:r}}}]),t}(),B=function(t){return(0,n.default)(t).forEach(function(e){var r=t[e];if("object"!==(void 0===r?"undefined":(0,i.default)(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.")})}),t};e.default=R},function(t,e,r){t.exports={default:r(100),__esModule:!0}},function(t,e,r){r(32),r(49),t.exports=r(50).f("iterator")},function(t,e,r){var i=r(41),n=r(42);t.exports=function(t){return function(e,r){var o,a,s=String(n(e)),u=i(r),h=s.length;return u<0||u>=h?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===h||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(t,e,r){"use strict";var i=r(65),n=r(24),o=r(35),a={};r(12)(a,r(4)("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(9),o=r(20);t.exports=r(10)?Object.defineProperties:function(t,e){n(t);for(var r,a=o(e),s=a.length,u=0;s>u;)i.f(t,r=a[u++],e[r]);return t}},function(t,e,r){var i=r(15),n=r(45),o=r(105);t.exports=function(t){return function(e,r,a){var s,u=i(e),h=n(u.length),f=o(a,h);if(t&&r!=r){for(;h>f;)if((s=u[f++])!=s)return!0}else for(;h>f;f++)if((t||f in u)&&u[f]===r)return t||f||0;return!t&&-1}}},function(t,e,r){var i=r(41),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(14),n=r(36),o=r(46)("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){"use strict";var i=r(108),n=r(109),o=r(25),a=r(15);t.exports=r(62)(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){t.exports={default:r(111),__esModule:!0}},function(t,e,r){r(112),r(70),r(118),r(119),t.exports=r(0).Symbol},function(t,e,r){"use strict";var i=r(3),n=r(14),o=r(10),a=r(5),s=r(64),u=r(113).KEY,h=r(19),f=r(47),c=r(35),d=r(34),l=r(4),p=r(50),m=r(51),b=r(114),v=r(115),y=r(9),g=r(13),w=r(15),M=r(44),_=r(24),S=r(65),x=r(116),A=r(117),k=r(8),E=r(20),R=A.f,B=k.f,I=x.f,T=i.Symbol,j=i.JSON,P=j&&j.stringify,O=l("_hidden"),C=l("toPrimitive"),N={}.propertyIsEnumerable,q=f("symbol-registry"),D=f("symbols"),H=f("op-symbols"),z=Object.prototype,L="function"==typeof T,F=i.QObject,U=!F||!F.prototype||!F.prototype.findChild,K=o&&h(function(){return 7!=S(B({},"a",{get:function(){return B(this,"a",{value:7}).a}})).a})?function(t,e,r){var i=R(z,e);i&&delete z[e],B(t,e,r),i&&t!==z&&B(z,e,i)}:B,J=function(t){var e=D[t]=S(T.prototype);return e._k=t,e},Z=L&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},X=function(t,e,r){return t===z&&X(H,e,r),y(t),e=M(e,!0),y(r),n(D,e)?(r.enumerable?(n(t,O)&&t[O][e]&&(t[O][e]=!1),r=S(r,{enumerable:_(0,!1)})):(n(t,O)||B(t,O,_(1,{})),t[O][e]=!0),K(t,e,r)):B(t,e,r)},Q=function(t,e){y(t);for(var r,i=b(e=w(e)),n=0,o=i.length;o>n;)X(t,r=i[n++],e[r]);return t},W=function(t){var e=N.call(this,t=M(t,!0));return!(this===z&&n(D,t)&&!n(H,t))&&(!(e||!n(this,t)||!n(D,t)||n(this,O)&&this[O][t])||e)},Y=function(t,e){if(t=w(t),e=M(e,!0),t!==z||!n(D,e)||n(H,e)){var r=R(t,e);return!r||!n(D,e)||n(t,O)&&t[O][e]||(r.enumerable=!0),r}},V=function(t){for(var e,r=I(w(t)),i=[],o=0;r.length>o;)n(D,e=r[o++])||e==O||e==u||i.push(e);return i},G=function(t){for(var e,r=t===z,i=I(r?H:w(t)),o=[],a=0;i.length>a;)!n(D,e=i[a++])||r&&!n(z,e)||o.push(D[e]);return o};L||(s((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(r){this===z&&e.call(H,r),n(this,O)&&n(this[O],t)&&(this[O][t]=!1),K(this,t,_(1,r))};return o&&U&&K(z,t,{configurable:!0,set:e}),J(t)}).prototype,"toString",function(){return this._k}),A.f=Y,k.f=X,r(69).f=x.f=V,r(27).f=W,r(52).f=G,o&&!r(22)&&s(z,"propertyIsEnumerable",W,!0),p.f=function(t){return J(l(t))}),a(a.G+a.W+a.F*!L,{Symbol:T});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)l($[tt++]);for(var et=E(l.store),rt=0;et.length>rt;)m(et[rt++]);a(a.S+a.F*!L,"Symbol",{for:function(t){return n(q,t+="")?q[t]:q[t]=T(t)},keyFor:function(t){if(!Z(t))throw TypeError(t+" is not a symbol!");for(var e in q)if(q[e]===t)return e},useSetter:function(){U=!0},useSimple:function(){U=!1}}),a(a.S+a.F*!L,"Object",{create:function(t,e){return void 0===e?S(t):Q(S(t),e)},defineProperty:X,defineProperties:Q,getOwnPropertyDescriptor:Y,getOwnPropertyNames:V,getOwnPropertySymbols:G}),j&&a(a.S+a.F*(!L||h(function(){var t=T();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))})),"JSON",{stringify:function(t){for(var e,r,i=[t],n=1;arguments.length>n;)i.push(arguments[n++]);if(r=e=i[1],(g(e)||void 0!==t)&&!Z(t))return v(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!Z(e))return e}),i[1]=e,P.apply(j,i)}}),T.prototype[C]||r(12)(T.prototype,C,T.prototype.valueOf),c(T,"Symbol"),c(Math,"Math",!0),c(i.JSON,"JSON",!0)},function(t,e,r){var i=r(34)("meta"),n=r(13),o=r(14),a=r(8).f,s=0,u=Object.isExtensible||function(){return!0},h=!r(19)(function(){return u(Object.preventExtensions({}))}),f=function(t){a(t,i,{value:{i:"O"+ ++s,w:{}}})},c=t.exports={KEY:i,NEED:!1,fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!u(t))return"F";if(!e)return"E";f(t)}return t[i].i},getWeak:function(t,e){if(!o(t,i)){if(!u(t))return!0;if(!e)return!1;f(t)}return t[i].w},onFreeze:function(t){return h&&c.NEED&&u(t)&&!o(t,i)&&f(t),t}}},function(t,e,r){var i=r(20),n=r(52),o=r(27);t.exports=function(t){var e=i(t),r=n.f;if(r)for(var a,s=r(t),u=o.f,h=0;s.length>h;)u.call(t,a=s[h++])&&e.push(a);return e}},function(t,e,r){var i=r(26);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,r){var i=r(15),n=r(69).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return n(t)}catch(t){return a.slice()}}(t):n(i(t))}},function(t,e,r){var i=r(27),n=r(24),o=r(15),a=r(44),s=r(14),u=r(63),h=Object.getOwnPropertyDescriptor;e.f=r(10)?h:function(t,e){if(t=o(t),e=a(e,!0),u)try{return h(t,e)}catch(t){}if(s(t,e))return n(!i.f.call(t,e),t[e])}},function(t,e,r){r(51)("asyncIterator")},function(t,e,r){r(51)("observable")},function(t,e,r){r(121),t.exports=r(0).Object.keys},function(t,e,r){var i=r(36),n=r(20);r(122)("keys",function(){return function(t){return n(i(t))}})},function(t,e,r){var i=r(5),n=r(0),o=r(19);t.exports=function(t,e){var r=(n.Object||{})[t]||Object[t],a={};a[t]=e(r),i(i.S+i.F*o(function(){r(1)}),"Object",a)}},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(124),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",u=o.toStringTag||"@@toStringTag",h="object"==typeof t,f=e.regeneratorRuntime;if(f)h&&(t.exports=f);else{(f=e.regeneratorRuntime=h?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[u]=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,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(g),t},f.awrap=function(t){return{__await:t}},A(k.prototype),k.prototype[s]=function(){return this},f.AsyncIterator=k,f.async=function(t,e,r,i){var n=new k(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[u]="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 u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!h)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 j()}for(r.method=n,r.arg=o;;){var a=r.delegate;if(a){var s=E(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 u=M(t,e,r);if("normal"===u.type){if(i=r.done?p:d,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=p,r.method="throw",r.arg=u.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 k(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 u=s.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(h).then(function(t){u.value=t,o(u)},a)}a(s.arg)}(r,i,e,o)})}return e=e?e.then(o,o):o()}}function E(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,E(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:j}}function j(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},function(t,e,r){r(70),r(32),r(49),r(126),r(134),r(135),t.exports=r(0).Promise},function(t,e,r){"use strict";var i,n,o,a,s=r(22),u=r(3),h=r(23),f=r(72),c=r(5),d=r(13),l=r(33),p=r(127),m=r(128),b=r(75),v=r(76).set,y=r(130)(),g=r(54),w=r(77),M=r(131),_=r(78),S=u.TypeError,x=u.process,A=x&&x.versions,k=A&&A.v8||"",E=u.Promise,R="process"==f(x),B=function(){},I=n=g.f,T=!!function(){try{var t=E.resolve(1),e=(t.constructor={})[r(4)("species")]=function(t){t(B,B)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(B)instanceof e&&0!==k.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(t){}}(),j=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},P=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,u=e.resolve,h=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?h(S("Promise-chain cycle")):(o=j(r))?o.call(r,u,h):u(r)):h(i)}catch(t){f&&!a&&f.exit(),h(t)}};r.length>o;)a(r[o++]);t._c=[],t._n=!1,e&&!t._h&&O(t)})}},O=function(t){v.call(u,function(){var e,r,i,n=t._v,o=C(t);if(o&&(e=w(function(){R?x.emit("unhandledRejection",n,t):(r=u.onunhandledrejection)?r({promise:t,reason:n}):(i=u.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(u,function(){var e;R?x.emit("rejectionHandled",t):(e=u.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()),P(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=j(t))?y(function(){var i={_w:r,_d:!1};try{e.call(t,h(D,i,1),h(q,i,1))}catch(t){q.call(i,t)}}):(r._v=t,r._s=1,P(r,!1))}catch(t){q.call({_w:r,_d:!1},t)}}};T||(E=function(t){p(this,E,"Promise","_h"),l(t),i.call(this);try{t(h(D,this,1),h(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(132)(E.prototype,{then:function(t,e){var r=I(b(this,E));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&&P(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new i;this.promise=t,this.resolve=h(D,t,1),this.reject=h(q,t,1)},g.f=I=function(t){return t===E||t===a?new o(t):n(t)}),c(c.G+c.W+c.F*!T,{Promise:E}),r(35)(E,"Promise"),r(133)("Promise"),a=r(0).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?E:this,t)}}),c(c.S+c.F*!(T&&r(79)(function(t){E.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++,u=!1;r.push(void 0),a++,e.resolve(t).then(function(t){u||(u=!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(23),n=r(73),o=r(74),a=r(9),s=r(45),u=r(53),h={},f={};(e=t.exports=function(t,e,r,c,d){var l,p,m,b,v=d?function(){return t}:u(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]))===h||b===f)return b}else for(m=v.call(t);!(p=m.next()).done;)if((b=n(m,y,p.value,e))===h||b===f)return b}).BREAK=h,e.RETURN=f},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(3),n=r(76).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,u="process"==r(26)(a);t.exports=function(){var t,e,r,h=function(){var i,n;for(u&&(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(u)r=function(){a.nextTick(h)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var f=s.resolve(void 0);r=function(){f.then(h)}}else r=function(){n.call(i,h)};else{var c=!0,d=document.createTextNode("");new o(h).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(3).navigator;t.exports=i&&i.userAgent||""},function(t,e,r){var i=r(12);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(3),n=r(0),o=r(8),a=r(10),s=r(4)("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){"use strict";var i=r(5),n=r(0),o=r(3),a=r(75),s=r(78);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(5),n=r(54),o=r(77);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){r(137),t.exports=r(0).Object.assign},function(t,e,r){var i=r(5);i(i.S+i.F,"Object",{assign:r(138)})},function(t,e,r){"use strict";var i=r(20),n=r(52),o=r(27),a=r(36),s=r(67),u=Object.assign;t.exports=!u||r(19)(function(){var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach(function(t){e[t]=t}),7!=u({},t)[r]||Object.keys(u({},e)).join("")!=i})?function(t,e){for(var r=a(t),u=arguments.length,h=1,f=n.f,c=o.f;u>h;)for(var d,l=s(arguments[h++]),p=f?i(l).concat(f(l)):i(l),m=p.length,b=0;m>b;)c.call(l,d=p[b++])&&(r[d]=l[d]);return r}:u},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(r(141));e.default=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,i.default)(t,n.key,n)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}()},function(t,e,r){t.exports={default:r(142),__esModule:!0}},function(t,e,r){r(143);var i=r(0).Object;t.exports=function(t,e,r){return i.defineProperty(t,e,r)}},function(t,e,r){var i=r(5);i(i.S+i.F*!r(10),"Object",{defineProperty:r(8).f})},function(t){t.exports={_args:[["elliptic@6.4.1","/Users/alexandermorris/Downloads/uport-credentials-develop"]],_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","/jsontokens","/muport-did-resolver","/secp256k1","/uport-transports/did-jwt"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_spec:"6.4.1",_where:"/Users/alexandermorris/Downloads/uport-credentials-develop",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(6),o=r(18),a=r(81);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,u=1;u<s;u++)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,u=t.andln(3)+i&3,h=e.andln(3)+n&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==h?u:-u,r[0].push(o),a=0==(1&h)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==u?h:-h,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(148);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(6),n=r(2).utils,o=n.getNAF,a=n.getJSF,s=n.assert;function u(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 h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){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=[],u=0;u<i.length;u+=r.step){var h=0;for(e=u+r.step-1;e>=u;e--)h=(h<<1)+i[e];a.push(h)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=n;d>0;d--){for(u=0;u<a.length;u++){(h=a[u])===d?c=c.mixedAdd(r.points[u]):h===-d&&(c=c.mixedAdd(r.points[u].neg()))}f=f.add(c)}return f.toP()},u.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,a=o(e,r),u=this.jpoint(null,null,null),h=a.length-1;h>=0;h--){for(e=0;h>=0&&0===a[h];h--)e++;if(h>=0&&e++,u=u.dblp(e),h<0)break;var f=a[h];s(0!==f),u="affine"===t.type?f>0?u.mixedAdd(n[f-1>>1]):u.mixedAdd(n[-f-1>>1].neg()):f>0?u.add(n[f-1>>1]):u.add(n[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,i,n){for(var s=this._wnafT1,u=this._wnafT2,h=this._wnafT3,f=0,c=0;c<i;c++){var d=(A=e[c])._getNAFPoints(t);s[c]=d.wnd,u[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),h[l]=new Array(f),h[p]=new Array(f);for(var y=0;y<f;y++){var g=0|v[0][y],w=0|v[1][y];h[l][y]=b[3*(g+1)+(w+1)],h[p][y]=0,u[l]=m}}else h[l]=o(r[l],s[l]),h[p]=o(r[p],s[p]),f=Math.max(h[l].length,f),f=Math.max(h[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|h[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,k=_[y];0!==k&&(k>0?A=u[y][k-1>>1]:k<0&&(A=u[y][-k-1>>1].neg()),M="affine"===A.type?M.mixedAdd(A):M.add(A))}}for(c=0;c<i;c++)u[c]=null;return n?M:M.toP()},u.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.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")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.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))},h.prototype.encode=function(t,e){return n.encode(this._encode(e),t)},h.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},h.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)},h.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}},h.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}},h.prototype._getBeta=function(){return null},h.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(38),n=r(2),o=r(6),a=r(39),s=i.base,u=n.utils.assert;function h(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(h,s),t.exports=h,h.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],u(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)}}},h.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()]},h.prototype._getEndoBasis=function(t){for(var e,r,i,n,a,s,u,h,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);h=l.sub(g.mul(d)),f=b.sub(g.mul(p));var w=v.sub(g.mul(m));if(!i&&h.cmp(c)<0)e=u.neg(),r=p,i=h.neg(),n=f;else if(i&&2==++y)break;u=h,l=d,d=h,b=p,p=f,v=m,m=w}a=h.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}]},h.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),u=n.mul(r.b),h=o.mul(i.b);return{k1:t.sub(a).sub(s),k2:u.add(h).neg()}},h.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)},h.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)},h.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],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),i[2*o]=s,i[2*o+1]=u,n[2*o]=a.k1,n[2*o+1]=a.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),f=0;f<2*o;f++)i[f]=null,n[f]=null;return h},a(f,s.BasePoint),h.prototype.point=function(t,e,r){return new f(this,t,e,r)},h.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),h.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),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),f=h.redMul(s),c=i.redMul(h),d=u.redSqr().redIAdd(f).redISub(c).redISub(c),l=u.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 u=a.redSqr(),h=u.redMul(a),f=r.redMul(u),c=s.redSqr().redIAdd(h).redISub(f).redISub(f),d=s.redMul(f.redISub(c)).redISub(n.redMul(h)),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,u=s.redSqr().redSqr(),h=a.redAdd(a);for(r=0;r<t;r++){var f=o.redSqr(),c=h.redSqr(),d=c.redSqr(),l=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(u)),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=h.redMul(s);r+1<t&&(u=u.redMul(d)),o=m,s=y,h=v}return this.curve.jpoint(o,h.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),u=s.redSqr().redISub(a).redISub(a),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=s.redMul(a.redISub(u)).redISub(h),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),u=s.redSqr().redISub(a).redISub(a);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=s.redMul(a.redISub(u)).redISub(h),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)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(h.redAdd(h)),c=h.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(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=n.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=e.redMul(h);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(h.redMul(u.redISub(h)).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(38),n=r(6),o=r(39),a=i.base,s=r(2).utils;function u(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 h(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(u,a),t.exports=u,u.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(h,a.BasePoint),u.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},u.prototype.point=function(t,e){return new h(this,t,e)},u.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(t,e){return new h(t,e[0],e[1]||t.one)},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.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)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.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()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},h.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},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var i=r(38),n=r(2),o=r(6),a=r(39),s=i.base,u=n.utils.assert;function h(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),u(!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(h,s),t.exports=h,h.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},h.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},h.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},h.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 u=s.fromRed().isOdd();return(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s)},h.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)},h.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),h.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},h.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),u=n.redMul(a),h=o.redMul(s),f=n.redMul(s),c=a.redMul(o);return this.curve.point(u,h,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=(h=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(h.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=i.redSub(n).redISub(o).redMul(u),e=a.redMul(h.redSub(o)),r=a.redMul(u)}}else{var h=n.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=h.redSub(s).redSub(s);t=this.curve._mulC(i.redISub(h)).redMul(u),e=this.curve._mulC(h).redMul(n.redISub(o)),r=h.redMul(u)}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),u=r.redAdd(e),h=o.redMul(a),f=s.redMul(u),c=o.redMul(u),d=a.redMul(s);return this.curve.point(h,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),u=n.redSub(s),h=n.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),c=i.redMul(u).redMul(f);return this.curve.twisted?(e=i.redMul(h).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(h)):(e=i.redMul(h).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(h)),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(56),a=r(2),s=a.utils.assert;function u(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 h(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=u,h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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(160)}catch(t){i=void 0}h("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(155),e.sha224=r(156),e.sha256=r(83),e.sha384=r(157),e.sha512=r(84)},function(t,e,r){"use strict";var i=r(7),n=r(29),o=r(82),a=i.rotl32,s=i.sum32,u=i.sum32_5,h=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=u(a(n,5),h(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(7),n=r(83);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(7),n=r(84);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(7),n=r(29),o=i.rotl32,a=i.sum32,s=i.sum32_3,u=i.sum32_4,h=n.BlockHash;function f(){if(!(this instanceof f))return new f;h.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,h),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],h=this.h[3],f=this.h[4],y=r,g=i,w=n,M=h,_=f,S=0;S<80;S++){var x=a(o(u(r,c(S,i,n,h),t[p[S]+e],d(S)),b[S]),f);r=f,f=h,h=o(n,10),n=i,i=x,x=a(o(u(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],h,_),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(7),n=r(18);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(6),n=r(162),o=r(2),a=o.utils.assert,s=r(163),u=r(164);function h(t){if(!(this instanceof h))return new h(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=h,h.prototype.keyPair=function(t){return new s(this,t)},h.prototype.keyFromPrivate=function(t,e){return s.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return s.fromPublic(this,t,e)},h.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)}},h.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},h.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),h=t.toArray("be",a),f=new n({hash:this.hash,entropy:s,nonce:h,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 u({r:b,s:v,recoveryParam:y})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new u(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,h=a.invm(this.n),f=h.mul(t).umod(this.n),c=h.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)},h.prototype.recoverPubKey=function(t,e,r,n){a((3&r)===r,"The recovery param is more than two bits"),e=new u(e,n);var o=this.n,s=new i(t),h=e.r,f=e.s,c=1&r,d=r>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");h=d?this.curve.pointFromX(h.add(this.curve.n),c):this.curve.pointFromX(h,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,h,m)},h.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new u(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(56),n=r(81),o=r(18);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(6),n=r(2).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(6),n=r(2).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(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 h(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 function(){this.place=0};if(48!==t[r.place++])return!1;if(s(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=s(t,r);if(t.length!==u+r.place)return!1;var h=t.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===h[0]&&128&h[1]&&(h=h.slice(1)),this.r=new i(a),this.s=new i(h),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];h(i,e.length),(i=i.concat(e)).push(2),h(i,r.length);var o=i.concat(r),a=[48];return h(a,o.length),a=a.concat(o),n.encode(a,t)}},function(t,e,r){"use strict";var i=r(56),n=r(2),o=n.utils,a=o.assert,s=o.parseBytes,u=r(166),h=r(167);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()),u=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:u,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 u.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof h?t:new h(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(2).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(6),n=r(2).utils,o=n.assert,a=n.cachedProperty,s=n.parseBytes;function u(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(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},function(t,e,r){"use strict";var i=s(r(16)),n=s(r(17)),o=r(2),a=r(57);function s(t){return t&&t.__esModule?t:{default:t}}var u=new o.ec("secp256k1");function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64;return t.length===e?t:"0".repeat(e-t.length)+t}t.exports=function(t){var e=this,r=u.keyFromPrivate(t);return function(){var t=(0,n.default)(i.default.mark(function t(n){var o,s,u,f;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.sign((0,a.sha256)(n)),s=o.r,u=o.s,f=o.recoveryParam,t.abrupt("return",{r:h(s.toString("hex")),s:h(u.toString("hex")),recoveryParam:f});case 2:case"end":return t.stop()}},t,e)}));return function(e){return t.apply(this,arguments)}}()}},function(t,e,r){"use strict";e.byteLength=function(t){var e=h(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){for(var e,r=h(t),i=r[0],a=r[1],s=new o(function(t,e,r){return 3*(e+r)/4-r}(0,i,a)),u=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[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=n[t.charCodeAt(c)]<<2|n[t.charCodeAt(c+1)]>>4,s[u++]=255&e);1===a&&(e=n[t.charCodeAt(c)]<<10|n[t.charCodeAt(c+1)]<<4|n[t.charCodeAt(c+2)]>>2,s[u++]=e>>8&255,s[u++]=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(c(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,u=a.length;s<u;++s)i[s]=a[s],n[a.charCodeAt(s)]=s;function h(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){return i[t>>18&63]+i[t>>12&63]+i[t>>6&63]+i[63&t]}function c(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),n.push(f(i));return n.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,u=(1<<s)-1,h=u>>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-h;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,i),o-=h}return(l?-1:1)*a*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var a,s,u,h=8*o-n-1,f=(1<<h)-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*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?d/u:d*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(e*u-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,h+=n;h>0;t[r+l]=255&a,l+=p,a/=256,h-=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(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__(86),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||void 0===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,u=0;for(i=0;i<s;++i)(o=t.charCodeAt(i))<128?a[u++]=o:o<2048?(a[u++]=192|o>>6,a[u++]=128|63&o):o<55296||o>=57344?(a[u++]=224|o>>12,a[u++]=128|o>>6&63,a[u++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++i)),a[u++]=240|o>>18,a[u++]=128|o>>12&63,a[u++]=128|o>>6&63,a[u++]=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 h=[],f=[];for(i=0;i<64;++i){var c=t[i]||0;h[i]=92^c,f[i]=54^c}Sha256.call(this,e,r),this.update(f),this.oKeyPad=h,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,u,h=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(u=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=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(o=h&f)^h&c^u,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&h)^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&h^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=(u=f&c)^f&d^s,l=h+(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,h=n+(e+i)<<0;this.h0=this.h0+h<<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,u=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||(u+=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]),u},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,u=[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||u.push(s>>24&255,s>>16&255,s>>8&255,255&s),u},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__(21),__webpack_require__(11))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveAuthenticator=e.verifyJWT=e.createJWT=e.IAT_SKEW=void 0;var i=m(r(16)),n=m(r(55)),o=m(r(17)),a=m(r(88)),s=e.createJWT=function(){var t=(0,o.default)(i.default.mark(function t(e,r){var o,a,s,u,h,f=r.issuer,c=r.signer,l=r.alg,p=r.expiresIn;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(c){t.next=2;break}throw new Error("No Signer functionality has been configured");case 2:if(f){t.next=4;break}throw new Error("No issuing DID has been configured");case 4:if(o=(0,n.default)({},v,{alg:l||y}),a={iat:Math.floor(Date.now()/1e3)},!p){t.next=12;break}if("number"!=typeof p){t.next=11;break}a.exp=a.iat+Math.floor(p),t.next=12;break;case 11:throw new Error("JWT expiresIn is not a number");case 12:return s=[g(o),g((0,n.default)({},a,e,{iss:f}))].join("."),u=(0,d.default)(o.alg),t.next=16,u(s,c);case 16:return h=t.sent,t.abrupt("return",[s,h].join("."));case 18:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),u=e.verifyJWT=function(){var t=(0,o.default)(i.default.mark(function t(e){var r,n,o,a,s,u,f,d,l,p,m,b,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=v.audience?_(v.audience):void 0,n=S(e),o=n.payload,a=n.header,s=n.signature,u=n.data,t.next=4,h(a.alg,o.iss,v.auth);case 4:if(f=t.sent,d=f.doc,l=f.authenticators,p=f.issuer,m=(0,c.default)(a.alg)(u,s,l),b=Math.floor(Date.now()/1e3),!m){t.next=30;break}if(!(o.iat&&o.iat>b+w)){t.next=13;break}throw new Error("JWT not valid yet (issued in the future): iat: "+o.iat+" > now: "+b);case 13:if(!(o.exp&&o.exp<=b-w)){t.next=15;break}throw new Error("JWT has expired: exp: "+o.exp+" < now: "+b);case 15:if(!o.aud){t.next=27;break}if(!M(o.aud)){t.next=23;break}if(r){t.next=19;break}throw new Error("JWT audience is required but your app address has not been configured");case 19:if(r===_(o.aud)){t.next=21;break}throw new Error("JWT audience does not match your DID: aud: "+o.aud+" !== yours: "+r);case 21:t.next=27;break;case 23:if(v.callbackUrl){t.next=25;break}throw new Error("JWT audience matching your callback url is required but one wasn't passed in");case 25:if(o.aud===v.callbackUrl){t.next=27;break}throw new Error("JWT audience does not match the callback url: aud: "+o.aud+" !== url: "+v.callbackUrl);case 27:return t.abrupt("return",{payload:o,doc:d,issuer:p,signer:m,jwt:e});case 30:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}(),h=e.resolveAuthenticator=function(){var t=(0,o.default)(i.default.mark(function t(e,r,n){var o,a,s,u,h;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((o=b[e])&&0!==o.length){t.next=3;break}throw new Error("No supported signature types for algorithm "+e);case 3:return a=_(r),t.next=6,(0,p.default)(a);case 6:if(s=t.sent){t.next=9;break}throw new Error("Unable to resolve DID document for "+a);case 9:if(u=!n||(s.authentication||[]).map(function(t){return t.publicKey}),h=(s.publicKey||[]).filter(function(t){var e=t.type,r=t.id;return o.find(function(t){return t===e&&(!n||u.indexOf(r)>=0)})}),!n||h&&0!==h.length){t.next=13;break}throw new Error("DID document for "+a+" does not have public keys suitable for authenticationg user");case 13:if(h&&0!==h.length){t.next=15;break}throw new Error("DID document for "+a+" does not have public keys for "+e);case 15:return t.abrupt("return",{authenticators:h,issuer:a,doc:s});case 16:case"end":return t.stop()}},t,this)}));return function(e,r,i){return t.apply(this,arguments)}}();e.decodeJWT=S;var f=r(89),c=m(r(177)),d=m(r(180)),l=m(r(58)),p=m(r(31));function m(t){return t&&t.__esModule?t:{default:t}}(0,m(r(90)).default)();var b={ES256K:["Secp256k1VerificationKey2018","Secp256k1SignatureVerificationKey2018","EcdsaPublicKeySecp256k1"],"ES256K-R":["Secp256k1VerificationKey2018","Secp256k1SignatureVerificationKey2018","EcdsaPublicKeySecp256k1"]},v={typ:"JWT"},y="ES256K";function g(t){return l.default.encode((0,a.default)(t))}var w=e.IAT_SKEW=60;function M(t){return t&&(t.match(/^did:/)||(0,f.isMNID)(t))}function _(t){if(t.match(/^did:/))return t;if((0,f.isMNID)(t))return"did:uport:"+t;throw new Error("Not a valid DID '"+t+"'")}function S(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(l.default.decode(e[1])),payload:JSON.parse(l.default.decode(e[2])),signature:e[3],data:e[1]+"."+e[2]};throw new Error("Incorrect format JWT")}e.default={decodeJWT:S,createJWT:s,verifyJWT:u,resolveAuthenticator:h}},function(t,e,r){var i=r(0),n=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}},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],u=[224,256,384,512],h=["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<h.length;++i){var n=h[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,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<h.length;++i){var n=h[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,u=this.blockCount,h=0,f=this.s;h<n;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<u+1;++r)o[r]=0;if(e)for(r=this.start;h<n&&r<s;++h)o[r>>2]|=t[h]<<a[3&r++];else for(r=this.start;h<n&&r<s;++h)(i=t.charCodeAt(h))<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(++h)),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[u],r=0;r<u;++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,u="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],u+=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&&(u+=o[t>>4&15]+o[15&t]),n>1&&(u+=o[t>>12&15]+o[t>>8&15]),n>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},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 u=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)u[a]=r[o];a%e==0&&_(r)}return n&&(u[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,u=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&_(i)}return o&&(t=s<<2,e=i[a],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var _=function(t){var e,r,i,n,o,a,u,h,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,k,E,R,B,I,T,j,P,O,C,N,q,D,H,z,L,F,U,K,J,Z,X,Q,W,Y,V,G,$,tt,et,rt,it,nt,ot,at,st,ut,ht,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],u=t[3]^t[13]^t[23]^t[33]^t[43],h=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|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<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|f>>>31),r=o^(f<<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^(c<<1|d>>>31),r=u^(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=h^(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],X=t[11]<<4|t[10]>>>28,Q=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,ut=t[30]<<9|t[31]>>>23,U=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,W=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,j=t[32]<<13|t[33]>>>19,ht=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,P=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,k=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,E=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,F=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^~E&B,t[11]=k^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~X&W,t[31]=Z^~Q&Y,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=E^~B&T,t[13]=R^~I&j,t[22]=q^~H&L,t[23]=D^~z&F,t[32]=X^~W&V,t[33]=Q^~Y&G,t[42]=it^~ot&st,t[43]=nt^~at&ut,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&P,t[15]=I^~j&O,t[24]=H^~L&U,t[25]=z^~F&K,t[34]=W^~V&$,t[35]=Y^~G&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~P&A,t[17]=j^~O&k,t[26]=L^~U&C,t[27]=F^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=P^~A&E,t[19]=O^~k&R,t[28]=U^~C&q,t[29]=K^~N&D,t[38]=$^~J&X,t[39]=tt^~Z&Q,t[48]=ht^~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(21),r(11))},function(t,e,r){var i=r(1),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";Object.defineProperty(e,"__esModule",{value:!0}),e.toSignatureObject=s,e.verifyES256K=u,e.verifyRecoverableES256K=h;var i=r(2),n=r(57),o=function(t){return t&&t.__esModule?t:{default:t}}(r(58));var a=new i.ec("secp256k1");function s(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=o.default.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}function u(t,e,r){var i=(0,n.sha256)(t),o=s(e),u=r.find(function(t){var e=t.publicKeyHex;return a.keyFromPublic(e,"hex").verify(i,o)});if(!u)throw new Error("Signature invalid for JWT");return u}function h(t,e,r){var i=s(e,!0),o=(0,n.sha256)(t),u=a.recoverPubKey(o,i,i.recoveryParam),h=u.encode("hex"),f=u.encode("hex",!0),c=(0,n.toEthereumAddress)(h),d=r.find(function(t){var e=t.publicKeyHex,r=t.ethereumAddress;return e===h||e===f||r===c});if(!d)throw new Error("Signature invalid for JWT");return d}var f={ES256K:u,"ES256K-R":h};function c(t){var e=f[t];if(!e)throw new Error("Unsupported algorithm "+t);return e}c.toSignatureObject=s,t.exports=c},function(t,e,r){"use strict";(function(t){var i=r(179);function n(e,r){return void 0===r&&(r="utf8"),t.isBuffer(e)?a(e.toString("base64")):a(new t(e,r).toString("base64"))}function o(t){return t=t.toString(),i.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function a(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=n;s.encode=n,s.decode=function(e,r){return void 0===r&&(r="utf8"),new t(o(e),"base64").toString(r)},s.toBase64=o,s.fromBase64=a,s.toBuffer=function(e){return new t(o(e),"base64")},Object.defineProperty(e,"__esModule",{value:!0}),e.default=s}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=e.length,i=r%4;if(!i)return e;var n=r,o=4-i,a=new t(r+o);for(a.write(e);o--;)a.write("=",n++);return a.toString()}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(i){Object.defineProperty(e,"__esModule",{value:!0});var n=s(r(16)),o=s(r(17));e.ES256KSigner=u;var a=s(r(58));function s(t){return t&&t.__esModule?t:{default:t}}function u(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];function e(e){var r=e.r,n=e.s,o=e.recoveryParam,s=i.alloc(t?65:64);if(i.from(r,"hex").copy(s,0),i.from(n,"hex").copy(s,32),t){if(void 0===o)throw new Error("Signer did not return a recoveryParam");s[64]=o}return a.default.encode(s)}return function(){var t=(0,o.default)(n.default.mark(function t(r,i){var o;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i(r);case 2:return o=t.sent,t.abrupt("return",e(o));case 4:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()}var h={ES256K:u(),"ES256K-R":u(!0)};t.exports=function(t){var e=h[t];if(!e)throw new Error("Unsupported algorithm "+t);return e}}).call(this,r(1).Buffer)},function(t,e){},function(t,e,r){"use strict";var i=u(r(16)),n=u(r(17)),o=function(){var t=(0,n.default)(i.default.mark(function t(e,r){var n;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=void 0,t.prev=1,t.next=4,(0,s.ipfsLookup)(e,r);case 4:n=t.sent,t.next=9;break;case 7:t.prev=7,t.t0=t.catch(1);case 9:if(n&&n.signingKey){t.next=11;break}throw new Error("Invalid muport did");case 11:return t.abrupt("return",n);case 12:case"end":return t.stop()}},t,this,[[1,7]])}));return function(e,r){return t.apply(this,arguments)}}(),a=r(31),s=r(183);function u(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(1!==e.version)throw new Error("Unsupported muportDocument version");var r={"@context":"https://w3id.org/did/v1",id:t,publicKey:[{id:t+"#signingKey",type:"Secp256k1VerificationKey2018",owner:t,publicKeyHex:e.signingKey},{id:t+"#managementKey",type:"Secp256k1VerificationKey2018",owner:t},{id:t+"#encryptionKey",type:"Curve25519EncryptionPublicKey",owner:t,publicKeyBase64:e.asymEncryptionKey}],authentication:[{type:"Secp256k1SignatureAuthentication2018",publicKey:t+"#signingKey"}],muportData:{}};return 42===e.managementKey.length?r.publicKey[1].ethereumAddress=e.managementKey:r.publicKey[1].publicKeyHex=e.managementKey,e.publicProfile&&(r.uportProfile=e.publicProfile),e.symEncryptedData&&(r.muportData.symEncryptedData=e.symEncryptedData),e.recoveryNetwork&&(r.muportData.recoveryNetwork=e.recoveryNetwork),r}t.exports=function(){var t=function(){var t=(0,n.default)(i.default.mark(function t(r,n){var a,u;return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o(n.id,e.ipfsConf);case 2:return a=t.sent,t.next=5,(0,s.ethLookup)(a.managementKey,e.rpcProviderUrl);case 5:if(!(u=t.sent)){t.next=10;break}return t.next=9,o(u,e.ipfsConf);case 9:a=t.sent;case 10:return t.abrupt("return",h(r,a));case 11:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.registerMethod)("muport",t)}},function(t,e,r){"use strict";(function(e){var i=d(r(28)),n=d(r(88)),o=d(r(16)),a=d(r(17)),s=function(){var t=(0,a.default)(o.default.mark(function t(e,r){var i;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=(r=r||b).protocol+"://"+r.host+"/ipfs/"+e,t.abrupt("return",w(i));case 3:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),u=function(){var t=(0,a.default)(o.default.mark(function t(e){var r,i,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="0x37c3719cdabd54e6b5195e366f9ef8fc59a509e3",i=42===e.length?e.slice(2):M(e),a=g(i),t.next=5,w(u,(0,n.default)({method:"eth_call",params:[{to:r,data:a},"latest"],id:1,jsonrpc:"2.0"}));case 5:return s=t.sent.result,t.abrupt("return",s===v?null:y(s));case 7:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}(),h=d(r(184)),f=r(2),c=r(87);function d(t){return t&&t.__esModule?t:{default:t}}var l="undefined"!=typeof window?window.XMLHttpRequest:r(185).XMLHttpRequest,p=new f.ec("secp256k1"),m="https://mainnet.infura.io",b={host:"ipfs.infura.io",port:5001,protocol:"https"},v="0x0000000000000000000000000000000000000000000000000000000000000000",y=function(t){return h.default.encode(e.from("1220"+t.slice(2),"hex"))},g=function(t){return"0x5dd4a65f000000000000000000000000"+t+"6d75506f7274446f63756d656e74495046533132323000000000000000000000"};function w(t,e){var r=new l;return new i.default(function(i,n){r.onreadystatechange=function(){if(4===r.readyState&&1!==r.timeout)if(200!==r.status)n("[muport-did-resolver] status "+r.status+": "+r.responseText);else try{i(JSON.parse(r.responseText))}catch(t){n("[muport-did-resolver] while parsing data: '"+String(r.responseText)+"', error: "+String(t))}},e?(r.open("POST",t),r.setRequestHeader("Content-Type","application/json")):r.open("GET",t),r.setRequestHeader("accept","application/json"),r.send(e)})}var M=function(t){return function(t){return e.from(c.keccak_256.buffer(t))}(e.from(function(t){return p.keyFromPublic(t,"hex").pub.encode("hex")}(t).slice(2),"hex")).slice(-20).toString("hex")};t.exports={ethLookup:u,ipfsLookup:s}}).call(this,r(1).Buffer)},function(t,e,r){var i=r(30);t.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},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(16)),n=m(r(17)),o=m(r(92)),a=m(r(189));e.bytes32toString=v,e.stringToBytes32=y,e.wrapDidDocument=w,e.default=function(){var t=this,e=function(){var t=(0,n.default)(i.default.mark(function t(e){var r,n,a,s,u,h,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,u=y(s),n=void 0,h=!0,f=!1,c=void 0,t.prev=14,d=(0,o.default)(u);!(h=(l=d.next()).done);h=!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,!h&&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]])}));return function(e){return t.apply(this,arguments)}}(),r=function(){var t=(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)}));return function(e,r){return t.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 u.default(t.rpcUrl||"https://mainnet.infura.io/ethr-did")}(a),p=new h.default(c),m=a.registry||b,v=new d.default(p)(l.default).at(m),y=f.default.logDecoder(l.default,!1),g=function(){var e=(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)}));return function(t){return e.apply(this,arguments)}}();(0,s.registerMethod)("ethr",r)};var s=r(31),u=m(r(193)),h=m(r(195)),f=m(r(205)),c=m(r(6)),d=m(r(209)),l=m(r(214)),p=r(1);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"}],u=0,h={},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(u++,v(M.delegateType)){case"sigAuth":h[S]={type:"Secp256k1SignatureAuthentication2018",publicKey:t+"#delegate-"+u};case"veriKey":f[S]={id:t+"#delegate-"+u,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],k=x[2],E=g[x[4]]||x[4],R=x[6];switch(A){case"pub":var B={id:t+"#delegate-"+ ++u,type:""+k+E,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;default:B.value=M.value}f[S]=B;break;case"svc":d[S]={type:k,serviceEndpoint:p.Buffer.from(M.value.slice(2),"hex").toString()}}}}}else u>0&&("DIDDelegateChanged"===M._eventName||"DIDAttributeChanged"===M._eventName&&v(M.name).match(/^did\/pub\//))&&_.lt(i)&&u--,delete h[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)(h))};return(0,a.default)(d).length>0&&(I.service=(0,a.default)(d)),I}},function(t,e,r){r(49),r(32),t.exports=r(188)},function(t,e,r){var i=r(9),n=r(53);t.exports=r(0).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(190),__esModule:!0}},function(t,e,r){r(191),t.exports=r(0).Object.values},function(t,e,r){var i=r(5),n=r(192)(!1);i(i.S,"Object",{values:function(t){return n(t)}})},function(t,e,r){var i=r(20),n=r(15),o=r(27).f;t.exports=function(t){return function(e){for(var r,a=n(e),s=i(a),u=s.length,h=0,f=[];u>h;)o.call(a,r=s[h++])&&f.push(t?[r,a[r]]:a[r]);return f}}},function(t,e,r){"use strict";var i=r(194);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(196),n=r(200),o=r(93);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}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:function(t,e){return function(){var r=null,n=null,a=this,s=[].slice.call(arguments),u=t.replace("eth_","");s.length>0&&"function"==typeof s[s.length-1]&&(r=s.pop());var h=function(){var r=this;return new Promise(function(o,h){if(s.length<e[2])h(new Error("[ethjs-query] method '"+u+"' 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)h(new Error("[ethjs-query] method '"+u+"' 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 '"+u+"' with inputs "+JSON.stringify(s,null,r.options.jsonSpace));try{n=i.formatInputs(t,s),r.log("method formatting success for '"+u+"' with formatted result: "+JSON.stringify(n,null,r.options.jsonSpace))}catch(t){return void h(new Error("[ethjs-query] while formatting inputs '"+JSON.stringify(s,null,r.options.jsonSpace)+"' for method '"+u+"' error: "+t))}r.rpc.sendAsync({method:t,params:n}).then(function(e){try{r.log("attempting method formatting for '"+u+"' with raw outputs: "+JSON.stringify(e,null,r.options.jsonSpace));var n=i.formatOutputs(t,e);return r.log("method formatting success for '"+u+"' 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 '"+u+"' "+t);return void h(a)}}).catch(function(t){var e=new Error("[ethjs-query] while formatting outputs from RPC '"+JSON.stringify(t,null,r.options.jsonSpace)+"'");h(e)})}})}.call(this);return r?o(h)(r):h}}(t,i.schema.methods[t])})})},function(t,e,r){"use strict";var i=r(197),n=r(198),o=r(60),a=r(40),s=n.padToEven,u=n.arrayContainsArray,h=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=h(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])),!u(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(59),n=r(40);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(1).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(1).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 u(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,h=0,f=r;f<s;f+=i)h=u(t,f,f+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==a){var c=1;for(h=u(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},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 h=["","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,u=a/67108864|0;r.words[0]=s;for(var h=1;h<i;h++){for(var f=u>>>26,c=67108863&u,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+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:h[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,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s<o;s++)h[s]=0}else{for(s=0;s<o-n;s++)h[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[o-s-1]=a}return h},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,u=r.words,h=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],k=8191&A,E=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],j=8191&T,P=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,F=z>>>13,U=0|s[1],K=8191&U,J=U>>>13,Z=0|s[2],X=8191&Z,Q=Z>>>13,W=0|s[3],Y=8191&W,V=W>>>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],ut=8191&st,ht=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=(h+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(d,L)|0))<<13)|0;h=((o=Math.imul(d,F))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var vt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;h=((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,F))+Math.imul(y,L)|0,o=Math.imul(y,F),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=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Q)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(M,L)|0,o=Math.imul(M,F),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,X)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var gt=(h+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Y)|0))<<13)|0;h=((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,F))+Math.imul(x,L)|0,o=Math.imul(x,F),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,X)|0,n=(n=n+Math.imul(v,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,L),n=(n=Math.imul(k,F))+Math.imul(E,L)|0,o=Math.imul(E,F),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,X)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Q)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,Y)|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=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((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,F))+Math.imul(I,L)|0,o=Math.imul(I,F),i=i+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Y)|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=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(j,L),n=(n=Math.imul(j,F))+Math.imul(P,L)|0,o=Math.imul(P,F),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(k,X)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Q)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,Y)|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=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ut)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,F))+Math.imul(N,L)|0,o=Math.imul(N,F),i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(B,X)|0,n=(n=n+Math.imul(B,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((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,F))+Math.imul(H,L)|0,o=Math.imul(H,F),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(j,X)|0,n=(n=n+Math.imul(j,Q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|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=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((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,X)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,Q)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,V)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,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(k,rt)|0,n=(n=n+Math.imul(k,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|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 kt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,X),n=(n=Math.imul(D,Q))+Math.imul(H,X)|0,o=Math.imul(H,Q),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,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(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|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 Et=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,V))+Math.imul(H,Y)|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(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,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(k,ut)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|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=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((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(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var Bt=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((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(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|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=(h+(i=i+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ut),n=(n=Math.imul(D,ht))+Math.imul(H,ut)|0,o=Math.imul(H,ht),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 jt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Ot=(h+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return h=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=bt,u[1]=vt,u[2]=yt,u[3]=gt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=xt,u[9]=At,u[10]=kt,u[11]=Et,u[12]=Rt,u[13]=Bt,u[14]=It,u[15]=Tt,u[16]=jt,u[17]=Pt,u[18]=Ot,0!==h&&(u[19]=h,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,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),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,u=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=u,d=h,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=u*c-h*d,d=u*d+h*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),u=new Array(i),h=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,h,i),this.transform(a,o,s,u,i,n),this.transform(h,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-u[l]*c[l];u[l]=s[l]*c[l]+u[l]*f[l],s[l]=p}return this.conjugate(s,u,i),this.transform(s,u,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,u=(0|this.words[e])-s<<r;this.words[e]=u|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,u=r;if(n-=a,n=Math.max(0,n),u){for(var h=0;h<a;h++)u.words[h]=this.words[h];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&s}return u&&0!==f&&(u.words[u.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 u=(0|t.words[n])*e;s=((o-=67108863&u)>>26)-(u/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,u=i.length-n.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var f=i.clone()._ishlnsubmul(n,1,u);0===f.negative&&(i=f,s&&(s.words[u]=1));for(var c=u-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),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;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()||u.isOdd())&&(s.iadd(f),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(u)):(r.isub(e),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},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),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),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(u),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),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);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,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>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}u=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)}}(void 0===t||t,this)}).call(this,r(37)(t))},function(t,e,r){"use strict";var i=r(93);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=function(t,e){return Object.assign({},{id:e,jsonrpc:"2.0",params:[]},t)}(t,r.idCounter++),o=new Promise(function(t,e){r.currentProvider.sendAsync(n,function(i,o){var a=o||{};if(i||a.error){var s="[ethjs-rpc] "+(a.error?"rpc":"")+" error with payload "+JSON.stringify(n,null,r.options.jsonSpace)+" "+(i?String(i):JSON.stringify(a.error,null,r.options.jsonSpace)),u=new Error(s);return u.value=i||a.error,void e(u)}t(a.result)})});return e?i(o)(e):o}},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(203).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(204),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(11))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var i,n=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){f(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}}()?function(){var e="setImmediate$"+Math.random()+"$",r=function(r){r.source===t&&"string"==typeof r.data&&0===r.data.indexOf(e)&&f(+r.data.slice(e.length))};t.addEventListener?t.addEventListener("message",r,!1):t.attachEvent("onmessage",r),i=function(r){t.postMessage(e+r,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){f(t.data)},i=function(e){t.port2.postMessage(e)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var t=s.documentElement;i=function(e){var r=s.createElement("script");r.onreadystatechange=function(){f(e),r.onreadystatechange=null,t.removeChild(r),r=null},t.appendChild(r)}}():i=function(t){setTimeout(f,0,t)},u.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 a={callback:t,args:e};return o[n]=a,i(n),n++},u.clearImmediate=h}function h(t){delete o[t]}function f(t){if(a)setTimeout(f,0,t);else{var e=o[t];if(e){a=!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{h(t),a=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(11),r(21))},function(t,e,r){"use strict";(function(e){var i=r(206),n=i.uint256Coder,o=(i.coderBoolean,i.coderFixedBytes,i.coderAddress,i.coderDynamicBytes,i.coderString,i.coderArray,i.paramTypePart,i.getParamCoder);function a(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,u=0;i.forEach(function(t){t.dynamic?(s+=32,u+=a(t.value.length)):s+=a(t.value.length)});var h=0,f=s,c=new e(s+u);return i.forEach(function(t,e){t.dynamic?(n.encode(f).copy(c,h),h+=32,t.value.copy(c,f),f+=a(t.value.length)):(t.value.copy(c,h),h+=a(t.value.length))}),"0x"+c.toString("hex")}function s(t,e,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];arguments.length<3&&(r=e,e=t,t=[]),r=i.hexOrBuffer(r);var s=new function(){},u=0;return e.forEach(function(e,i){var h=o(e);if(h.dynamic){var f=n.decode(r,u),c=h.decode(r,f.value.toNumber());u+=f.consumed}else{c=h.decode(r,u);u+=c.consumed}a&&(s[i]=c.value),t[i]&&(s[t[i]]=c.value)}),s}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 h(t,e){var r=a(i.getKeys(t.inputs,"type"),e).substring(2);return""+u(t)+r}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],u=t.inputs.filter(function(t){return!t.indexed}),h=s(i.getKeys(u,"name",!0),i.getKeys(u,"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);h[t.name]=a.decode(i,0).value}),h._eventName=t.name,h}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:a,decodeParams:s,encodeMethod:h,decodeMethod:function(t,e){return s(i.getKeys(t.outputs,"name",!0),i.getKeys(t.outputs,"type"),i.hexOrBuffer(e))},encodeEvent:function(t,e){return h(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,encodeSignature:u}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(e){var i=r(207),n=r(60),o=r(208).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 u(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function h(t,r){var i=t;if(!e.isBuffer(i)){if(!u(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=h(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(!u(r,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return r=h(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(h(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 u=[],h=0;h<o;h++){var f=t.decode(e,a);s+=f.consumed,a+=f.consumed,u.push(f.value)}return{consumed:s,value:u}},dynamic:-1===r}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:i,bnToBuffer:s,isHexString:u,hexOrBuffer:h,hexlify:function(t){return"number"==typeof t?"0x"+s(new i(t)).toString("hex"):t.mod||t.modulo?"0x"+s(t).toString("hex"):"0x"+h(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(1).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(1).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 u(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,h=0,f=r;f<s;f+=i)h=u(t,f,f+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==a){var c=1;for(h=u(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},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 h=["","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,u=a/67108864|0;r.words[0]=s;for(var h=1;h<i;h++){for(var f=u>>>26,c=67108863&u,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+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:h[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,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s<o;s++)h[s]=0}else{for(s=0;s<o-n;s++)h[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[o-s-1]=a}return h},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,u=r.words,h=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],k=8191&A,E=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],j=8191&T,P=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,F=z>>>13,U=0|s[1],K=8191&U,J=U>>>13,Z=0|s[2],X=8191&Z,Q=Z>>>13,W=0|s[3],Y=8191&W,V=W>>>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],ut=8191&st,ht=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=(h+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(d,L)|0))<<13)|0;h=((o=Math.imul(d,F))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var vt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;h=((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,F))+Math.imul(y,L)|0,o=Math.imul(y,F),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=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Q)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(M,L)|0,o=Math.imul(M,F),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,X)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var gt=(h+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Y)|0))<<13)|0;h=((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,F))+Math.imul(x,L)|0,o=Math.imul(x,F),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,X)|0,n=(n=n+Math.imul(v,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,L),n=(n=Math.imul(k,F))+Math.imul(E,L)|0,o=Math.imul(E,F),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,X)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Q)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,Y)|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=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((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,F))+Math.imul(I,L)|0,o=Math.imul(I,F),i=i+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Y)|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=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(j,L),n=(n=Math.imul(j,F))+Math.imul(P,L)|0,o=Math.imul(P,F),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(k,X)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Q)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,Y)|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=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ut)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,F))+Math.imul(N,L)|0,o=Math.imul(N,F),i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(B,X)|0,n=(n=n+Math.imul(B,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((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,F))+Math.imul(H,L)|0,o=Math.imul(H,F),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(j,X)|0,n=(n=n+Math.imul(j,Q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|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=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((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,X)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,Q)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,V)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,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(k,rt)|0,n=(n=n+Math.imul(k,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|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 kt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,X),n=(n=Math.imul(D,Q))+Math.imul(H,X)|0,o=Math.imul(H,Q),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,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(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|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 Et=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,V))+Math.imul(H,Y)|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(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,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(k,ut)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|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=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((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(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var Bt=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((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(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|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=(h+(i=i+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ut),n=(n=Math.imul(D,ht))+Math.imul(H,ut)|0,o=Math.imul(H,ht),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 jt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Ot=(h+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return h=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=bt,u[1]=vt,u[2]=yt,u[3]=gt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=xt,u[9]=At,u[10]=kt,u[11]=Et,u[12]=Rt,u[13]=Bt,u[14]=It,u[15]=Tt,u[16]=jt,u[17]=Pt,u[18]=Ot,0!==h&&(u[19]=h,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,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),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,u=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=u,d=h,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=u*c-h*d,d=u*d+h*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),u=new Array(i),h=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,h,i),this.transform(a,o,s,u,i,n),this.transform(h,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-u[l]*c[l];u[l]=s[l]*c[l]+u[l]*f[l],s[l]=p}return this.conjugate(s,u,i),this.transform(s,u,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,u=(0|this.words[e])-s<<r;this.words[e]=u|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,u=r;if(n-=a,n=Math.max(0,n),u){for(var h=0;h<a;h++)u.words[h]=this.words[h];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&s}return u&&0!==f&&(u.words[u.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 u=(0|t.words[n])*e;s=((o-=67108863&u)>>26)-(u/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,u=i.length-n.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var f=i.clone()._ishlnsubmul(n,1,u);0===f.negative&&(i=f,s&&(s.words[u]=1));for(var c=u-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),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;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()||u.isOdd())&&(s.iadd(f),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(u)):(r.isub(e),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},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),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),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(u),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),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);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,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>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}u=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)}}(void 0===t||t,this)}).call(this,r(37)(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],u=[224,256,384,512],h=["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<h.length;++i){var n=h[i];r[n]=f(t,e,n)}return r},l=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,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<h.length;++i){var n=h[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,u=this.byteCount,h=this.blockCount,f=0,c=this.s;f<o;){if(this.reset)for(this.reset=!1,s[0]=this.block,r=1;r<h+1;++r)s[r]=0;if(e)for(r=this.start;f<o&&r<u;++f)s[r>>2]|=t[f]<<a[3&r++];else for(r=this.start;f<o&&r<u;++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>=u){for(this.start=r-u,this.block=s[h],r=0;r<h;++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,u="";s<i;){for(a=0;a<e&&s<i;++a,++s)t=r[a],u+=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&&(u+=o[t>>4&15]+o[15&t]),n>1&&(u+=o[t>>12&15]+o[t>>8&15]),n>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},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 u=new Uint32Array(t);a<i;){for(o=0;o<e&&a<i;++o,++a)u[a]=r[o];a%e==0&&w(r)}return n&&(u[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,u=[];s<n;){for(a=0;a<r&&s<n;++a,++s)t=s<<2,e=i[a],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&w(i)}return o&&(t=s<<2,e=i[a],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var w=function(t){var e,r,i,n,o,a,u,h,f,c,d,l,p,m,b,v,y,g,w,M,_,S,x,A,k,E,R,B,I,T,j,P,O,C,N,q,D,H,z,L,F,U,K,J,Z,X,Q,W,Y,V,G,$,tt,et,rt,it,nt,ot,at,st,ut,ht,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],u=t[3]^t[13]^t[23]^t[33]^t[43],h=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|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<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|f>>>31),r=o^(f<<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^(c<<1|d>>>31),r=u^(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=h^(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],X=t[11]<<4|t[10]>>>28,Q=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,ut=t[30]<<9|t[31]>>>23,U=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,W=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,T=t[33]<<13|t[32]>>>19,j=t[32]<<13|t[33]>>>19,ht=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,P=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,k=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,E=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,F=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^~E&B,t[11]=k^~R&I,t[20]=C^~q&H,t[21]=N^~D&z,t[30]=J^~X&W,t[31]=Z^~Q&Y,t[40]=et^~it&ot,t[41]=rt^~nt&at,t[2]=v^~g&M,t[3]=y^~w&_,t[12]=E^~B&T,t[13]=R^~I&j,t[22]=q^~H&L,t[23]=D^~z&F,t[32]=X^~W&V,t[33]=Q^~Y&G,t[42]=it^~ot&st,t[43]=nt^~at&ut,t[4]=g^~M&S,t[5]=w^~_&x,t[14]=B^~T&P,t[15]=I^~j&O,t[24]=H^~L&U,t[25]=z^~F&K,t[34]=W^~V&$,t[35]=Y^~G&tt,t[44]=ot^~st&ht,t[45]=at^~ut&ft,t[6]=M^~S&m,t[7]=_^~x&b,t[16]=T^~P&A,t[17]=j^~O&k,t[26]=L^~U&C,t[27]=F^~K&N,t[36]=V^~$&J,t[37]=G^~tt&Z,t[46]=st^~ht&et,t[47]=ut^~ft&rt,t[8]=S^~m&v,t[9]=x^~b&y,t[18]=P^~A&E,t[19]=O^~k&R,t[28]=U^~C&q,t[29]=K^~N&D,t[38]=$^~J&X,t[39]=tt^~Z&Q,t[48]=ht^~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(21),r(11))},function(t,e,r){"use strict";var i=r(210),n=r(94).keccak_256,o=r(213),a=r(95).getKeys,s=r(95).arrayContainsArray;function u(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 h={at:function(h){return new function(){var f=this;f.abi=e||[],f.query=t,f.address=h||"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="call",o={},s=function(){},h=[].slice.call(arguments);if("function"==typeof h[h.length-1]&&(s=h.pop()),"function"===e.type)return new Promise(function(n,a){u(h)&&(o=h.pop());var c=Object.assign({},f.defaultTxObject,o,{to:f.address});c.data=i.encodeMethod(e,h),!1===e.constant&&(r="sendTransaction"),t[r](c,function(t,o){if("call"!==r||t)"sendTransaction"!==r||t?(a(t),s(t,null)):(n(o),s(null,o));else try{var u=i.decodeMethod(e,o);n(u),s(null,u)}catch(t){var h=new Error("[ethjs-contract] while formatting incoming raw call data "+JSON.stringify(o)+" "+t);a(h),s(h,null)}})});if("event"===e.type){var c=function(){var t=a(e.inputs,"type",!1),r=["0x"+n(e.name+"("+t.join(",")+")")],o=Object.assign({},h[0])||{};return{v:new f.filters.Filter(Object.assign({},o,{decoder:function(t){return i.decodeEvent(e,t,r)},defaultFilterObject:Object.assign({},h[0]||{},{to:f.address,topics:r})}))}}();if("object"==typeof c)return c.v}}})}},new:function(){var n={},o=function(){},h=[].slice.call(arguments);"function"==typeof h[h.length-1]&&(o=h.pop()),u(h)&&(n=h.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"),h).substring(2);c.data=""+c.data+d}return t.sendTransaction(c,o)}};return h}}(t)}},function(t,e,r){"use strict";(function(e){var i=r(211),n=i.uint256Coder,o=(i.coderBoolean,i.coderFixedBytes,i.coderAddress,i.coderDynamicBytes,i.coderString,i.coderArray,i.paramTypePart,i.getParamCoder);function a(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,u=0;i.forEach(function(t){t.dynamic?(s+=32,u+=a(t.value.length)):s+=a(t.value.length)});var h=0,f=s,c=new e(s+u);return i.forEach(function(t,e){t.dynamic?(n.encode(f).copy(c,h),h+=32,t.value.copy(c,f),f+=a(t.value.length)):(t.value.copy(c,h),h+=a(t.value.length))}),"0x"+c.toString("hex")}function s(t,e,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];arguments.length<3&&(r=e,e=t,t=[]),r=i.hexOrBuffer(r);var s=new function(){},u=0;return e.forEach(function(e,i){var h=o(e);if(h.dynamic){var f=n.decode(r,u),c=h.decode(r,f.value.toNumber());u+=f.consumed}else{c=h.decode(r,u);u+=c.consumed}a&&(s[i]=c.value),t[i]&&(s[t[i]]=c.value)}),s}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"))+a(i.getKeys(t.inputs,"type"),r).substring(2)}function h(t){var e=t.name+"("+i.getKeys(t.inputs,"type").join(",")+")";return"0x"+i.keccak256(e)}function f(t,r,n){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=t.inputs.filter(function(t){return!t.indexed}),h=s(i.getKeys(u,"name",!0),i.getKeys(u,"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);h[t.name]=a.decode(i,0).value}),h._eventName=t.name,h}function c(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t&&e.topics[0]===h(t))return f(t,e.data,e.topics,r)}t.exports={encodeParams:a,decodeParams:s,encodeMethod:u,decodeMethod:function(t,e){return s(i.getKeys(t.outputs,"name",!0),i.getKeys(t.outputs,"type"),i.hexOrBuffer(e))},encodeEvent:function(t,e){return u(t,e)},decodeEvent:f,decodeLogItem:c,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[h(t)]=t}),function(t){return t.map(function(t){return c(r[t.topics[0]],t,e)}).filter(function(t){return t})}},eventSignature:h}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(e){var i=r(212),n=r(60),o=r(94).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 u(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function h(t,r){var i=t;if(!e.isBuffer(i)){if(!u(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=h(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(!u(r,20))throw new Error("[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string");return r=h(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(h(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 u=[],h=0;h<o;h++){var f=t.decode(e,a);s+=f.consumed,a+=f.consumed,u.push(f.value)}return{consumed:s,value:u}},dynamic:-1===r}}var w=new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\[([0-9]*)\]))/);t.exports={BN:i,bnToBuffer:s,isHexString:u,hexOrBuffer:h,hexlify:function(t){return"number"==typeof t?"0x"+s(new i(t)).toString("hex"):t.mod||t.modulo?"0x"+s(t).toString("hex"):"0x"+h(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(1).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(1).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 u(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,h=0,f=r;f<s;f+=i)h=u(t,f,f+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==a){var c=1;for(h=u(t,f,t.length,e),f=0;f<a;f++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},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 h=["","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,u=a/67108864|0;r.words[0]=s;for(var h=1;h<i;h++){for(var f=u>>>26,c=67108863&u,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+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:h[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,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s<o;s++)h[s]=0}else{for(s=0;s<o-n;s++)h[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[o-s-1]=a}return h},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,u=r.words,h=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],k=8191&A,E=A>>>13,R=0|a[6],B=8191&R,I=R>>>13,T=0|a[7],j=8191&T,P=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,F=z>>>13,U=0|s[1],K=8191&U,J=U>>>13,Z=0|s[2],X=8191&Z,Q=Z>>>13,W=0|s[3],Y=8191&W,V=W>>>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],ut=8191&st,ht=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=(h+(i=Math.imul(c,L))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(d,L)|0))<<13)|0;h=((o=Math.imul(d,F))+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var vt=(h+(i=i+Math.imul(c,K)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;h=((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,F))+Math.imul(y,L)|0,o=Math.imul(y,F),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=(h+(i=i+Math.imul(c,X)|0)|0)+((8191&(n=(n=n+Math.imul(c,Q)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,Q)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(M,L)|0,o=Math.imul(M,F),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,X)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var gt=(h+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,V)|0)+Math.imul(d,Y)|0))<<13)|0;h=((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,F))+Math.imul(x,L)|0,o=Math.imul(x,F),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,X)|0,n=(n=n+Math.imul(v,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,V)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,$)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,L),n=(n=Math.imul(k,F))+Math.imul(E,L)|0,o=Math.imul(E,F),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,X)|0,n=(n=n+Math.imul(w,Q)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Q)|0,i=i+Math.imul(v,Y)|0,n=(n=n+Math.imul(v,V)|0)+Math.imul(y,Y)|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=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((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,F))+Math.imul(I,L)|0,o=Math.imul(I,F),i=i+Math.imul(k,K)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Y)|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=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(j,L),n=(n=Math.imul(j,F))+Math.imul(P,L)|0,o=Math.imul(P,F),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(k,X)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Q)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(x,Y)|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=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,ut)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(C,L),n=(n=Math.imul(C,F))+Math.imul(N,L)|0,o=Math.imul(N,F),i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(B,X)|0,n=(n=n+Math.imul(B,Q)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,Q)|0,i=i+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var xt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((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,F))+Math.imul(H,L)|0,o=Math.imul(H,F),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(j,X)|0,n=(n=n+Math.imul(j,Q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Q)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,V)|0,i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|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=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((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,X)|0,n=(n=n+Math.imul(C,Q)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,Q)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,V)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,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(k,rt)|0,n=(n=n+Math.imul(k,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|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 kt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(D,X),n=(n=Math.imul(D,Q))+Math.imul(H,X)|0,o=Math.imul(H,Q),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,V)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,V)|0,i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,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(k,ot)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|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 Et=(h+(i=i+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,V))+Math.imul(H,Y)|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(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,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(k,ut)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|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=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((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(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(k,ct)|0,n=(n=n+Math.imul(k,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var Bt=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((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(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|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=(h+(i=i+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,mt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,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,ut)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,dt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,dt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(D,ut),n=(n=Math.imul(D,ht))+Math.imul(H,ut)|0,o=Math.imul(H,ht),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 jt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,i=Math.imul(D,ct),n=(n=Math.imul(D,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Pt=(h+(i=i+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Ot=(h+(i=Math.imul(D,pt))|0)+((8191&(n=(n=Math.imul(D,mt))+Math.imul(H,pt)|0))<<13)|0;return h=((o=Math.imul(H,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=bt,u[1]=vt,u[2]=yt,u[3]=gt,u[4]=wt,u[5]=Mt,u[6]=_t,u[7]=St,u[8]=xt,u[9]=At,u[10]=kt,u[11]=Et,u[12]=Rt,u[13]=Bt,u[14]=It,u[15]=Tt,u[16]=jt,u[17]=Pt,u[18]=Ot,0!==h&&(u[19]=h,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,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var f=o-h,c=(0|t.words[f])*(0|e.words[h]),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,u=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),f=0;f<n;f+=s)for(var c=u,d=h,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=u*c-h*d,d=u*d+h*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),u=new Array(i),h=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,h,i),this.transform(a,o,s,u,i,n),this.transform(h,o,f,c,i,n);for(var l=0;l<i;l++){var p=s[l]*f[l]-u[l]*c[l];u[l]=s[l]*c[l]+u[l]*f[l],s[l]=p}return this.conjugate(s,u,i),this.transform(s,u,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,u=(0|this.words[e])-s<<r;this.words[e]=u|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,u=r;if(n-=a,n=Math.max(0,n),u){for(var h=0;h<a;h++)u.words[h]=this.words[h];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&s}return u&&0!==f&&(u.words[u.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 u=(0|t.words[n])*e;s=((o-=67108863&u)>>26)-(u/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,u=i.length-n.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var f=i.clone()._ishlnsubmul(n,1,u);0===f.negative&&(i=f,s&&(s.words[u]=1));for(var c=u-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),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;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()||u.isOdd())&&(s.iadd(f),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(u)):(r.isub(e),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},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),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),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(u),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),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);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,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>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}u=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)}}(void 0===t||t,this)}).call(this,r(37)(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{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):new r(function(e){e(t.value)}).then(a,s)}u((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(31),a="/.well-known/did.json";e.default=function(){o.registerMethod("https",function(t,e){return i(this,void 0,void 0,function(){var i,o,s,u;return n(this,function(n){switch(n.label){case 0:i="https://"+e.id+a,o=null,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(t){return new Promise(function(e,i){var n=new("undefined"!=typeof window?window.XMLHttpRequest:r(216).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()})}(i)];case 2:return o=n.sent(),[3,4];case 3:throw s=n.sent(),new Error("DID must resolve to a valid https URL: "+s.message);case 4:u=null;try{u=JSON.parse(o)}catch(t){throw new Error("DID must resolve to a JSON document")}if("https://w3id.org/did/v1"!==u["@context"])throw new Error("DID document missing context");if(u.id!==t)throw new Error("DID document id does not match requested did");if(!(Array.isArray(u.publicKey)&&u.publicKey.length>0))throw new Error("DID document has no public keys");return[2,u]}})})})}},function(t,e){},function(t,e,r){"use strict";e.__esModule=!0;var i=function(t){return t&&t.__esModule?t:{default:t}}(r(218));e.default=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return(0,i.default)(t)}},function(t,e,r){t.exports={default:r(219),__esModule:!0}},function(t,e,r){r(32),r(220),t.exports=r(0).Array.from},function(t,e,r){"use strict";var i=r(23),n=r(5),o=r(36),a=r(73),s=r(74),u=r(45),h=r(221),f=r(53);n(n.S+n.F*!r(79)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,n,c,d=o(t),l="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,b=void 0!==m,v=0,y=f(d);if(b&&(m=i(m,p>2?arguments[2]:void 0,2)),void 0==y||l==Array&&s(y))for(r=new l(e=u(d.length));e>v;v++)h(r,v,b?m(d[v],v):d[v]);else for(c=y.call(d),r=new l;!(n=c.next()).done;v++)h(r,v,b?a(c,m,[n.value,v],!0):n.value);return r.length=v,r}})},function(t,e,r){"use strict";var i=r(8),n=r(24);t.exports=function(t,e,r){e in t?i.f(t,e,n(0,r)):t[e]=r}}])});