text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BaseControllers=t():e.BaseControllers=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=113)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"u",(function(){return n})),r.d(t,"t",(function(){return i})),r.d(t,"s",(function(){return o})),r.d(t,"r",(function(){return a})),r.d(t,"v",(function(){return s})),r.d(t,"w",(function(){return u})),r.d(t,"z",(function(){return f})),r.d(t,"a",(function(){return c})),r.d(t,"c",(function(){return d})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return l})),r.d(t,"e",(function(){return p})),r.d(t,"h",(function(){return b})),r.d(t,"f",(function(){return v})),r.d(t,"g",(function(){return g})),r.d(t,"l",(function(){return y})),r.d(t,"m",(function(){return m})),r.d(t,"k",(function(){return _})),r.d(t,"i",(function(){return w})),r.d(t,"j",(function(){return S})),r.d(t,"q",(function(){return E})),r.d(t,"p",(function(){return M})),r.d(t,"x",(function(){return A})),r.d(t,"y",(function(){return O})),r.d(t,"n",(function(){return x})),r.d(t,"o",(function(){return P}));const n={height:660,width:375},i={height:740,width:1315},o={height:700,width:1200},a={height:700,width:450},s="popup_loaded",u="popup_result",f="setup_complete",c="walletActivity.allTransactions",d="walletActivity.send",h="walletActivity.receive",l="walletActivity.topup",p="walletActivity.all",b="walletActivity.lastOneWeek",v="walletActivity.lastOneMonth",g="walletActivity.lastSixMonts",y="walletActivity.successful",m="walletActivity.unsuccessful",_="walletActivity.pending",w="walletActivity.cancelled",S="walletActivity.cancelling",E={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},M={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},A={GET_PROVIDER_STATE:"wallet_get_provider_state"},O={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"},x={REDIRECT_CHANNEL:"redirect_channel",PROVIDER_CHANGE_CHANNEL:"torus_provider_change_channel",TRANSACTION_CHANNEL:"torus_channel",MESSAGE_CHANNEL:"torus_message_channel",WALLET_LOGOUT_CHANNEL:"wallet_logout_channel",WALLET_SELECTED_ADDRESS_CHANNEL:"wallet_selected_address_channel",WALLET_NETWORK_CHANGE_CHANNEL:"wallet_network_change_channel",WALLET_ACCOUNT_IMPORT_CHANNEL:"wallet_account_import_channel"},P={LOGOUT:"logout",ACCOUNT_IMPORTED:"account_imported",SELECTED_ADDRESS_CHANGE:"selected_address_change",NETWORK_CHANGE:"network_change"}},function(e,t,r){var n,i;!function(o,a){"use strict";void 0===(i="function"==typeof(n=function(){var e=function(){},t="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function n(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function o(r){return"debug"===r&&(r="log"),"undefined"!=typeof console&&("trace"===r&&t?i:void 0!==console[r]?n(console,r):void 0!==console.log?n(console,"log"):e)}function a(t,n){for(var i=0;i<r.length;i++){var o=r[i];this[o]=i<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function s(e,t,r){return function(){"undefined"!=typeof console&&(a.call(this,t,r),this[e].apply(this,arguments))}}function u(e,t,r){return o(e)||s.apply(this,arguments)}function f(e,t,n){var i,o=this;t=null==t?"WARN":t;var s="loglevel";function f(){var e;if("undefined"!=typeof window&&s){try{e=window.localStorage[s]}catch(e){}if(void 0===e)try{var t=window.document.cookie,r=t.indexOf(encodeURIComponent(s)+"=");-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}catch(e){}return void 0===o.levels[e]&&(e=void 0),e}}"string"==typeof e?s+=":"+e:"symbol"==typeof e&&(s=void 0),o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||u,o.getLevel=function(){return i},o.setLevel=function(t,n){if("string"==typeof t&&void 0!==o.levels[t.toUpperCase()]&&(t=o.levels[t.toUpperCase()]),!("number"==typeof t&&t>=0&&t<=o.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(i=t,!1!==n&&function(e){var t=(r[e]||"silent").toUpperCase();if("undefined"!=typeof window&&s){try{return void(window.localStorage[s]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"="+t+";"}catch(e){}}}(t),a.call(o,t,e),"undefined"==typeof console&&t<o.levels.SILENT)return"No console available for logging"},o.setDefaultLevel=function(e){t=e,f()||o.setLevel(e,!1)},o.resetLevel=function(){o.setLevel(t,!1),function(){if("undefined"!=typeof window&&s){try{return void window.localStorage.removeItem(s)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)};var c=f();null==c&&(c=t),o.setLevel(c,!1)}var c=new f,d={};c.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=d[e];return t||(t=d[e]=new f(e,c.getLevel(),c.methodFactory)),t};var h="undefined"!=typeof window?window.log:void 0;return c.noConflict=function(){return"undefined"!=typeof window&&window.log===c&&(window.log=h),c},c.getLoggers=function(){return d},c.default=c,c})?n.call(t,r,t,e):n)||(e.exports=i)}()},function(e,t,r){"use strict";(function(e){
  /*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <http://feross.org>
   * @license  MIT
   */
  var n=r(114),i=r(115),o=r(66);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|l(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=s(e,t<0?0:0|l(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|l(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(f(e,o)===f(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;h<u;h++)if(f(e,o+h)!==f(t,h)){d=!1;break}if(d)return o}return-1}function m(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function _(e,t,r,n){return q(U(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return w(e,t,r,n)}function E(e,t,r,n){return q(F(t),e,r,n)}function M(e,t,r,n){return q(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,f=e[i],c=null,d=f>239?4:f>223?3:f>191?2:1;if(i+d<=r)switch(d){case 1:f<128&&(c=f);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return f(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):b.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),f=this.slice(n,i),c=e.slice(t,r),d=0;d<s;++d)if(f[d]!==c[d]){o=f[d],a=c[d];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function P(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function R(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function T(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,o){return o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,o){return o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||k(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||k(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||k(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||k(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||k(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||k(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||k(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||k(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||k(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=u.isBuffer(e)?e:U(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(11))},function(e,t,r){"use strict";r.d(t,"j",(function(){return i})),r.d(t,"m",(function(){return o.l})),r.d(t,"o",(function(){return o.n})),r.d(t,"n",(function(){return o.m})),r.d(t,"d",(function(){return o.d})),r.d(t,"r",(function(){return o.q})),r.d(t,"f",(function(){return o.f})),r.d(t,"b",(function(){return o.b})),r.d(t,"q",(function(){return o.p})),r.d(t,"e",(function(){return o.e})),r.d(t,"g",(function(){return o.g})),r.d(t,"s",(function(){return o.r})),r.d(t,"l",(function(){return o.k})),r.d(t,"p",(function(){return o.o})),r.d(t,"i",(function(){return o.i})),r.d(t,"c",(function(){return o.c})),r.d(t,"h",(function(){return o.h})),r.d(t,"a",(function(){return o.a})),r.d(t,"k",(function(){return o.j}));var n=r(1);const i=e=>{switch(e){case"rejected":case"unapproved":case"failed":return n.m;case"confirmed":return n.l;case"submitted":return n.k;case"cancelled":return n.i;default:return""}};var o=r(31)},function(e,t,r){"use strict";let n;r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o})),function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"}(n||(n={}));const i={CONTRACT_INTERACTION:"contractInteraction",DEPLOY_CONTRACT:"contractDeployment",STANDARD_TRANSACTION:"transaction",STANDARD_PAYMENT_TRANSACTION:"payment_transaction"},o={TX_WARNING:"tx:warning",TX_ERROR:"tx:error",TX_FAILED:"tx:failed",TX_CONFIRMED:"tx:confirmed",TX_DROPPED:"tx:dropped",TX_EXPIRED:"tx:expired",TX_STATUS_UPDATE:"tx:status_update",TX_UNAPPROVED:"tx:unapproved"}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";var n=r(0),i=r.n(n),o=r(8);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class u extends o.b{constructor(e){let{config:t={},state:r={}}=e;super(),i()(this,"defaultConfig",{}),i()(this,"defaultState",{}),i()(this,"disabled",!1),i()(this,"name","BaseController"),i()(this,"initialConfig",void 0),i()(this,"initialState",void 0),i()(this,"internalConfig",this.defaultConfig),i()(this,"internalState",this.defaultState),this.initialState=r,this.initialConfig=t}get config(){return this.internalConfig}get state(){return this.internalState}configure(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){this.internalConfig=t?e:Object.assign(this.internalConfig,e);for(const e in this.internalConfig)void 0!==this.internalConfig[e]&&(this[e]=this.internalConfig[e])}else for(const t in e)void 0!==this.internalConfig[t]&&(this.internalConfig[t]=e[t],this[t]=e[t])}update(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.internalState=s(t?{}:s({},this.internalState),e),this.emit("store",this.internalState)}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}}t.a=u},function(e,t,r){"use strict";r.d(t,"a",(function(){return v})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return l})),r.d(t,"e",(function(){return g}));var n=r(0),i=r.n(n),o=r(18),a=(r(106),r(25)),s=r(62),u=r.n(s),f=r(19);r(46),r(40),r(108);o.Duplex;function c(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}class d extends a.EventEmitter{emit(e){let t="error"===e;const r=this._events;if(void 0!==r)t=t&&void 0===r.error;else if(!t)return!1;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];if(t){let e;if(i.length>0&&([e]=i),e instanceof Error)throw e;const t=new Error("Unhandled error.".concat(e?" (".concat(e.message,")"):""));throw t.context=e,t}const a=r[e];if(void 0===a)return!1;if("function"==typeof a)c(a,this,i);else{const e=a.length,t=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(a);for(let r=0;r<e;r+=1)c(t[r],this,i)}return!0}}class h extends Error{constructor(e){let{code:t,message:r,data:n}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!r||"string"!=typeof r)throw new Error("message must be string");super(r),i()(this,"code",void 0),i()(this,"data",void 0),this.code=t,void 0!==n&&(this.data=n)}toString(){return u()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}function l(e){return(t,r,n,i)=>{const o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,i())}}function p(e){return async(t,r,n,i)=>{let o;const a=new Promise(e=>{o=e});let s=null,u=!1;const f=async()=>{u=!0,n(e=>{s=e,o()}),await a};try{await e(t,r,f),u?(await a,s(null)):i(null)}catch(e){s?s(e):i(e)}}}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}class v extends d{constructor(){super(),i()(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,r){const n=[];let i=null,o=!1;for(const a of r)if([i,o]=await v._runMiddleware(e,t,a,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise(i=>{const o=e=>{const r=e||t.error;r&&(t.error=Object(f.serializeError)(r)),i([r,!0])},a=e=>{t.error?o(t.error):(e&&("function"!=typeof e&&o(new h({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),n.push(e)),i([null,!1]))};try{r(e,t,a,o)}catch(e){o(e)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((e,r)=>{t(t=>t?r(t):e())})}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new h({code:-32603,message:"Response has no error or result for request"});if(!r)throw new h({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[i,o,a]=await v._runAllMiddleware(e,t,this._middleware);return o?(await v._runReturnHandlers(a),n(i)):r(async e=>{try{await v._runReturnHandlers(a)}catch(t){return e(t)}return e()})}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(t=>{this._handle(e,(e,r)=>{t(r)})})}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const e=new h({code:-32603,message:"request must be plain object"});return t(e,{id:void 0,jsonrpc:"2.0",error:e})}if("string"!=typeof e.method){const r=new h({code:-32603,message:"method must be string"});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e),n={id:r.id,jsonrpc:r.jsonrpc};let o=null;try{await this._processRequest(r,n)}catch(e){o=e}return o&&(delete n.result,n.error||(n.error=Object(f.serializeError)(o))),t(o,n)}async _processRequest(e,t){const[r,n,i]=await v._runAllMiddleware(e,t,this._middleware);if(v._checkForCompletion(e,t,n),await v._runReturnHandlers(i),r)throw r}}function g(e){const t=new v;return e.forEach(e=>t.push(e)),t.asMiddleware()}o.Duplex;Symbol("IGNORE_SUBSTREAM");o.Duplex},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,f=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?f=u.concat(f):d=-1,f.length&&l())}function l(){if(!c){var e=s(h);c=!0;for(var t=f.length;t;){for(u=f,f=[];++d<t;)u&&u[d].run();d=-1,t=f.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function b(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new p(e,t)),1!==f.length||c||s(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(190);e.exports={BroadcastChannel:n.BroadcastChannel,createLeaderElection:n.createLeaderElection,clearNodeFolder:n.clearNodeFolder,enforceOptions:n.enforceOptions,beLeader:n.beLeader}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=t,i=r(15),o=r(21),a=r(85);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,f=t.andln(3)+o&3;3===u&&(u=-1),3===f&&(f=-1),a=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==f?u:-u,r[0].push(a),s=0==(1&f)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?f:-f,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,i(r(81),t),i(r(82),t),i(r(187),t),i(r(54),t),i(r(188),t),i(r(22),t),i(r(189),t),i(r(17),t),i(r(58),t);var o=r(28);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},function(e,t,r){
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  var n=r(3),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(135).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function f(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var f=e.charCodeAt(u)-48;o*=i,a=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-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(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+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(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=f(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=f(e,c,e.length,t),c=0;c<a;c++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)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},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){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"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],c=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var b=d.modrn(c).toString(e);r=(d=d.idivn(c)).isZero()?b+r:h[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function b(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var c=u>>>26,d=67108863&u,h=Math.min(f,t.length-1),l=Math.max(0,f-e.length+1);l<=h;l++){var p=f-l|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[l])+d)/67108864|0,d=67108863&a}r.words[f]=0|d,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).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(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;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(e){return this.clone().isub(e)};var v=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,f=0,c=0|a[0],d=8191&c,h=c>>>13,l=0|a[1],p=8191&l,b=l>>>13,v=0|a[2],g=8191&v,y=v>>>13,m=0|a[3],_=8191&m,w=m>>>13,S=0|a[4],E=8191&S,M=S>>>13,A=0|a[5],O=8191&A,x=A>>>13,P=0|a[6],R=8191&P,T=P>>>13,k=0|a[7],I=8191&k,C=k>>>13,L=0|a[8],j=8191&L,N=L>>>13,B=0|a[9],D=8191&B,z=B>>>13,U=0|s[0],F=8191&U,q=U>>>13,W=0|s[1],H=8191&W,K=W>>>13,V=0|s[2],G=8191&V,Y=V>>>13,J=0|s[3],Z=8191&J,$=J>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],de=8191&ce,he=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(f+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,q))+Math.imul(h,F)|0))<<13)|0;f=((o=Math.imul(h,q))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,q))+Math.imul(b,F)|0,o=Math.imul(b,q);var ge=(f+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(h,H)|0))<<13)|0;f=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,q))+Math.imul(y,F)|0,o=Math.imul(y,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0;var ye=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(h,G)|0))<<13)|0;f=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(_,F),i=(i=Math.imul(_,q))+Math.imul(w,F)|0,o=Math.imul(w,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Y)|0;var me=(f+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(h,Z)|0))<<13)|0;f=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,q))+Math.imul(M,F)|0,o=Math.imul(M,q),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0;var _e=(f+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;f=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,q))+Math.imul(x,F)|0,o=Math.imul(x,q),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;f=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,q))+Math.imul(T,F)|0,o=Math.imul(T,q),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(f+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;f=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(I,F),i=(i=Math.imul(I,q))+Math.imul(C,F)|0,o=Math.imul(C,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ee=(f+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(h,ue)|0))<<13)|0;f=((o=o+Math.imul(h,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,q))+Math.imul(N,F)|0,o=Math.imul(N,q),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,fe)|0;var Me=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;f=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,q))+Math.imul(z,F)|0,o=Math.imul(z,q),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,fe)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ae=(f+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(h,pe)|0))<<13)|0;f=((o=o+Math.imul(h,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,K))+Math.imul(z,H)|0,o=Math.imul(z,K),n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,fe)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Oe=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;f=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(z,G)|0,o=Math.imul(z,Y),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,fe)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(f+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(y,pe)|0))<<13)|0;f=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,$))+Math.imul(z,Z)|0,o=Math.imul(z,$),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,fe)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,he)|0;var Pe=(f+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(w,pe)|0))<<13)|0;f=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,fe)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Re=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(M,pe)|0))<<13)|0;f=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,fe)|0,n=n+Math.imul(R,de)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,he)|0;var Te=(f+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(x,pe)|0))<<13)|0;f=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(z,oe)|0,o=Math.imul(z,ae),n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,fe)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,he)|0;var ke=(f+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(T,pe)|0))<<13)|0;f=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,fe))+Math.imul(z,ue)|0,o=Math.imul(z,fe),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Ie=(f+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(C,pe)|0))<<13)|0;f=((o=o+Math.imul(C,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,de),i=(i=Math.imul(D,he))+Math.imul(z,de)|0,o=Math.imul(z,he);var Ce=(f+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(N,pe)|0))<<13)|0;f=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var Le=(f+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(z,pe)|0))<<13)|0;return f=((o=Math.imul(z,be))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=ve,u[1]=ge,u[2]=ye,u[3]=me,u[4]=_e,u[5]=we,u[6]=Se,u[7]=Ee,u[8]=Me,u[9]=Ae,u[10]=Oe,u[11]=xe,u[12]=Pe,u[13]=Re,u[14]=Te,u[15]=ke,u[16]=Ie,u[17]=Ce,u[18]=Le,0!==f&&(u[19]=f,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),f=Math.max(0,o-e.length+1);f<=u;f++){var c=o-f,d=(0|e.words[c])*(0|t.words[f]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(v=b),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):r<63?b(this,e,t):r<1024?g(this,e,t):y(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var d=u,h=f,l=0;l<a;l++){var p=r[c+l],b=n[c+l],v=r[c+l+a],g=n[c+l+a],y=d*v-h*g;g=d*g+h*v,v=y,r[c+l]=p+v,n[c+l]=b+g,r[c+l+a]=p-v,n[c+l+a]=b-g,l!==s&&(y=u*d-f*h,h=u*h+f*d,d=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),d=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,f,n),this.transform(a,o,s,u,n,i),this.transform(f,o,c,d,n,i);for(var l=0;l<n;l++){var p=s[l]*c[l]-u[l]*d[l];u[l]=s[l]*d[l]+u[l]*c[l],s[l]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var f=0;f<a;f++)u.words[f]=this.words[f];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var d=0|this.words[f];this.words[f]=c<<26-o|d>>>o,c=d&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),d=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(S,w),S.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(E,w),i(M,w),i(A,w),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new E;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return _[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var d=this.pow(c,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v<p);var g=this.pow(d,new o(1).iushln(p-v-1));h=h.redMul(g),d=g.redSqr(),l=l.redMul(d),p=v}return h},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var d=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new x(e)},i(x,O),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(50)(e))},function(e,t,r){"use strict";var n=r(21),i=r(6);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var f;f="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=f>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,f=t;return u+=(f=f+n>>>0)<t?1:0,u+=(f=f+o>>>0)<o?1:0,e+r+i+a+(u+=(f=f+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,f){var c=0,d=t;return c+=(d=d+n>>>0)<t?1:0,c+=(d=d+o>>>0)<o?1:0,c+=(d=d+s>>>0)<s?1:0,e+r+i+a+u+(c+=(d=d+f>>>0)<f?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,f){return t+n+o+s+f>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var s=a(r(15));t.BN=s.default;var u=o(r(136));t.rlp=u},function(e,t,r){(t=e.exports=r(64)).Stream=t,t.Readable=t,t.Writable=r(69),t.Duplex=r(27),t.Transform=r(70),t.PassThrough=r(123),t.finished=r(47),t.pipeline=r(124)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const n=r(48);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const i=r(71);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});const o=r(132);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const a=r(49);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})},function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,f="[BigNumber Error] ",c=f+"Number primitive has more than 15 significant digits: ",d=1e14,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],l=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==f,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>f^r?1:-1;for(s=(u=i.length)<(f=o.length)?u:f,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==f?0:u>f^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(f+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return p(e.e/14)==t&&e.c[t]%2!=0}function m(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,w,S,E,M,A,O=U.prototype={constructor:U,toString:null,valueOf:null},x=new U(1),P=20,R=4,T=-7,k=21,I=-1e7,C=1e7,L=!1,j=1,N=0,B={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},D="0123456789abcdefghijklmnopqrstuvwxyz",z=!0;function U(e,t){var r,o,s,f,d,h,l,p,b=this;if(!(b instanceof U))return new U(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>C?b.c=b.e=null:e.e<I?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(f=0,d=e;d>=10;d/=10,f++);return void(f>C?b.c=b.e=null:(b.e=f,b.c=[e]))}p=String(e)}else{if(!a.test(p=String(e)))return i(b,p,h);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(f=p.indexOf("."))>-1&&(p=p.replace(".","")),(d=p.search(/e/i))>0?(f<0&&(f=d),f+=+p.slice(d+1),p=p.substring(0,d)):f<0&&(f=p.length)}else{if(g(t,2,D.length,"Base"),10==t&&z)return H(b=new U(e),P+b.e+1,R);if(p=String(e),h="number"==typeof e){if(0*e!=0)return i(b,p,h,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,U.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=D.slice(0,t),f=d=0,l=p.length;d<l;d++)if(r.indexOf(o=p.charAt(d))<0){if("."==o){if(d>f){f=l;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,d=-1,f=0;continue}return i(b,String(e),h,t)}h=!1,(f=(p=n(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):f=p.length}for(d=0;48===p.charCodeAt(d);d++);for(l=p.length;48===p.charCodeAt(--l););if(p=p.slice(d,++l)){if(l-=d,h&&U.DEBUG&&l>15&&(e>9007199254740991||e!==u(e)))throw Error(c+b.s*e);if((f=f-d-1)>C)b.c=b.e=null;else if(f<I)b.c=[b.e=0];else{if(b.e=f,b.c=[],d=(f+1)%14,f<0&&(d+=14),d<l){for(d&&b.c.push(+p.slice(0,d)),l-=14;d<l;)b.c.push(+p.slice(d,d+=14));d=14-(p=p.slice(d)).length}else d-=l;for(;d--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function F(e,t,r,n){var i,o,a,s,u;if(null==r?r=R:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=b(e.c),u=1==n||2==n&&(a<=T||a>=k)?m(u,a):_(u,a,"0");else if(o=(e=H(new U(e),t,r)).e,s=(u=b(e.c)).length,1==n||2==n&&(t<=o||o<=T)){for(;s<t;u+="0",s++);u=m(u,o)}else if(t-=a,u=_(u,o,"0"),o+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function q(e,t){for(var r,n=1,i=new U(e[0]);n<e.length;n++){if(!(r=new U(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>C?e.c=e.e=null:r<I?e.c=[e.e=0]:(e.e=r,e.c=t),e}function H(e,t,r,n){var i,o,a,f,c,l,p,b=e.c,v=h;if(b){e:{for(i=1,f=b[0];f>=10;f/=10,i++);if((o=t-i)<0)o+=14,a=t,p=(c=b[l=0])/v[i-a-1]%10|0;else if((l=s((o+1)/14))>=b.length){if(!n)break e;for(;b.length<=l;b.push(0));c=p=0,i=1,a=(o%=14)-14+1}else{for(c=f=b[l],i=1;f>=10;f/=10,i++);p=(a=(o%=14)-14+i)<0?0:c/v[i-a-1]%10|0}if(n=n||t<0||null!=b[l+1]||(a<0?c:c%v[i-a-1]),n=r<4?(p||n)&&(0==r||r==(e.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(o>0?a>0?c/v[i-a]:0:b[l-1])%10&1||r==(e.s<0?8:7)),t<1||!b[0])return b.length=0,n?(t-=e.e+1,b[0]=v[(14-t%14)%14],e.e=-t||0):b[0]=e.e=0,e;if(0==o?(b.length=l,f=1,l--):(b.length=l+1,f=v[14-o],b[l]=a>0?u(c/v[i-a]%v[a])*f:0),n)for(;;){if(0==l){for(o=1,a=b[0];a>=10;a/=10,o++);for(a=b[0]+=f,f=1;a>=10;a/=10,f++);o!=f&&(e.e++,b[0]==d&&(b[0]=1));break}if(b[l]+=f,b[l]!=d)break;b[l--]=0,f=1}for(o=b.length;0===b[--o];b.pop());}e.e>C?e.c=e.e=null:e.e<I&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=T||r>=k?m(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return U.clone=e,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(f+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,l,t),P=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-l,0,t),g(r[1],0,l,t),T=r[0],k=r[1]):(g(r,-l,l,t),T=-(k=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-l,-1,t),g(r[1],1,l,t),I=r[0],C=r[1];else{if(g(r,-l,l,t),!r)throw Error(f+t+" cannot be zero: "+r);I=-(C=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(f+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!r,Error(f+"crypto unavailable");L=r}else L=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,l,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(f+t+" not an object: "+r);B=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(f+t+" invalid: "+r);z="0123456789"==r.slice(0,10),D=r}}return{DECIMAL_PLACES:P,ROUNDING_MODE:R,EXPONENTIAL_AT:[T,k],RANGE:[I,C],CRYPTO:L,MODULO_MODE:j,POW_PRECISION:N,FORMAT:B,ALPHABET:D}},U.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!U.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-l&&i<=l&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=d||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+e)},U.maximum=U.max=function(){return q(arguments,O.lt)},U.minimum=U.min=function(){return q(arguments,O.gt)},U.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,c=0,d=[],p=new U(x);if(null==e?e=P:g(e,0,l),i=s(e/14),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(a=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(d.push(a%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw L=!1,Error(f+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c<i;)(a=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(d.push(a%1e14),c+=7);c=i/7}if(!L)for(;c<i;)(a=o())<9e15&&(d[c++]=a%1e14);for(e%=14,(i=d[--c])&&e&&(a=h[14-e],d[c]=u(i/a)*a);0===d[c];d.pop(),c--);if(c<0)d=[n=0];else{for(n=-1;0===d[0];d.splice(0,1),n-=14);for(c=1,a=d[0];a>=10;a/=10,c++);c<14&&(n-=14-c)}return p.e=n,p.c=d,p}),U.sum=function(){for(var e=1,t=arguments,r=new U(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var s,u,f,c,d,h,l,p,v=t.indexOf("."),g=P,y=R;for(v>=0&&(c=N,N=0,t=t.replace(".",""),h=(p=new U(n)).pow(t.length-v),N=c,p.c=e(_(b(h.c),h.e,"0"),10,i,"0123456789"),p.e=p.c.length),f=c=(l=e(t,n,i,a?(s=D,"0123456789"):(s="0123456789",D))).length;0==l[--c];l.pop());if(!l[0])return s.charAt(0);if(v<0?--f:(h.c=l,h.e=f,h.s=o,l=(h=r(h,p,g,y,i)).c,d=h.r,f=h.e),v=l[u=f+g+1],c=i/2,d=d||u<0||null!=l[u+1],d=y<4?(null!=v||d)&&(0==y||y==(h.s<0?3:2)):v>c||v==c&&(4==y||d||6==y&&1&l[u-1]||y==(h.s<0?8:7)),u<1||!l[0])t=d?_(s.charAt(1),-g,s.charAt(0)):s.charAt(0);else{if(l.length=u,d)for(--i;++l[--u]>i;)l[u]=0,u||(++f,l=[1].concat(l));for(c=l.length;!l[--c];);for(v=0,t="";v<=c;t+=s.charAt(l[v++]));t=_(t,f,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,u=e.length,f=t%1e7,c=t/1e7|0;for(e=e.slice();u--;)s=((i=f*(o=e[u]%1e7)+(n=c*o+(a=e[u]/1e7|0)*f)%1e7*1e7+s)/r|0)+(n/1e7|0)+c*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var f,c,h,l,b,v,g,y,m,_,w,S,E,M,A,O,x,P=n.s==i.s?1:-1,R=n.c,T=i.c;if(!(R&&R[0]&&T&&T[0]))return new U(n.s&&i.s&&(R?!T||R[0]!=T[0]:T)?R&&0==R[0]||!T?0*P:P/0:NaN);for(m=(y=new U(P)).c=[],P=o+(c=n.e-i.e)+1,s||(s=d,c=p(n.e/14)-p(i.e/14),P=P/14|0),h=0;T[h]==(R[h]||0);h++);if(T[h]>(R[h]||0)&&c--,P<0)m.push(1),l=!0;else{for(M=R.length,O=T.length,h=0,P+=2,(b=u(s/(T[0]+1)))>1&&(T=e(T,b,s),R=e(R,b,s),O=T.length,M=R.length),E=O,w=(_=R.slice(0,O)).length;w<O;_[w++]=0);x=T.slice(),x=[0].concat(x),A=T[0],T[1]>=s/2&&A++;do{if(b=0,(f=t(T,_,O,w))<0){if(S=_[0],O!=w&&(S=S*s+(_[1]||0)),(b=u(S/A))>1)for(b>=s&&(b=s-1),g=(v=e(T,b,s)).length,w=_.length;1==t(v,_,g,w);)b--,r(v,O<g?x:T,g,s),g=v.length,f=1;else 0==b&&(f=b=1),g=(v=T.slice()).length;if(g<w&&(v=[0].concat(v)),r(_,v,w,s),w=_.length,-1==f)for(;t(T,_,O,w)<1;)b++,r(_,O<w?x:T,w,s),w=_.length}else 0===f&&(b++,_=[0]);m[h++]=b,_[0]?_[w++]=R[E]||0:(_=[R[E]],w=1)}while((E++<M||null!=_[0])&&P--);l=null!=_[0],m[0]||m.splice(0,1)}if(s==d){for(h=1,P=m[0];P>=10;P/=10,h++);H(y,o+(y.e=h+14*c-1)+1,a,l)}else y.e=c,y.r=+l;return y}}(),w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,E=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(A,"");if(M.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(w,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(S,"$1").replace(E,"0.$1")),t!=o))return new U(o,i);if(U.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},O.absoluteValue=O.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},O.comparedTo=function(e,t){return v(this,new U(e,t))},O.decimalPlaces=O.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,l),null==t?t=R:g(t,0,8),H(new U(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},O.dividedBy=O.div=function(e,t){return r(this,new U(e,t),P,R)},O.dividedToIntegerBy=O.idiv=function(e,t){return r(this,new U(e,t),0,1)},O.exponentiatedBy=O.pow=function(e,t){var r,n,i,o,a,c,d,h,l=this;if((e=new U(e)).c&&!e.isInteger())throw Error(f+"Exponent not an integer: "+K(e));if(null!=t&&(t=new U(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return h=new U(Math.pow(+K(l),a?2-y(e):+K(e))),t?h.mod(t):h;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new U(NaN);(n=!c&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&y(e)?-0:0,l.e>-1&&(o=1/o),new U(c?1/o:o);N&&(o=s(N/14+2))}for(a?(r=new U(.5),c&&(e.s=1),d=y(e)):d=(i=Math.abs(+K(e)))%2,h=new U(x);;){if(d){if(!(h=h.times(l)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;d=i%2}else if(H(e=e.times(r),e.e+1,1),e.e>14)d=y(e);else{if(0===(i=+K(e)))break;d=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?h:(c&&(h=x.div(h)),t?h.mod(t):o?H(h,N,R,void 0):h)},O.integerValue=function(e){var t=new U(this);return null==e?e=R:g(e,0,8),H(t,t.e+1,e)},O.isEqualTo=O.eq=function(e,t){return 0===v(this,new U(e,t))},O.isFinite=function(){return!!this.c},O.isGreaterThan=O.gt=function(e,t){return v(this,new U(e,t))>0},O.isGreaterThanOrEqualTo=O.gte=function(e,t){return 1===(t=v(this,new U(e,t)))||0===t},O.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},O.isLessThan=O.lt=function(e,t){return v(this,new U(e,t))<0},O.isLessThanOrEqualTo=O.lte=function(e,t){return-1===(t=v(this,new U(e,t)))||0===t},O.isNaN=function(){return!this.s},O.isNegative=function(){return this.s<0},O.isPositive=function(){return this.s>0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new U(e,t)).s,!s||!t)return new U(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/14,f=e.e/14,c=a.c,h=e.c;if(!u||!f){if(!c||!h)return c?(e.s=-t,e):new U(h?a:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new U(c[0]?a:3==R?-0:0)}if(u=p(u),f=p(f),c=c.slice(),s=u-f){for((o=s<0)?(s=-s,i=c):(f=u,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=c.length)<(t=h.length))?s:t,s=t=0;t<n;t++)if(c[t]!=h[t]){o=c[t]<h[t];break}if(o&&(i=c,c=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=c.length))>0)for(;t--;c[r++]=0);for(t=d-1;n>s;){if(c[--n]<h[n]){for(r=n;r&&!c[--r];c[r]=t);--c[r],c[n]+=d}c[n]-=h[n]}for(;0==c[0];c.splice(0,1),--f);return c[0]?W(e,c,f):(e.s=3==R?-1:1,e.c=[e.e=0],e)},O.modulo=O.mod=function(e,t){var n,i,o=this;return e=new U(e,t),!o.c||!e.s||e.c&&!e.c[0]?new U(NaN):!e.c||o.c&&!o.c[0]?new U(o):(9==j?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,j),(e=o.minus(n.times(e))).c[0]||1!=j||(e.s=o.s),e)},O.multipliedBy=O.times=function(e,t){var r,n,i,o,a,s,u,f,c,h,l,b,v,g,y=this,m=y.c,_=(e=new U(e,t)).c;if(!(m&&_&&m[0]&&_[0]))return!y.s||!e.s||m&&!m[0]&&!_||_&&!_[0]&&!m?e.c=e.e=e.s=null:(e.s*=y.s,m&&_?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(y.e/14)+p(e.e/14),e.s*=y.s,(u=m.length)<(h=_.length)&&(v=m,m=_,_=v,i=u,u=h,h=i),i=u+h,v=[];i--;v.push(0));for(g=d,1e7,i=h;--i>=0;){for(r=0,l=_[i]%1e7,b=_[i]/1e7|0,o=i+(a=u);o>i;)r=((f=l*(f=m[--a]%1e7)+(s=b*f+(c=m[a]/1e7|0)*l)%1e7*1e7+v[o]+r)/g|0)+(s/1e7|0)+b*c,v[o--]=f%g;v[o]=r}return r?++n:v.splice(0,1),W(e,v,n)},O.negated=function(){var e=new U(this);return e.s=-e.s||null,e},O.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new U(e,t)).s,!i||!t)return new U(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,a=e.e/14,s=n.c,u=e.c;if(!o||!a){if(!s||!u)return new U(i/0);if(!s[0]||!u[0])return u[0]?e:new U(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/d|0,s[t]=d===s[t]?0:s[t]%d;return i&&(s=[i].concat(s),++a),W(e,s,a)},O.precision=O.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,l),null==t?t=R:g(t,0,8),H(new U(o),e,t);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},O.shiftedBy=function(e){return g(e,-9007199254740991,9007199254740991),this.times("1e"+e)},O.squareRoot=O.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,f=a.e,c=P+4,d=new U("0.5");if(1!==u||!s||!s[0])return new U(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+K(a)))||u==1/0?(((t=b(s)).length+f)%2==0&&(t+="0"),u=Math.sqrt(+t),f=p((f+1)/2)-(f<0||f%2),n=new U(t=u==1/0?"5e"+f:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+f)):n=new U(u+""),n.c[0])for((u=(f=n.e)+c)<3&&(u=0);;)if(o=n,n=d.times(o.plus(r(a,o,c,1))),b(o.c).slice(0,u)===(t=b(n.c)).slice(0,u)){if(n.e<f&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+P+2,1),e=!n.times(n).eq(a));break}if(!i&&(H(o,o.e+P+2,0),o.times(o).eq(a))){n=o;break}c+=4,u+=4,i=1}return H(n,n.e+P+1,R,e)},O.toExponential=function(e,t){return null!=e&&(g(e,0,l),e++),F(this,e,t,1)},O.toFixed=function(e,t){return null!=e&&(g(e,0,l),e=e+this.e+1),F(this,e,t)},O.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=B;else if("object"!=typeof r)throw Error(f+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",d=a[0],h=a[1],l=i.s<0,p=l?d.slice(1):d,b=p.length;if(u&&(o=s,s=u,u=o,b-=o),s>0&&b>0){for(o=b%s||s,d=p.substr(0,o);o<b;o+=s)d+=c+p.substr(o,s);u>0&&(d+=c+p.slice(o)),l&&(d="-"+d)}n=h?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):d}return(r.prefix||"")+n+(r.suffix||"")},O.toFraction=function(e){var t,n,i,o,a,s,u,c,d,l,p,v,g=this,y=g.c;if(null!=e&&(!(u=new U(e)).isInteger()&&(u.c||1!==u.s)||u.lt(x)))throw Error(f+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+K(u));if(!y)return new U(g);for(t=new U(x),d=n=new U(x),i=c=new U(x),v=b(y),a=t.e=v.length-g.e-1,t.c[0]=h[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:d:u,s=C,C=1/0,u=new U(v),c.c[0]=0;l=r(u,t,0,1),1!=(o=n.plus(l.times(i))).comparedTo(e);)n=i,i=o,d=c.plus(l.times(o=d)),c=o,t=u.minus(l.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(d)),n=n.plus(o.times(i)),c.s=d.s=g.s,p=r(d,i,a*=2,R).minus(g).abs().comparedTo(r(c,n,a,R).minus(g).abs())<1?[d,i]:[c,n],C=s,p},O.toNumber=function(){return+K(this)},O.toPrecision=function(e,t){return null!=e&&g(e,1,l),F(this,e,t,2)},O.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=T||o>=k?m(b(r.c),o):_(b(r.c),o,"0"):10===e&&z?t=_(b((r=H(new U(r),P+o+1,R)).c),r.e,"0"):(g(e,2,D.length,"Base"),t=n(_(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},O.valueOf=O.toJSON=function(){return K(this)},O._isBigNumber=!0,null!=t&&U.set(t),U}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var o=r(17),a=r(28),s=r(38);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,a.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var u=function(e,r,n){var i=(0,t.zeros)(r);return n?e.length<r?(e.copy(i),i):e.slice(0,r):e.length<r?(e.copy(i,r-e.length),i):e.slice(-r)};t.setLengthLeft=function(e,t){return(0,s.assertIsBuffer)(e),u(e,t,!1)};t.setLengthRight=function(e,t){return(0,s.assertIsBuffer)(e),u(e,t,!0)};var f=function(e){for(var t=e[0];e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),f(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),f(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,a.stripHexPrefix)(e),f(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,a.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,a.padToEven)((0,a.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(o.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new o.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,a.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,a.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],i=0;i<r.length;i++)n.push((0,t.baToJSON)(r[i]));return n}};t.validateNoLeadingZeroes=function(e){var t,r;try{for(var o=n(Object.entries(e)),a=o.next();!a.done;a=o.next()){var s=i(a.value,2),u=s[0],f=s[1];if(void 0!==f&&f.length>0&&0===f[0])throw new Error("".concat(u," cannot have leading zeroes, received: ").concat(f.toString("hex")))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";var n=r(39),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=Object.create(r(34));o.inherits=r(30);var a=r(94),s=r(57);o.inherits(d,a);for(var u=i(s.prototype),f=0;f<u.length;f++){var c=u[f];d.prototype[c]||(d.prototype[c]=s.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=t.PROMISE_RESOLVED_VOID=t.PROMISE_RESOLVED_TRUE=t.PROMISE_RESOLVED_FALSE=void 0,t.isPromise=function(e){return!(!e||"function"!=typeof e.then)},t.microSeconds=function(){var e=(new Date).getTime();return e===o?(a++,1e3*e+a):(o=e,a=0,1e3*e)},t.randomInt=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},t.randomToken=function(){return Math.random().toString(36).substring(2)},t.sleep=function(e,t){e||(e=0);return new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))};var r=Promise.resolve(!1);t.PROMISE_RESOLVED_FALSE=r;var n=Promise.resolve(!0);t.PROMISE_RESOLVED_TRUE=n;var i=Promise.resolve();t.PROMISE_RESOLVED_VOID=i;var o=0,a=0;var s="[object process]"===Object.prototype.toString.call(void 0!==e?e:0);t.isNode=s}).call(this,r(9))},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function f(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,a,s;if(f(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):v(i,i.length)}function b(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var f=u.length,c=v(u,f);for(r=0;r<f;++r)o(c[r],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return f(t),this.on(e,l(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return f(t),this.prependListener(e,l(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(f(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(64),o=r(69);r(6)(f,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];f.prototype[u]||(f.prototype[u]=o.prototype[u])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||t.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(9))},function(e,t,r){"use strict";(function(e){function r(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=r;function n(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return r(e)?e.slice(2):e},t.padToEven=n,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof t));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t},t.fromUtf8=function(t){var r=e.from(t,"utf8");return"0x".concat(n(r.toString("hex")).replace(/^0+|0+$/g,""))},t.fromAscii=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0".concat(n):n}return"0x".concat(t)},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof e));if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof e));for(var n=[],i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received ".concat(typeof o));n.push(o)}return n},t.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}}).call(this,r(3).Buffer)},function(e,t,r){var n=r(14).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,f=Math.min(o-s,i-u),c=0;c<f;c++)r[u+c]=e[s+c];s+=f,(a+=f)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";(function(e){r.d(t,"l",(function(){return o})),r.d(t,"n",(function(){return a})),r.d(t,"m",(function(){return s})),r.d(t,"d",(function(){return u})),r.d(t,"q",(function(){return f})),r.d(t,"f",(function(){return c})),r.d(t,"b",(function(){return d})),r.d(t,"p",(function(){return h})),r.d(t,"e",(function(){return l})),r.d(t,"g",(function(){return p})),r.d(t,"r",(function(){return b})),r.d(t,"k",(function(){return v})),r.d(t,"o",(function(){return g})),r.d(t,"i",(function(){return y})),r.d(t,"c",(function(){return m})),r.d(t,"h",(function(){return _})),r.d(t,"a",(function(){return w})),r.d(t,"j",(function(){return S}));var n=r(20),i=r(13);function o(e){const t=e.toString(16);return"0x".concat(t)}const a=()=>Math.random().toString(36).slice(2);function s(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error("Expected an unprefixed hex string. Received: ".concat(e));if(t<0)throw new Error("Expected a non-negative integer target length. Received: ".concat(t));return String.prototype.padStart.call(e,t,"0")}function u(e,t,r){const n=Object(i.fromSigned)(t),a=Object(i.fromSigned)(r),u=Object(i.bufferToInt)(e),f=s(Object(i.toUnsigned)(n).toString("hex"),64),c=s(Object(i.toUnsigned)(a).toString("hex"),64),d=Object(i.stripHexPrefix)(o(u));return Object(i.addHexPrefix)(f.concat(c,d))}function f(e){return new Promise(t=>{const r=window.setTimeout(()=>{t(),window.clearTimeout(r)},e)})}const c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=n.BigNumber.isBigNumber(e)?e.toNumber():e;if(!Number.isFinite(i))return"";const o="usd"===t.toLowerCase()?parseFloat(Number(i).toFixed(2)):parseFloat(Number(i).toFixed(5)),a=o>0?"~ ":"";return"".concat("usd"===t.toLowerCase()||r?"":a).concat(Number(o)," ").concat(t.toUpperCase())},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return e.length<11?e:"string"!=typeof e?"":"".concat(e.slice(0,t),"...").concat(e.slice(-t))},h=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,o=n.BigNumber.isBigNumber(e)?e:new n.BigNumber(e);if(o.isZero())return o;r&&(o=o.times(new n.BigNumber(100))),t=o.gte(new n.BigNumber(1))?i:i-1+Math.ceil(Math.log10(new n.BigNumber("1").div(o).toNumber()));const a=new n.BigNumber(10).pow(new n.BigNumber(t)),s=Math.round(a.times(o).toNumber())/a.toNumber();return s},l=e=>{const t=new Date(e),r=t.getDate(),n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],i=t.getFullYear();return"".concat(r," ").concat(n," ").concat(i)},p=e=>new Date(e).toTimeString().slice(0,8),b=(e,t)=>void 0!==e.chainId&&e.chainId===t,v=t=>{const r=e.from(t,"utf8");return Object(i.hashPersonalMessage)(r)},g=(t,r)=>{const n=e.from(t,"hex"),o=Object(i.stripHexPrefix)(r),a=Object(i.ecsign)(e.from(o,"hex"),n);return u(Object(i.intToBuffer)(a.v),a.r,a.s)};function y(e){let{width:t,height:r}=e;const n=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,o=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,s=Math.abs((o-t)/2/1+n),u=Math.abs((a-r)/2/1+i);return"titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=".concat(r/1,",width=").concat(t/1,",top=").concat(u,",left=").concat(s)}const m={webWorkerSupport:!1};function _(){var e;if(null!==(e=navigator)&&void 0!==e&&e.brave)return{browser:"Brave"}}class w extends Error{}const S=(e,t)=>{const r={};new URL("".concat(window.location.origin,"/?").concat(e.slice(1))).searchParams.forEach((e,t)=>{r[t]=e});let n={},i="";return t.windowId||(Object.keys(r).length>0&&r.state?(n=JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(r.state))))||{},i=r.error_description||r.error||i):Object.keys(t).length>0&&t.state&&(n=JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(t.state))))||{},t.error&&(i=t.error))),{error:i,instanceParameters:n,hashParameters:r}}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";var n=r(120).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(16),i=r(21);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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(3).Buffer.isBuffer},function(e,t,r){(function(e,n){var i;
  /**
   * @license
   * Lodash <https://lodash.com/>
   * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   */(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",f="[object Array]",c="[object Boolean]",d="[object Date]",h="[object Error]",l="[object Function]",p="[object GeneratorFunction]",b="[object Map]",v="[object Number]",g="[object Object]",y="[object RegExp]",m="[object Set]",_="[object String]",w="[object Symbol]",S="[object WeakMap]",E="[object ArrayBuffer]",M="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",R="[object Int32Array]",T="[object Uint8Array]",k="[object Uint16Array]",I="[object Uint32Array]",C=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,D=RegExp(N.source),z=RegExp(B.source),U=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,J=/\s/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,re=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,fe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,de=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",le="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",be="["+le+"]",ve="["+he+"]",ge="\\d+",ye="[\\u2700-\\u27bf]",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+le+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Me="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Oe="(?:"+me+"|"+_e+")",xe="(?:"+Ae+"|"+_e+")",Pe="(?:"+ve+"|"+we+")"+"?",Re="[\\ufe0e\\ufe0f]?"+Pe+("(?:\\u200d(?:"+[Se,Ee,Me].join("|")+")[\\ufe0e\\ufe0f]?"+Pe+")*"),Te="(?:"+[ye,Ee,Me].join("|")+")"+Re,ke="(?:"+[Se+ve+"?",ve,Ee,Me,pe].join("|")+")",Ie=RegExp("['’]","g"),Ce=RegExp(ve,"g"),Le=RegExp(we+"(?="+we+")|"+ke+Re,"g"),je=RegExp([Ae+"?"+me+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[be,Ae,"$"].join("|")+")",xe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[be,Ae+Oe,"$"].join("|")+")",Ae+"?"+Oe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Te].join("|"),"g"),Ne=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Be=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,De=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ze=-1,Ue={};Ue[A]=Ue[O]=Ue[x]=Ue[P]=Ue[R]=Ue[T]=Ue["[object Uint8ClampedArray]"]=Ue[k]=Ue[I]=!0,Ue[u]=Ue[f]=Ue[E]=Ue[c]=Ue[M]=Ue[d]=Ue[h]=Ue[l]=Ue[b]=Ue[v]=Ue[g]=Ue[y]=Ue[m]=Ue[_]=Ue[S]=!1;var Fe={};Fe[u]=Fe[f]=Fe[E]=Fe[M]=Fe[c]=Fe[d]=Fe[A]=Fe[O]=Fe[x]=Fe[P]=Fe[R]=Fe[b]=Fe[v]=Fe[g]=Fe[y]=Fe[m]=Fe[_]=Fe[w]=Fe[T]=Fe["[object Uint8ClampedArray]"]=Fe[k]=Fe[I]=!0,Fe[h]=Fe[l]=Fe[S]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},We=parseFloat,He=parseInt,Ke="object"==typeof e&&e&&e.Object===Object&&e,Ve="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ke||Ve||Function("return this")(),Ye=t&&!t.nodeType&&t,Je=Ye&&"object"==typeof n&&n&&!n.nodeType&&n,Ze=Je&&Je.exports===Ye,$e=Ze&&Ke.process,Xe=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||$e&&$e.binding&&$e.binding("util")}catch(e){}}(),Qe=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,rt=Xe&&Xe.isRegExp,nt=Xe&&Xe.isSet,it=Xe&&Xe.isTypedArray;function ot(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function at(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function st(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function ut(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function ft(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function ct(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function dt(e,t){return!!(null==e?0:e.length)&&wt(e,t,0)>-1}function ht(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function lt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function bt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function vt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function gt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var yt=At("length");function mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function _t(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function wt(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):_t(e,Et,r)}function St(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Et(e){return e!=e}function Mt(e,t){var r=null==e?0:e.length;return r?Pt(e,t)/r:NaN}function At(e){return function(t){return null==t?void 0:t[e]}}function Ot(e){return function(t){return null==e?void 0:e[t]}}function xt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Pt(e,t){for(var r,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(r=void 0===r?o:r+o)}return r}function Rt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Tt(e){return e?e.slice(0,Yt(e)+1).replace(Y,""):e}function kt(e){return function(t){return e(t)}}function It(e,t){return lt(t,(function(t){return e[t]}))}function Ct(e,t){return e.has(t)}function Lt(e,t){for(var r=-1,n=e.length;++r<n&&wt(t,e[r],0)>-1;);return r}function jt(e,t){for(var r=e.length;r--&&wt(t,e[r],0)>-1;);return r}function Nt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Bt=Ot({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Ĳ":"IJ","ĳ":"ij","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"}),Dt=Ot({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function zt(e){return"\\"+qe[e]}function Ut(e){return Ne.test(e)}function Ft(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function qt(e,t){return function(r){return e(t(r))}}function Wt(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==a||(e[r]=a,o[i++]=r)}return o}function Ht(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function Kt(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function Vt(e){return Ut(e)?function(e){var t=Le.lastIndex=0;for(;Le.test(e);)++t;return t}(e):yt(e)}function Gt(e){return Ut(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Yt(e){for(var t=e.length;t--&&J.test(e.charAt(t)););return t}var Jt=Ot({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Zt=function e(t){var r,n=(t=null==t?Ge:Zt.defaults(Ge.Object(),t,Zt.pick(Ge,De))).Array,i=t.Date,J=t.Error,he=t.Function,le=t.Math,pe=t.Object,be=t.RegExp,ve=t.String,ge=t.TypeError,ye=n.prototype,me=he.prototype,_e=pe.prototype,we=t["__core-js_shared__"],Se=me.toString,Ee=_e.hasOwnProperty,Me=0,Ae=(r=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Oe=_e.toString,xe=Se.call(pe),Pe=Ge._,Re=be("^"+Se.call(Ee).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=Ze?t.Buffer:void 0,ke=t.Symbol,Le=t.Uint8Array,Ne=Te?Te.allocUnsafe:void 0,qe=qt(pe.getPrototypeOf,pe),Ke=pe.create,Ve=_e.propertyIsEnumerable,Ye=ye.splice,Je=ke?ke.isConcatSpreadable:void 0,$e=ke?ke.iterator:void 0,Xe=ke?ke.toStringTag:void 0,yt=function(){try{var e=eo(pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ot=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,$t=i&&i.now!==Ge.Date.now&&i.now,Xt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Qt=le.ceil,er=le.floor,tr=pe.getOwnPropertySymbols,rr=Te?Te.isBuffer:void 0,nr=t.isFinite,ir=ye.join,or=qt(pe.keys,pe),ar=le.max,sr=le.min,ur=i.now,fr=t.parseInt,cr=le.random,dr=ye.reverse,hr=eo(t,"DataView"),lr=eo(t,"Map"),pr=eo(t,"Promise"),br=eo(t,"Set"),vr=eo(t,"WeakMap"),gr=eo(pe,"create"),yr=vr&&new vr,mr={},_r=Po(hr),wr=Po(lr),Sr=Po(pr),Er=Po(br),Mr=Po(vr),Ar=ke?ke.prototype:void 0,Or=Ar?Ar.valueOf:void 0,xr=Ar?Ar.toString:void 0;function Pr(e){if(Ka(e)&&!La(e)&&!(e instanceof Ir)){if(e instanceof kr)return e;if(Ee.call(e,"__wrapped__"))return Ro(e)}return new kr(e)}var Rr=function(){function e(){}return function(t){if(!Ha(t))return{};if(Ke)return Ke(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Tr(){}function kr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ir(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Cr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Lr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function jr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Nr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new jr;++t<r;)this.add(e[t])}function Br(e){var t=this.__data__=new Lr(e);this.size=t.size}function Dr(e,t){var r=La(e),n=!r&&Ca(e),i=!r&&!n&&Da(e),o=!r&&!n&&!i&&Qa(e),a=r||n||i||o,s=a?Rt(e.length,ve):[],u=s.length;for(var f in e)!t&&!Ee.call(e,f)||a&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||so(f,u))||s.push(f);return s}function zr(e){var t=e.length;return t?e[Bn(0,t-1)]:void 0}function Ur(e,t){return Ao(yi(e),Jr(t,0,e.length))}function Fr(e){return Ao(yi(e))}function qr(e,t,r){(void 0!==r&&!Ta(e[t],r)||void 0===r&&!(t in e))&&Gr(e,t,r)}function Wr(e,t,r){var n=e[t];Ee.call(e,t)&&Ta(n,r)&&(void 0!==r||t in e)||Gr(e,t,r)}function Hr(e,t){for(var r=e.length;r--;)if(Ta(e[r][0],t))return r;return-1}function Kr(e,t,r,n){return en(e,(function(e,i,o){t(n,e,r(e),o)})),n}function Vr(e,t){return e&&mi(t,ws(t),e)}function Gr(e,t,r){"__proto__"==t&&yt?yt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Yr(e,t){for(var r=-1,i=t.length,o=n(i),a=null==e;++r<i;)o[r]=a?void 0:vs(e,t[r]);return o}function Jr(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}function Zr(e,t,r,n,i,o){var a,s=1&t,f=2&t,h=4&t;if(r&&(a=i?r(e,n,i,o):r(e)),void 0!==a)return a;if(!Ha(e))return e;var S=La(e);if(S){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!s)return yi(e,a)}else{var C=no(e),L=C==l||C==p;if(Da(e))return hi(e,s);if(C==g||C==u||L&&!i){if(a=f||L?{}:oo(e),!s)return f?function(e,t){return mi(e,ro(e),t)}(e,function(e,t){return e&&mi(t,Ss(t),e)}(a,e)):function(e,t){return mi(e,to(e),t)}(e,Vr(a,e))}else{if(!Fe[C])return i?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case E:return li(e);case c:case d:return new n(+e);case M:return function(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case A:case O:case x:case P:case R:case T:case"[object Uint8ClampedArray]":case k:case I:return pi(e,r);case b:return new n;case v:case _:return new n(e);case y:return function(e){var t=new e.constructor(e.source,ne.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return new n;case w:return i=e,Or?pe(Or.call(i)):{}}var i}(e,C,s)}}o||(o=new Br);var j=o.get(e);if(j)return j;o.set(e,a),Za(e)?e.forEach((function(n){a.add(Zr(n,t,r,n,e,o))})):Va(e)&&e.forEach((function(n,i){a.set(i,Zr(n,t,r,i,e,o))}));var N=S?void 0:(h?f?Gi:Vi:f?Ss:ws)(e);return st(N||e,(function(n,i){N&&(n=e[i=n]),Wr(a,i,Zr(n,t,r,i,e,o))})),a}function $r(e,t,r){var n=r.length;if(null==e)return!n;for(e=pe(e);n--;){var i=r[n],o=t[i],a=e[i];if(void 0===a&&!(i in e)||!o(a))return!1}return!0}function Xr(e,t,r){if("function"!=typeof e)throw new ge(o);return wo((function(){e.apply(void 0,r)}),t)}function Qr(e,t,r,n){var i=-1,o=dt,a=!0,s=e.length,u=[],f=t.length;if(!s)return u;r&&(t=lt(t,kt(r))),n?(o=ht,a=!1):t.length>=200&&(o=Ct,a=!1,t=new Nr(t));e:for(;++i<s;){var c=e[i],d=null==r?c:r(c);if(c=n||0!==c?c:0,a&&d==d){for(var h=f;h--;)if(t[h]===d)continue e;u.push(c)}else o(t,d,n)||u.push(c)}return u}Pr.templateSettings={escape:U,evaluate:F,interpolate:q,variable:"",imports:{_:Pr}},Pr.prototype=Tr.prototype,Pr.prototype.constructor=Pr,kr.prototype=Rr(Tr.prototype),kr.prototype.constructor=kr,Ir.prototype=Rr(Tr.prototype),Ir.prototype.constructor=Ir,Cr.prototype.clear=function(){this.__data__=gr?gr(null):{},this.size=0},Cr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Cr.prototype.get=function(e){var t=this.__data__;if(gr){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return Ee.call(t,e)?t[e]:void 0},Cr.prototype.has=function(e){var t=this.__data__;return gr?void 0!==t[e]:Ee.call(t,e)},Cr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=gr&&void 0===t?"__lodash_hash_undefined__":t,this},Lr.prototype.clear=function(){this.__data__=[],this.size=0},Lr.prototype.delete=function(e){var t=this.__data__,r=Hr(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Lr.prototype.get=function(e){var t=this.__data__,r=Hr(t,e);return r<0?void 0:t[r][1]},Lr.prototype.has=function(e){return Hr(this.__data__,e)>-1},Lr.prototype.set=function(e,t){var r=this.__data__,n=Hr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},jr.prototype.clear=function(){this.size=0,this.__data__={hash:new Cr,map:new(lr||Lr),string:new Cr}},jr.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},jr.prototype.get=function(e){return Xi(this,e).get(e)},jr.prototype.has=function(e){return Xi(this,e).has(e)},jr.prototype.set=function(e,t){var r=Xi(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Nr.prototype.add=Nr.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nr.prototype.has=function(e){return this.__data__.has(e)},Br.prototype.clear=function(){this.__data__=new Lr,this.size=0},Br.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Br.prototype.get=function(e){return this.__data__.get(e)},Br.prototype.has=function(e){return this.__data__.has(e)},Br.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Lr){var n=r.__data__;if(!lr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jr(n)}return r.set(e,t),this.size=r.size,this};var en=Si(fn),tn=Si(cn,!0);function rn(e,t){var r=!0;return en(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function nn(e,t,r){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===s?a==a&&!Xa(a):r(a,s)))var s=a,u=o}return u}function on(e,t){var r=[];return en(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function an(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=ao),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?an(s,t-1,r,n,i):pt(i,s):n||(i[i.length]=s)}return i}var sn=Ei(),un=Ei(!0);function fn(e,t){return e&&sn(e,t,ws)}function cn(e,t){return e&&un(e,t,ws)}function dn(e,t){return ct(t,(function(t){return Fa(e[t])}))}function hn(e,t){for(var r=0,n=(t=ui(t,e)).length;null!=e&&r<n;)e=e[xo(t[r++])];return r&&r==n?e:void 0}function ln(e,t,r){var n=t(e);return La(e)?n:pt(n,r(e))}function pn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Xe&&Xe in pe(e)?function(e){var t=Ee.call(e,Xe),r=e[Xe];try{e[Xe]=void 0;var n=!0}catch(e){}var i=Oe.call(e);n&&(t?e[Xe]=r:delete e[Xe]);return i}(e):function(e){return Oe.call(e)}(e)}function bn(e,t){return e>t}function vn(e,t){return null!=e&&Ee.call(e,t)}function gn(e,t){return null!=e&&t in pe(e)}function yn(e,t,r){for(var i=r?ht:dt,o=e[0].length,a=e.length,s=a,u=n(a),f=1/0,c=[];s--;){var d=e[s];s&&t&&(d=lt(d,kt(t))),f=sr(d.length,f),u[s]=!r&&(t||o>=120&&d.length>=120)?new Nr(s&&d):void 0}d=e[0];var h=-1,l=u[0];e:for(;++h<o&&c.length<f;){var p=d[h],b=t?t(p):p;if(p=r||0!==p?p:0,!(l?Ct(l,b):i(c,b,r))){for(s=a;--s;){var v=u[s];if(!(v?Ct(v,b):i(e[s],b,r)))continue e}l&&l.push(b),c.push(p)}}return c}function mn(e,t,r){var n=null==(e=go(e,t=ui(t,e)))?e:e[xo(Uo(t))];return null==n?void 0:ot(n,e,r)}function _n(e){return Ka(e)&&pn(e)==u}function wn(e,t,r,n,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,r,n,i,o){var a=La(e),s=La(t),l=a?f:no(e),p=s?f:no(t),S=(l=l==u?g:l)==g,A=(p=p==u?g:p)==g,O=l==p;if(O&&Da(e)){if(!Da(t))return!1;a=!0,S=!1}if(O&&!S)return o||(o=new Br),a||Qa(e)?Hi(e,t,r,n,i,o):function(e,t,r,n,i,o,a){switch(r){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new Le(e),new Le(t)));case c:case d:case v:return Ta(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case _:return e==t+"";case b:var s=Ft;case m:var u=1&n;if(s||(s=Ht),e.size!=t.size&&!u)return!1;var f=a.get(e);if(f)return f==t;n|=2,a.set(e,t);var l=Hi(s(e),s(t),n,i,o,a);return a.delete(e),l;case w:if(Or)return Or.call(e)==Or.call(t)}return!1}(e,t,l,r,n,i,o);if(!(1&r)){var x=S&&Ee.call(e,"__wrapped__"),P=A&&Ee.call(t,"__wrapped__");if(x||P){var R=x?e.value():e,T=P?t.value():t;return o||(o=new Br),i(R,T,r,n,o)}}if(!O)return!1;return o||(o=new Br),function(e,t,r,n,i,o){var a=1&r,s=Vi(e),u=s.length,f=Vi(t).length;if(u!=f&&!a)return!1;var c=u;for(;c--;){var d=s[c];if(!(a?d in t:Ee.call(t,d)))return!1}var h=o.get(e),l=o.get(t);if(h&&l)return h==t&&l==e;var p=!0;o.set(e,t),o.set(t,e);var b=a;for(;++c<u;){d=s[c];var v=e[d],g=t[d];if(n)var y=a?n(g,v,d,t,e,o):n(v,g,d,e,t,o);if(!(void 0===y?v===g||i(v,g,r,n,o):y)){p=!1;break}b||(b="constructor"==d)}if(p&&!b){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,r,n,i,o)}(e,t,r,n,wn,i))}function Sn(e,t,r,n){var i=r.length,o=i,a=!n;if(null==e)return!o;for(e=pe(e);i--;){var s=r[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var u=(s=r[i])[0],f=e[u],c=s[1];if(a&&s[2]){if(void 0===f&&!(u in e))return!1}else{var d=new Br;if(n)var h=n(f,c,u,e,t,d);if(!(void 0===h?wn(c,f,3,n,d):h))return!1}}return!0}function En(e){return!(!Ha(e)||(t=e,Ae&&Ae in t))&&(Fa(e)?Re:ae).test(Po(e));var t}function Mn(e){return"function"==typeof e?e:null==e?Gs:"object"==typeof e?La(e)?Tn(e[0],e[1]):Rn(e):ru(e)}function An(e){if(!lo(e))return or(e);var t=[];for(var r in pe(e))Ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}function On(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var r in pe(e))t.push(r);return t}(e);var t=lo(e),r=[];for(var n in e)("constructor"!=n||!t&&Ee.call(e,n))&&r.push(n);return r}function xn(e,t){return e<t}function Pn(e,t){var r=-1,i=Na(e)?n(e.length):[];return en(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Rn(e){var t=Qi(e);return 1==t.length&&t[0][2]?bo(t[0][0],t[0][1]):function(r){return r===e||Sn(r,e,t)}}function Tn(e,t){return fo(e)&&po(t)?bo(xo(e),t):function(r){var n=vs(r,e);return void 0===n&&n===t?gs(r,e):wn(t,n,3)}}function kn(e,t,r,n,i){e!==t&&sn(t,(function(o,a){if(i||(i=new Br),Ha(o))!function(e,t,r,n,i,o,a){var s=mo(e,r),u=mo(t,r),f=a.get(u);if(f)return void qr(e,r,f);var c=o?o(s,u,r+"",e,t,a):void 0,d=void 0===c;if(d){var h=La(u),l=!h&&Da(u),p=!h&&!l&&Qa(u);c=u,h||l||p?La(s)?c=s:Ba(s)?c=yi(s):l?(d=!1,c=hi(u,!0)):p?(d=!1,c=pi(u,!0)):c=[]:Ya(u)||Ca(u)?(c=s,Ca(s)?c=ss(s):Ha(s)&&!Fa(s)||(c=oo(u))):d=!1}d&&(a.set(u,c),i(c,u,n,o,a),a.delete(u));qr(e,r,c)}(e,t,a,r,kn,n,i);else{var s=n?n(mo(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),qr(e,a,s)}}),Ss)}function In(e,t){var r=e.length;if(r)return so(t+=t<0?r:0,r)?e[t]:void 0}function Cn(e,t,r){t=t.length?lt(t,(function(e){return La(e)?function(t){return hn(t,1===e.length?e[0]:e)}:e})):[Gs];var n=-1;return t=lt(t,kt($i())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(Pn(e,(function(e,r,i){return{criteria:lt(t,(function(t){return t(e)})),index:++n,value:e}})),(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var u=bi(i[n],o[n]);if(u){if(n>=s)return u;var f=r[n];return u*("desc"==f?-1:1)}}return e.index-t.index}(e,t,r)}))}function Ln(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=hn(e,a);r(s,a)&&qn(o,ui(a,e),s)}return o}function jn(e,t,r,n){var i=n?St:wt,o=-1,a=t.length,s=e;for(e===t&&(t=yi(t)),r&&(s=lt(e,kt(r)));++o<a;)for(var u=0,f=t[o],c=r?r(f):f;(u=i(s,c,u,n))>-1;)s!==e&&Ye.call(s,u,1),Ye.call(e,u,1);return e}function Nn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;so(i)?Ye.call(e,i,1):ei(e,i)}}return e}function Bn(e,t){return e+er(cr()*(t-e+1))}function Dn(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do{t%2&&(r+=e),(t=er(t/2))&&(e+=e)}while(t);return r}function zn(e,t){return So(vo(e,t,Gs),e+"")}function Un(e){return zr(Ts(e))}function Fn(e,t){var r=Ts(e);return Ao(r,Jr(t,0,r.length))}function qn(e,t,r,n){if(!Ha(e))return e;for(var i=-1,o=(t=ui(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var u=xo(t[i]),f=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=s[u];void 0===(f=n?n(c,u,s):void 0)&&(f=Ha(c)?c:so(t[i+1])?[]:{})}Wr(s,u,f),s=s[u]}return e}var Wn=yr?function(e,t){return yr.set(e,t),e}:Gs,Hn=yt?function(e,t){return yt(e,"toString",{configurable:!0,enumerable:!1,value:Hs(t),writable:!0})}:Gs;function Kn(e){return Ao(Ts(e))}function Vn(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i<o;)a[i]=e[i+t];return a}function Gn(e,t){var r;return en(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function Yn(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Xa(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return Jn(e,t,Gs,r)}function Jn(e,t,r,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=r(t))!=t,s=null===t,u=Xa(t),f=void 0===t;i<o;){var c=er((i+o)/2),d=r(e[c]),h=void 0!==d,l=null===d,p=d==d,b=Xa(d);if(a)var v=n||p;else v=f?p&&(n||h):s?p&&h&&(n||!l):u?p&&h&&!l&&(n||!b):!l&&!b&&(n?d<=t:d<t);v?i=c+1:o=c}return sr(o,4294967294)}function Zn(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Ta(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function $n(e){return"number"==typeof e?e:Xa(e)?NaN:+e}function Xn(e){if("string"==typeof e)return e;if(La(e))return lt(e,Xn)+"";if(Xa(e))return xr?xr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qn(e,t,r){var n=-1,i=dt,o=e.length,a=!0,s=[],u=s;if(r)a=!1,i=ht;else if(o>=200){var f=t?null:Di(e);if(f)return Ht(f);a=!1,i=Ct,u=new Nr}else u=t?[]:s;e:for(;++n<o;){var c=e[n],d=t?t(c):c;if(c=r||0!==c?c:0,a&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue e;t&&u.push(d),s.push(c)}else i(u,d,r)||(u!==s&&u.push(d),s.push(c))}return s}function ei(e,t){return null==(e=go(e,t=ui(t,e)))||delete e[xo(Uo(t))]}function ti(e,t,r,n){return qn(e,t,r(hn(e,t)),n)}function ri(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?Vn(e,n?0:o,n?o+1:i):Vn(e,n?o+1:0,n?i:o)}function ni(e,t){var r=e;return r instanceof Ir&&(r=r.value()),bt(t,(function(e,t){return t.func.apply(t.thisArg,pt([e],t.args))}),r)}function ii(e,t,r){var i=e.length;if(i<2)return i?Qn(e[0]):[];for(var o=-1,a=n(i);++o<i;)for(var s=e[o],u=-1;++u<i;)u!=o&&(a[o]=Qr(a[o]||s,e[u],t,r));return Qn(an(a,1),t,r)}function oi(e,t,r){for(var n=-1,i=e.length,o=t.length,a={};++n<i;){var s=n<o?t[n]:void 0;r(a,e[n],s)}return a}function ai(e){return Ba(e)?e:[]}function si(e){return"function"==typeof e?e:Gs}function ui(e,t){return La(e)?e:fo(e,t)?[e]:Oo(us(e))}var fi=zn;function ci(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:Vn(e,t,r)}var di=Ot||function(e){return Ge.clearTimeout(e)};function hi(e,t){if(t)return e.slice();var r=e.length,n=Ne?Ne(r):new e.constructor(r);return e.copy(n),n}function li(e){var t=new e.constructor(e.byteLength);return new Le(t).set(new Le(e)),t}function pi(e,t){var r=t?li(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function bi(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=e==e,o=Xa(e),a=void 0!==t,s=null===t,u=t==t,f=Xa(t);if(!s&&!f&&!o&&e>t||o&&a&&u&&!s&&!f||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!f&&e<t||f&&r&&i&&!n&&!o||s&&r&&i||!a&&i||!u)return-1}return 0}function vi(e,t,r,i){for(var o=-1,a=e.length,s=r.length,u=-1,f=t.length,c=ar(a-s,0),d=n(f+c),h=!i;++u<f;)d[u]=t[u];for(;++o<s;)(h||o<a)&&(d[r[o]]=e[o]);for(;c--;)d[u++]=e[o++];return d}function gi(e,t,r,i){for(var o=-1,a=e.length,s=-1,u=r.length,f=-1,c=t.length,d=ar(a-u,0),h=n(d+c),l=!i;++o<d;)h[o]=e[o];for(var p=o;++f<c;)h[p+f]=t[f];for(;++s<u;)(l||o<a)&&(h[p+r[s]]=e[o++]);return h}function yi(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function mi(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),i?Gr(r,s,u):Wr(r,s,u)}return r}function _i(e,t){return function(r,n){var i=La(r)?at:Kr,o=t?t():{};return i(r,e,$i(n,2),o)}}function wi(e){return zn((function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&uo(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=pe(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t}))}function Si(e,t){return function(r,n){if(null==r)return r;if(!Na(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=pe(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ei(e){return function(t,r,n){for(var i=-1,o=pe(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}function Mi(e){return function(t){var r=Ut(t=us(t))?Gt(t):void 0,n=r?r[0]:t.charAt(0),i=r?ci(r,1).join(""):t.slice(1);return n[e]()+i}}function Ai(e){return function(t){return bt(Fs(Cs(t).replace(Ie,"")),e,"")}}function Oi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Rr(e.prototype),n=e.apply(r,t);return Ha(n)?n:r}}function xi(e){return function(t,r,n){var i=pe(t);if(!Na(t)){var o=$i(r,3);t=ws(t),r=function(e){return o(i[e],e,i)}}var a=e(t,r,n);return a>-1?i[o?t[a]:a]:void 0}}function Pi(e){return Ki((function(t){var r=t.length,n=r,i=kr.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new ge(o);if(i&&!s&&"wrapper"==Ji(a))var s=new kr([],!0)}for(n=s?n:r;++n<r;){var u=Ji(a=t[n]),f="wrapper"==u?Yi(a):void 0;s=f&&co(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?s[Ji(f[0])].apply(s,f[3]):1==a.length&&co(a)?s[u]():s.thru(a)}return function(){var e=arguments,n=e[0];if(s&&1==e.length&&La(n))return s.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Ri(e,t,r,i,o,a,s,u,f,c){var d=128&t,h=1&t,l=2&t,p=24&t,b=512&t,v=l?void 0:Oi(e);return function g(){for(var y=arguments.length,m=n(y),_=y;_--;)m[_]=arguments[_];if(p)var w=Zi(g),S=Nt(m,w);if(i&&(m=vi(m,i,o,p)),a&&(m=gi(m,a,s,p)),y-=S,p&&y<c){var E=Wt(m,w);return Ni(e,t,Ri,g.placeholder,r,m,E,u,f,c-y)}var M=h?r:this,A=l?M[e]:e;return y=m.length,u?m=yo(m,u):b&&y>1&&m.reverse(),d&&f<y&&(m.length=f),this&&this!==Ge&&this instanceof g&&(A=v||Oi(A)),A.apply(M,m)}}function Ti(e,t){return function(r,n){return function(e,t,r,n){return fn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function ki(e,t){return function(r,n){var i;if(void 0===r&&void 0===n)return t;if(void 0!==r&&(i=r),void 0!==n){if(void 0===i)return n;"string"==typeof r||"string"==typeof n?(r=Xn(r),n=Xn(n)):(r=$n(r),n=$n(n)),i=e(r,n)}return i}}function Ii(e){return Ki((function(t){return t=lt(t,kt($i())),zn((function(r){var n=this;return e(t,(function(e){return ot(e,n,r)}))}))}))}function Ci(e,t){var r=(t=void 0===t?" ":Xn(t)).length;if(r<2)return r?Dn(t,e):t;var n=Dn(t,Qt(e/Vt(t)));return Ut(t)?ci(Gt(n),0,e).join(""):n.slice(0,e)}function Li(e){return function(t,r,i){return i&&"number"!=typeof i&&uo(t,r,i)&&(r=i=void 0),t=ns(t),void 0===r?(r=t,t=0):r=ns(r),function(e,t,r,i){for(var o=-1,a=ar(Qt((t-e)/(r||1)),0),s=n(a);a--;)s[i?a:++o]=e,e+=r;return s}(t,r,i=void 0===i?t<r?1:-1:ns(i),e)}}function ji(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=as(t),r=as(r)),e(t,r)}}function Ni(e,t,r,n,i,o,a,s,u,f){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,u,f],h=r.apply(void 0,d);return co(e)&&_o(h,d),h.placeholder=n,Eo(h,e,t)}function Bi(e){var t=le[e];return function(e,r){if(e=as(e),(r=null==r?0:sr(is(r),292))&&nr(e)){var n=(us(e)+"e").split("e");return+((n=(us(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Di=br&&1/Ht(new br([,-0]))[1]==1/0?function(e){return new br(e)}:Xs;function zi(e){return function(t){var r=no(t);return r==b?Ft(t):r==m?Kt(t):function(e,t){return lt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ui(e,t,r,i,s,u,f,c){var d=2&t;if(!d&&"function"!=typeof e)throw new ge(o);var h=i?i.length:0;if(h||(t&=-97,i=s=void 0),f=void 0===f?f:ar(is(f),0),c=void 0===c?c:is(c),h-=s?s.length:0,64&t){var l=i,p=s;i=s=void 0}var b=d?void 0:Yi(e),v=[e,t,r,i,s,l,p,u,f,c];if(b&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=128==n&&8==r||128==n&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var f=e[3];e[3]=f?vi(f,u,t[4]):u,e[4]=f?Wt(e[3],a):t[4]}(u=t[5])&&(f=e[5],e[5]=f?gi(f,u,t[6]):u,e[6]=f?Wt(e[5],a):t[6]);(u=t[7])&&(e[7]=u);128&n&&(e[8]=null==e[8]?t[8]:sr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(v,b),e=v[0],t=v[1],r=v[2],i=v[3],s=v[4],!(c=v[9]=void 0===v[9]?d?0:e.length:ar(v[9]-h,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,r){var i=Oi(e);return function o(){for(var a=arguments.length,s=n(a),u=a,f=Zi(o);u--;)s[u]=arguments[u];var c=a<3&&s[0]!==f&&s[a-1]!==f?[]:Wt(s,f);if((a-=c.length)<r)return Ni(e,t,Ri,o.placeholder,void 0,s,c,void 0,void 0,r-a);var d=this&&this!==Ge&&this instanceof o?i:e;return ot(d,this,s)}}(e,t,c):32!=t&&33!=t||s.length?Ri.apply(void 0,v):function(e,t,r,i){var o=1&t,a=Oi(e);return function t(){for(var s=-1,u=arguments.length,f=-1,c=i.length,d=n(c+u),h=this&&this!==Ge&&this instanceof t?a:e;++f<c;)d[f]=i[f];for(;u--;)d[f++]=arguments[++s];return ot(h,o?r:this,d)}}(e,t,r,i);else var g=function(e,t,r){var n=1&t,i=Oi(e);return function t(){var o=this&&this!==Ge&&this instanceof t?i:e;return o.apply(n?r:this,arguments)}}(e,t,r);return Eo((b?Wn:_o)(g,v),e,t)}function Fi(e,t,r,n){return void 0===e||Ta(e,_e[r])&&!Ee.call(n,r)?t:e}function qi(e,t,r,n,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),kn(e,t,void 0,qi,o),o.delete(t)),e}function Wi(e){return Ya(e)?void 0:e}function Hi(e,t,r,n,i,o){var a=1&r,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var f=o.get(e),c=o.get(t);if(f&&c)return f==t&&c==e;var d=-1,h=!0,l=2&r?new Nr:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var p=e[d],b=t[d];if(n)var v=a?n(b,p,d,t,e,o):n(p,b,d,e,t,o);if(void 0!==v){if(v)continue;h=!1;break}if(l){if(!gt(t,(function(e,t){if(!Ct(l,t)&&(p===e||i(p,e,r,n,o)))return l.push(t)}))){h=!1;break}}else if(p!==b&&!i(p,b,r,n,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function Ki(e){return So(vo(e,void 0,jo),e+"")}function Vi(e){return ln(e,ws,to)}function Gi(e){return ln(e,Ss,ro)}var Yi=yr?function(e){return yr.get(e)}:Xs;function Ji(e){for(var t=e.name+"",r=mr[t],n=Ee.call(mr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function Zi(e){return(Ee.call(Pr,"placeholder")?Pr:e).placeholder}function $i(){var e=Pr.iteratee||Ys;return e=e===Ys?Mn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=ws(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,po(i)]}return t}function eo(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return En(r)?r:void 0}var to=tr?function(e){return null==e?[]:(e=pe(e),ct(tr(e),(function(t){return Ve.call(e,t)})))}:ou,ro=tr?function(e){for(var t=[];e;)pt(t,to(e)),e=qe(e);return t}:ou,no=pn;function io(e,t,r){for(var n=-1,i=(t=ui(t,e)).length,o=!1;++n<i;){var a=xo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Wa(i)&&so(a,i)&&(La(e)||Ca(e))}function oo(e){return"function"!=typeof e.constructor||lo(e)?{}:Rr(qe(e))}function ao(e){return La(e)||Ca(e)||!!(Je&&e&&e[Je])}function so(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ue.test(e))&&e>-1&&e%1==0&&e<t}function uo(e,t,r){if(!Ha(r))return!1;var n=typeof t;return!!("number"==n?Na(r)&&so(t,r.length):"string"==n&&t in r)&&Ta(r[t],e)}function fo(e,t){if(La(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Xa(e))||(H.test(e)||!W.test(e)||null!=t&&e in pe(t))}function co(e){var t=Ji(e),r=Pr[t];if("function"!=typeof r||!(t in Ir.prototype))return!1;if(e===r)return!0;var n=Yi(r);return!!n&&e===n[0]}(hr&&no(new hr(new ArrayBuffer(1)))!=M||lr&&no(new lr)!=b||pr&&"[object Promise]"!=no(pr.resolve())||br&&no(new br)!=m||vr&&no(new vr)!=S)&&(no=function(e){var t=pn(e),r=t==g?e.constructor:void 0,n=r?Po(r):"";if(n)switch(n){case _r:return M;case wr:return b;case Sr:return"[object Promise]";case Er:return m;case Mr:return S}return t});var ho=we?Fa:au;function lo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function po(e){return e==e&&!Ha(e)}function bo(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in pe(r)))}}function vo(e,t,r){return t=ar(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=ar(i.length-t,0),s=n(a);++o<a;)s[o]=i[t+o];o=-1;for(var u=n(t+1);++o<t;)u[o]=i[o];return u[t]=r(s),ot(e,this,u)}}function go(e,t){return t.length<2?e:hn(e,Vn(t,0,-1))}function yo(e,t){for(var r=e.length,n=sr(t.length,r),i=yi(e);n--;){var o=t[n];e[n]=so(o,r)?i[o]:void 0}return e}function mo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=Mo(Wn),wo=Xt||function(e,t){return Ge.setTimeout(e,t)},So=Mo(Hn);function Eo(e,t,r){var n=t+"";return So(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Z,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return st(s,(function(r){var n="_."+r[0];t&r[1]&&!dt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(n),r)))}function Mo(e){var t=0,r=0;return function(){var n=ur(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ao(e,t){var r=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++r<t;){var o=Bn(r,i),a=e[o];e[o]=e[r],e[r]=a}return e.length=t,e}var Oo=function(e){var t=Ma(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(K,(function(e,r,n,i){t.push(n?i.replace(te,"$1"):r||e)})),t}));function xo(e){if("string"==typeof e||Xa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Ir)return e.clone();var t=new kr(e.__wrapped__,e.__chain__);return t.__actions__=yi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=zn((function(e,t){return Ba(e)?Qr(e,an(t,1,Ba,!0)):[]})),ko=zn((function(e,t){var r=Uo(t);return Ba(r)&&(r=void 0),Ba(e)?Qr(e,an(t,1,Ba,!0),$i(r,2)):[]})),Io=zn((function(e,t){var r=Uo(t);return Ba(r)&&(r=void 0),Ba(e)?Qr(e,an(t,1,Ba,!0),void 0,r):[]}));function Co(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:is(r);return i<0&&(i=ar(n+i,0)),_t(e,$i(t,3),i)}function Lo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==r&&(i=is(r),i=r<0?ar(n+i,0):sr(i,n-1)),_t(e,$i(t,3),i,!0)}function jo(e){return(null==e?0:e.length)?an(e,1):[]}function No(e){return e&&e.length?e[0]:void 0}var Bo=zn((function(e){var t=lt(e,ai);return t.length&&t[0]===e[0]?yn(t):[]})),Do=zn((function(e){var t=Uo(e),r=lt(e,ai);return t===Uo(r)?t=void 0:r.pop(),r.length&&r[0]===e[0]?yn(r,$i(t,2)):[]})),zo=zn((function(e){var t=Uo(e),r=lt(e,ai);return(t="function"==typeof t?t:void 0)&&r.pop(),r.length&&r[0]===e[0]?yn(r,void 0,t):[]}));function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fo=zn(qo);function qo(e,t){return e&&e.length&&t&&t.length?jn(e,t):e}var Wo=Ki((function(e,t){var r=null==e?0:e.length,n=Yr(e,t);return Nn(e,lt(t,(function(e){return so(e,r)?+e:e})).sort(bi)),n}));function Ho(e){return null==e?e:dr.call(e)}var Ko=zn((function(e){return Qn(an(e,1,Ba,!0))})),Vo=zn((function(e){var t=Uo(e);return Ba(t)&&(t=void 0),Qn(an(e,1,Ba,!0),$i(t,2))})),Go=zn((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Qn(an(e,1,Ba,!0),void 0,t)}));function Yo(e){if(!e||!e.length)return[];var t=0;return e=ct(e,(function(e){if(Ba(e))return t=ar(e.length,t),!0})),Rt(t,(function(t){return lt(e,At(t))}))}function Jo(e,t){if(!e||!e.length)return[];var r=Yo(e);return null==t?r:lt(r,(function(e){return ot(t,void 0,e)}))}var Zo=zn((function(e,t){return Ba(e)?Qr(e,t):[]})),$o=zn((function(e){return ii(ct(e,Ba))})),Xo=zn((function(e){var t=Uo(e);return Ba(t)&&(t=void 0),ii(ct(e,Ba),$i(t,2))})),Qo=zn((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ii(ct(e,Ba),void 0,t)})),ea=zn(Yo);var ta=zn((function(e){var t=e.length,r=t>1?e[t-1]:void 0;return r="function"==typeof r?(e.pop(),r):void 0,Jo(e,r)}));function ra(e){var t=Pr(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ia=Ki((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return Yr(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ir&&so(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:na,args:[i],thisArg:void 0}),new kr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var oa=_i((function(e,t,r){Ee.call(e,r)?++e[r]:Gr(e,r,1)}));var aa=xi(Co),sa=xi(Lo);function ua(e,t){return(La(e)?st:en)(e,$i(t,3))}function fa(e,t){return(La(e)?ut:tn)(e,$i(t,3))}var ca=_i((function(e,t,r){Ee.call(e,r)?e[r].push(t):Gr(e,r,[t])}));var da=zn((function(e,t,r){var i=-1,o="function"==typeof t,a=Na(e)?n(e.length):[];return en(e,(function(e){a[++i]=o?ot(t,e,r):mn(e,t,r)})),a})),ha=_i((function(e,t,r){Gr(e,r,t)}));function la(e,t){return(La(e)?lt:Pn)(e,$i(t,3))}var pa=_i((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var ba=zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&uo(e,t[0],t[1])?t=[]:r>2&&uo(t[0],t[1],t[2])&&(t=[t[0]]),Cn(e,an(t,1),[])})),va=$t||function(){return Ge.Date.now()};function ga(e,t,r){return t=r?void 0:t,Ui(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var r;if("function"!=typeof t)throw new ge(o);return e=is(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var ma=zn((function(e,t,r){var n=1;if(r.length){var i=Wt(r,Zi(ma));n|=32}return Ui(e,n,t,r,i)})),_a=zn((function(e,t,r){var n=3;if(r.length){var i=Wt(r,Zi(_a));n|=32}return Ui(t,n,e,r,i)}));function wa(e,t,r){var n,i,a,s,u,f,c=0,d=!1,h=!1,l=!0;if("function"!=typeof e)throw new ge(o);function p(t){var r=n,o=i;return n=i=void 0,c=t,s=e.apply(o,r)}function b(e){return c=e,u=wo(g,t),d?p(e):s}function v(e){var r=e-f;return void 0===f||r>=t||r<0||h&&e-c>=a}function g(){var e=va();if(v(e))return y(e);u=wo(g,function(e){var r=t-(e-f);return h?sr(r,a-(e-c)):r}(e))}function y(e){return u=void 0,l&&n?p(e):(n=i=void 0,s)}function m(){var e=va(),r=v(e);if(n=arguments,i=this,f=e,r){if(void 0===u)return b(f);if(h)return di(u),u=wo(g,t),p(f)}return void 0===u&&(u=wo(g,t)),s}return t=as(t)||0,Ha(r)&&(d=!!r.leading,a=(h="maxWait"in r)?ar(as(r.maxWait)||0,t):a,l="trailing"in r?!!r.trailing:l),m.cancel=function(){void 0!==u&&di(u),c=0,n=f=i=u=void 0},m.flush=function(){return void 0===u?s:y(va())},m}var Sa=zn((function(e,t){return Xr(e,1,t)})),Ea=zn((function(e,t,r){return Xr(e,as(t)||0,r)}));function Ma(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ma.Cache||jr),r}function Aa(e){if("function"!=typeof e)throw new ge(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ma.Cache=jr;var Oa=fi((function(e,t){var r=(t=1==t.length&&La(t[0])?lt(t[0],kt($i())):lt(an(t,1),kt($i()))).length;return zn((function(n){for(var i=-1,o=sr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return ot(e,this,n)}))})),xa=zn((function(e,t){return Ui(e,32,void 0,t,Wt(t,Zi(xa)))})),Pa=zn((function(e,t){return Ui(e,64,void 0,t,Wt(t,Zi(Pa)))})),Ra=Ki((function(e,t){return Ui(e,256,void 0,void 0,void 0,t)}));function Ta(e,t){return e===t||e!=e&&t!=t}var ka=ji(bn),Ia=ji((function(e,t){return e>=t})),Ca=_n(function(){return arguments}())?_n:function(e){return Ka(e)&&Ee.call(e,"callee")&&!Ve.call(e,"callee")},La=n.isArray,ja=Qe?kt(Qe):function(e){return Ka(e)&&pn(e)==E};function Na(e){return null!=e&&Wa(e.length)&&!Fa(e)}function Ba(e){return Ka(e)&&Na(e)}var Da=rr||au,za=et?kt(et):function(e){return Ka(e)&&pn(e)==d};function Ua(e){if(!Ka(e))return!1;var t=pn(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Fa(e){if(!Ha(e))return!1;var t=pn(e);return t==l||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function qa(e){return"number"==typeof e&&e==is(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var Va=tt?kt(tt):function(e){return Ka(e)&&no(e)==b};function Ga(e){return"number"==typeof e||Ka(e)&&pn(e)==v}function Ya(e){if(!Ka(e)||pn(e)!=g)return!1;var t=qe(e);if(null===t)return!0;var r=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Se.call(r)==xe}var Ja=rt?kt(rt):function(e){return Ka(e)&&pn(e)==y};var Za=nt?kt(nt):function(e){return Ka(e)&&no(e)==m};function $a(e){return"string"==typeof e||!La(e)&&Ka(e)&&pn(e)==_}function Xa(e){return"symbol"==typeof e||Ka(e)&&pn(e)==w}var Qa=it?kt(it):function(e){return Ka(e)&&Wa(e.length)&&!!Ue[pn(e)]};var es=ji(xn),ts=ji((function(e,t){return e<=t}));function rs(e){if(!e)return[];if(Na(e))return $a(e)?Gt(e):yi(e);if($e&&e[$e])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[$e]());var t=no(e);return(t==b?Ft:t==m?Ht:Ts)(e)}function ns(e){return e?(e=as(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function is(e){var t=ns(e),r=t%1;return t==t?r?t-r:t:0}function os(e){return e?Jr(is(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Xa(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var r=oe.test(e);return r||se.test(e)?He(e.slice(2),r?2:8):ie.test(e)?NaN:+e}function ss(e){return mi(e,Ss(e))}function us(e){return null==e?"":Xn(e)}var fs=wi((function(e,t){if(lo(t)||Na(t))mi(t,ws(t),e);else for(var r in t)Ee.call(t,r)&&Wr(e,r,t[r])})),cs=wi((function(e,t){mi(t,Ss(t),e)})),ds=wi((function(e,t,r,n){mi(t,Ss(t),e,n)})),hs=wi((function(e,t,r,n){mi(t,ws(t),e,n)})),ls=Ki(Yr);var ps=zn((function(e,t){e=pe(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&uo(t[0],t[1],i)&&(n=1);++r<n;)for(var o=t[r],a=Ss(o),s=-1,u=a.length;++s<u;){var f=a[s],c=e[f];(void 0===c||Ta(c,_e[f])&&!Ee.call(e,f))&&(e[f]=o[f])}return e})),bs=zn((function(e){return e.push(void 0,qi),ot(Ms,void 0,e)}));function vs(e,t,r){var n=null==e?void 0:hn(e,t);return void 0===n?r:n}function gs(e,t){return null!=e&&io(e,t,gn)}var ys=Ti((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Oe.call(t)),e[t]=r}),Hs(Gs)),ms=Ti((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Oe.call(t)),Ee.call(e,t)?e[t].push(r):e[t]=[r]}),$i),_s=zn(mn);function ws(e){return Na(e)?Dr(e):An(e)}function Ss(e){return Na(e)?Dr(e,!0):On(e)}var Es=wi((function(e,t,r){kn(e,t,r)})),Ms=wi((function(e,t,r,n){kn(e,t,r,n)})),As=Ki((function(e,t){var r={};if(null==e)return r;var n=!1;t=lt(t,(function(t){return t=ui(t,e),n||(n=t.length>1),t})),mi(e,Gi(e),r),n&&(r=Zr(r,7,Wi));for(var i=t.length;i--;)ei(r,t[i]);return r}));var Os=Ki((function(e,t){return null==e?{}:function(e,t){return Ln(e,t,(function(t,r){return gs(e,r)}))}(e,t)}));function xs(e,t){if(null==e)return{};var r=lt(Gi(e),(function(e){return[e]}));return t=$i(t),Ln(e,r,(function(e,r){return t(e,r[0])}))}var Ps=zi(ws),Rs=zi(Ss);function Ts(e){return null==e?[]:It(e,ws(e))}var ks=Ai((function(e,t,r){return t=t.toLowerCase(),e+(r?Is(t):t)}));function Is(e){return Us(us(e).toLowerCase())}function Cs(e){return(e=us(e))&&e.replace(fe,Bt).replace(Ce,"")}var Ls=Ai((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),js=Ai((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ns=Mi("toLowerCase");var Bs=Ai((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ds=Ai((function(e,t,r){return e+(r?" ":"")+Us(t)}));var zs=Ai((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Us=Mi("toUpperCase");function Fs(e,t,r){return e=us(e),void 0===(t=r?void 0:t)?function(e){return Be.test(e)}(e)?function(e){return e.match(je)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var qs=zn((function(e,t){try{return ot(e,void 0,t)}catch(e){return Ua(e)?e:new J(e)}})),Ws=Ki((function(e,t){return st(t,(function(t){t=xo(t),Gr(e,t,ma(e[t],e))})),e}));function Hs(e){return function(){return e}}var Ks=Pi(),Vs=Pi(!0);function Gs(e){return e}function Ys(e){return Mn("function"==typeof e?e:Zr(e,1))}var Js=zn((function(e,t){return function(r){return mn(r,e,t)}})),Zs=zn((function(e,t){return function(r){return mn(e,r,t)}}));function $s(e,t,r){var n=ws(t),i=dn(t,n);null!=r||Ha(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=dn(t,ws(t)));var o=!(Ha(r)&&"chain"in r&&!r.chain),a=Fa(e);return st(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=yi(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,pt([this.value()],arguments))})})),e}function Xs(){}var Qs=Ii(lt),eu=Ii(ft),tu=Ii(gt);function ru(e){return fo(e)?At(xo(e)):function(e){return function(t){return hn(t,e)}}(e)}var nu=Li(),iu=Li(!0);function ou(){return[]}function au(){return!1}var su=ki((function(e,t){return e+t}),0),uu=Bi("ceil"),fu=ki((function(e,t){return e/t}),1),cu=Bi("floor");var du,hu=ki((function(e,t){return e*t}),1),lu=Bi("round"),pu=ki((function(e,t){return e-t}),0);return Pr.after=function(e,t){if("function"!=typeof t)throw new ge(o);return e=is(e),function(){if(--e<1)return t.apply(this,arguments)}},Pr.ary=ga,Pr.assign=fs,Pr.assignIn=cs,Pr.assignInWith=ds,Pr.assignWith=hs,Pr.at=ls,Pr.before=ya,Pr.bind=ma,Pr.bindAll=Ws,Pr.bindKey=_a,Pr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(e)?e:[e]},Pr.chain=ra,Pr.chunk=function(e,t,r){t=(r?uo(e,t,r):void 0===t)?1:ar(is(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=n(Qt(i/t));o<i;)s[a++]=Vn(e,o,o+=t);return s},Pr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Pr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return pt(La(r)?yi(r):[r],an(t,1))},Pr.cond=function(e){var t=null==e?0:e.length,r=$i();return e=t?lt(e,(function(e){if("function"!=typeof e[1])throw new ge(o);return[r(e[0]),e[1]]})):[],zn((function(r){for(var n=-1;++n<t;){var i=e[n];if(ot(i[0],this,r))return ot(i[1],this,r)}}))},Pr.conforms=function(e){return function(e){var t=ws(e);return function(r){return $r(r,e,t)}}(Zr(e,1))},Pr.constant=Hs,Pr.countBy=oa,Pr.create=function(e,t){var r=Rr(e);return null==t?r:Vr(r,t)},Pr.curry=function e(t,r,n){var i=Ui(t,8,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=e.placeholder,i},Pr.curryRight=function e(t,r,n){var i=Ui(t,16,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=e.placeholder,i},Pr.debounce=wa,Pr.defaults=ps,Pr.defaultsDeep=bs,Pr.defer=Sa,Pr.delay=Ea,Pr.difference=To,Pr.differenceBy=ko,Pr.differenceWith=Io,Pr.drop=function(e,t,r){var n=null==e?0:e.length;return n?Vn(e,(t=r||void 0===t?1:is(t))<0?0:t,n):[]},Pr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?Vn(e,0,(t=n-(t=r||void 0===t?1:is(t)))<0?0:t):[]},Pr.dropRightWhile=function(e,t){return e&&e.length?ri(e,$i(t,3),!0,!0):[]},Pr.dropWhile=function(e,t){return e&&e.length?ri(e,$i(t,3),!0):[]},Pr.fill=function(e,t,r,n){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&uo(e,t,r)&&(r=0,n=i),function(e,t,r,n){var i=e.length;for((r=is(r))<0&&(r=-r>i?0:i+r),(n=void 0===n||n>i?i:is(n))<0&&(n+=i),n=r>n?0:os(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Pr.filter=function(e,t){return(La(e)?ct:on)(e,$i(t,3))},Pr.flatMap=function(e,t){return an(la(e,t),1)},Pr.flatMapDeep=function(e,t){return an(la(e,t),1/0)},Pr.flatMapDepth=function(e,t,r){return r=void 0===r?1:is(r),an(la(e,t),r)},Pr.flatten=jo,Pr.flattenDeep=function(e){return(null==e?0:e.length)?an(e,1/0):[]},Pr.flattenDepth=function(e,t){return(null==e?0:e.length)?an(e,t=void 0===t?1:is(t)):[]},Pr.flip=function(e){return Ui(e,512)},Pr.flow=Ks,Pr.flowRight=Vs,Pr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Pr.functions=function(e){return null==e?[]:dn(e,ws(e))},Pr.functionsIn=function(e){return null==e?[]:dn(e,Ss(e))},Pr.groupBy=ca,Pr.initial=function(e){return(null==e?0:e.length)?Vn(e,0,-1):[]},Pr.intersection=Bo,Pr.intersectionBy=Do,Pr.intersectionWith=zo,Pr.invert=ys,Pr.invertBy=ms,Pr.invokeMap=da,Pr.iteratee=Ys,Pr.keyBy=ha,Pr.keys=ws,Pr.keysIn=Ss,Pr.map=la,Pr.mapKeys=function(e,t){var r={};return t=$i(t,3),fn(e,(function(e,n,i){Gr(r,t(e,n,i),e)})),r},Pr.mapValues=function(e,t){var r={};return t=$i(t,3),fn(e,(function(e,n,i){Gr(r,n,t(e,n,i))})),r},Pr.matches=function(e){return Rn(Zr(e,1))},Pr.matchesProperty=function(e,t){return Tn(e,Zr(t,1))},Pr.memoize=Ma,Pr.merge=Es,Pr.mergeWith=Ms,Pr.method=Js,Pr.methodOf=Zs,Pr.mixin=$s,Pr.negate=Aa,Pr.nthArg=function(e){return e=is(e),zn((function(t){return In(t,e)}))},Pr.omit=As,Pr.omitBy=function(e,t){return xs(e,Aa($i(t)))},Pr.once=function(e){return ya(2,e)},Pr.orderBy=function(e,t,r,n){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(r=n?void 0:r)||(r=null==r?[]:[r]),Cn(e,t,r))},Pr.over=Qs,Pr.overArgs=Oa,Pr.overEvery=eu,Pr.overSome=tu,Pr.partial=xa,Pr.partialRight=Pa,Pr.partition=pa,Pr.pick=Os,Pr.pickBy=xs,Pr.property=ru,Pr.propertyOf=function(e){return function(t){return null==e?void 0:hn(e,t)}},Pr.pull=Fo,Pr.pullAll=qo,Pr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?jn(e,t,$i(r,2)):e},Pr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?jn(e,t,void 0,r):e},Pr.pullAt=Wo,Pr.range=nu,Pr.rangeRight=iu,Pr.rearg=Ra,Pr.reject=function(e,t){return(La(e)?ct:on)(e,Aa($i(t,3)))},Pr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=$i(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Nn(e,i),r},Pr.rest=function(e,t){if("function"!=typeof e)throw new ge(o);return zn(e,t=void 0===t?t:is(t))},Pr.reverse=Ho,Pr.sampleSize=function(e,t,r){return t=(r?uo(e,t,r):void 0===t)?1:is(t),(La(e)?Ur:Fn)(e,t)},Pr.set=function(e,t,r){return null==e?e:qn(e,t,r)},Pr.setWith=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:qn(e,t,r,n)},Pr.shuffle=function(e){return(La(e)?Fr:Kn)(e)},Pr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&uo(e,t,r)?(t=0,r=n):(t=null==t?0:is(t),r=void 0===r?n:is(r)),Vn(e,t,r)):[]},Pr.sortBy=ba,Pr.sortedUniq=function(e){return e&&e.length?Zn(e):[]},Pr.sortedUniqBy=function(e,t){return e&&e.length?Zn(e,$i(t,2)):[]},Pr.split=function(e,t,r){return r&&"number"!=typeof r&&uo(e,t,r)&&(t=r=void 0),(r=void 0===r?4294967295:r>>>0)?(e=us(e))&&("string"==typeof t||null!=t&&!Ja(t))&&!(t=Xn(t))&&Ut(e)?ci(Gt(e),0,r):e.split(t,r):[]},Pr.spread=function(e,t){if("function"!=typeof e)throw new ge(o);return t=null==t?0:ar(is(t),0),zn((function(r){var n=r[t],i=ci(r,0,t);return n&&pt(i,n),ot(e,this,i)}))},Pr.tail=function(e){var t=null==e?0:e.length;return t?Vn(e,1,t):[]},Pr.take=function(e,t,r){return e&&e.length?Vn(e,0,(t=r||void 0===t?1:is(t))<0?0:t):[]},Pr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?Vn(e,(t=n-(t=r||void 0===t?1:is(t)))<0?0:t,n):[]},Pr.takeRightWhile=function(e,t){return e&&e.length?ri(e,$i(t,3),!1,!0):[]},Pr.takeWhile=function(e,t){return e&&e.length?ri(e,$i(t,3)):[]},Pr.tap=function(e,t){return t(e),e},Pr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new ge(o);return Ha(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),wa(e,t,{leading:n,maxWait:t,trailing:i})},Pr.thru=na,Pr.toArray=rs,Pr.toPairs=Ps,Pr.toPairsIn=Rs,Pr.toPath=function(e){return La(e)?lt(e,xo):Xa(e)?[e]:yi(Oo(us(e)))},Pr.toPlainObject=ss,Pr.transform=function(e,t,r){var n=La(e),i=n||Da(e)||Qa(e);if(t=$i(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ha(e)&&Fa(o)?Rr(qe(e)):{}}return(i?st:fn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Pr.unary=function(e){return ga(e,1)},Pr.union=Ko,Pr.unionBy=Vo,Pr.unionWith=Go,Pr.uniq=function(e){return e&&e.length?Qn(e):[]},Pr.uniqBy=function(e,t){return e&&e.length?Qn(e,$i(t,2)):[]},Pr.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},Pr.unset=function(e,t){return null==e||ei(e,t)},Pr.unzip=Yo,Pr.unzipWith=Jo,Pr.update=function(e,t,r){return null==e?e:ti(e,t,si(r))},Pr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:ti(e,t,si(r),n)},Pr.values=Ts,Pr.valuesIn=function(e){return null==e?[]:It(e,Ss(e))},Pr.without=Zo,Pr.words=Fs,Pr.wrap=function(e,t){return xa(si(t),e)},Pr.xor=$o,Pr.xorBy=Xo,Pr.xorWith=Qo,Pr.zip=ea,Pr.zipObject=function(e,t){return oi(e||[],t||[],Wr)},Pr.zipObjectDeep=function(e,t){return oi(e||[],t||[],qn)},Pr.zipWith=ta,Pr.entries=Ps,Pr.entriesIn=Rs,Pr.extend=cs,Pr.extendWith=ds,$s(Pr,Pr),Pr.add=su,Pr.attempt=qs,Pr.camelCase=ks,Pr.capitalize=Is,Pr.ceil=uu,Pr.clamp=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=as(r))==r?r:0),void 0!==t&&(t=(t=as(t))==t?t:0),Jr(as(e),t,r)},Pr.clone=function(e){return Zr(e,4)},Pr.cloneDeep=function(e){return Zr(e,5)},Pr.cloneDeepWith=function(e,t){return Zr(e,5,t="function"==typeof t?t:void 0)},Pr.cloneWith=function(e,t){return Zr(e,4,t="function"==typeof t?t:void 0)},Pr.conformsTo=function(e,t){return null==t||$r(e,t,ws(t))},Pr.deburr=Cs,Pr.defaultTo=function(e,t){return null==e||e!=e?t:e},Pr.divide=fu,Pr.endsWith=function(e,t,r){e=us(e),t=Xn(t);var n=e.length,i=r=void 0===r?n:Jr(is(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},Pr.eq=Ta,Pr.escape=function(e){return(e=us(e))&&z.test(e)?e.replace(B,Dt):e},Pr.escapeRegExp=function(e){return(e=us(e))&&G.test(e)?e.replace(V,"\\$&"):e},Pr.every=function(e,t,r){var n=La(e)?ft:rn;return r&&uo(e,t,r)&&(t=void 0),n(e,$i(t,3))},Pr.find=aa,Pr.findIndex=Co,Pr.findKey=function(e,t){return mt(e,$i(t,3),fn)},Pr.findLast=sa,Pr.findLastIndex=Lo,Pr.findLastKey=function(e,t){return mt(e,$i(t,3),cn)},Pr.floor=cu,Pr.forEach=ua,Pr.forEachRight=fa,Pr.forIn=function(e,t){return null==e?e:sn(e,$i(t,3),Ss)},Pr.forInRight=function(e,t){return null==e?e:un(e,$i(t,3),Ss)},Pr.forOwn=function(e,t){return e&&fn(e,$i(t,3))},Pr.forOwnRight=function(e,t){return e&&cn(e,$i(t,3))},Pr.get=vs,Pr.gt=ka,Pr.gte=Ia,Pr.has=function(e,t){return null!=e&&io(e,t,vn)},Pr.hasIn=gs,Pr.head=No,Pr.identity=Gs,Pr.includes=function(e,t,r,n){e=Na(e)?e:Ts(e),r=r&&!n?is(r):0;var i=e.length;return r<0&&(r=ar(i+r,0)),$a(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&wt(e,t,r)>-1},Pr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:is(r);return i<0&&(i=ar(n+i,0)),wt(e,t,i)},Pr.inRange=function(e,t,r){return t=ns(t),void 0===r?(r=t,t=0):r=ns(r),function(e,t,r){return e>=sr(t,r)&&e<ar(t,r)}(e=as(e),t,r)},Pr.invoke=_s,Pr.isArguments=Ca,Pr.isArray=La,Pr.isArrayBuffer=ja,Pr.isArrayLike=Na,Pr.isArrayLikeObject=Ba,Pr.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&pn(e)==c},Pr.isBuffer=Da,Pr.isDate=za,Pr.isElement=function(e){return Ka(e)&&1===e.nodeType&&!Ya(e)},Pr.isEmpty=function(e){if(null==e)return!0;if(Na(e)&&(La(e)||"string"==typeof e||"function"==typeof e.splice||Da(e)||Qa(e)||Ca(e)))return!e.length;var t=no(e);if(t==b||t==m)return!e.size;if(lo(e))return!An(e).length;for(var r in e)if(Ee.call(e,r))return!1;return!0},Pr.isEqual=function(e,t){return wn(e,t)},Pr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:void 0)?r(e,t):void 0;return void 0===n?wn(e,t,void 0,r):!!n},Pr.isError=Ua,Pr.isFinite=function(e){return"number"==typeof e&&nr(e)},Pr.isFunction=Fa,Pr.isInteger=qa,Pr.isLength=Wa,Pr.isMap=Va,Pr.isMatch=function(e,t){return e===t||Sn(e,t,Qi(t))},Pr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:void 0,Sn(e,t,Qi(t),r)},Pr.isNaN=function(e){return Ga(e)&&e!=+e},Pr.isNative=function(e){if(ho(e))throw new J("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return En(e)},Pr.isNil=function(e){return null==e},Pr.isNull=function(e){return null===e},Pr.isNumber=Ga,Pr.isObject=Ha,Pr.isObjectLike=Ka,Pr.isPlainObject=Ya,Pr.isRegExp=Ja,Pr.isSafeInteger=function(e){return qa(e)&&e>=-9007199254740991&&e<=9007199254740991},Pr.isSet=Za,Pr.isString=$a,Pr.isSymbol=Xa,Pr.isTypedArray=Qa,Pr.isUndefined=function(e){return void 0===e},Pr.isWeakMap=function(e){return Ka(e)&&no(e)==S},Pr.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==pn(e)},Pr.join=function(e,t){return null==e?"":ir.call(e,t)},Pr.kebabCase=Ls,Pr.last=Uo,Pr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=is(r))<0?ar(n+i,0):sr(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):_t(e,Et,i,!0)},Pr.lowerCase=js,Pr.lowerFirst=Ns,Pr.lt=es,Pr.lte=ts,Pr.max=function(e){return e&&e.length?nn(e,Gs,bn):void 0},Pr.maxBy=function(e,t){return e&&e.length?nn(e,$i(t,2),bn):void 0},Pr.mean=function(e){return Mt(e,Gs)},Pr.meanBy=function(e,t){return Mt(e,$i(t,2))},Pr.min=function(e){return e&&e.length?nn(e,Gs,xn):void 0},Pr.minBy=function(e,t){return e&&e.length?nn(e,$i(t,2),xn):void 0},Pr.stubArray=ou,Pr.stubFalse=au,Pr.stubObject=function(){return{}},Pr.stubString=function(){return""},Pr.stubTrue=function(){return!0},Pr.multiply=hu,Pr.nth=function(e,t){return e&&e.length?In(e,is(t)):void 0},Pr.noConflict=function(){return Ge._===this&&(Ge._=Pe),this},Pr.noop=Xs,Pr.now=va,Pr.pad=function(e,t,r){e=us(e);var n=(t=is(t))?Vt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ci(er(i),r)+e+Ci(Qt(i),r)},Pr.padEnd=function(e,t,r){e=us(e);var n=(t=is(t))?Vt(e):0;return t&&n<t?e+Ci(t-n,r):e},Pr.padStart=function(e,t,r){e=us(e);var n=(t=is(t))?Vt(e):0;return t&&n<t?Ci(t-n,r)+e:e},Pr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),fr(us(e).replace(Y,""),t||0)},Pr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&uo(e,t,r)&&(t=r=void 0),void 0===r&&("boolean"==typeof t?(r=t,t=void 0):"boolean"==typeof e&&(r=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ns(e),void 0===t?(t=e,e=0):t=ns(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var i=cr();return sr(e+i*(t-e+We("1e-"+((i+"").length-1))),t)}return Bn(e,t)},Pr.reduce=function(e,t,r){var n=La(e)?bt:xt,i=arguments.length<3;return n(e,$i(t,4),r,i,en)},Pr.reduceRight=function(e,t,r){var n=La(e)?vt:xt,i=arguments.length<3;return n(e,$i(t,4),r,i,tn)},Pr.repeat=function(e,t,r){return t=(r?uo(e,t,r):void 0===t)?1:is(t),Dn(us(e),t)},Pr.replace=function(){var e=arguments,t=us(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pr.result=function(e,t,r){var n=-1,i=(t=ui(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[xo(t[n])];void 0===o&&(n=i,o=r),e=Fa(o)?o.call(e):o}return e},Pr.round=lu,Pr.runInContext=e,Pr.sample=function(e){return(La(e)?zr:Un)(e)},Pr.size=function(e){if(null==e)return 0;if(Na(e))return $a(e)?Vt(e):e.length;var t=no(e);return t==b||t==m?e.size:An(e).length},Pr.snakeCase=Bs,Pr.some=function(e,t,r){var n=La(e)?gt:Gn;return r&&uo(e,t,r)&&(t=void 0),n(e,$i(t,3))},Pr.sortedIndex=function(e,t){return Yn(e,t)},Pr.sortedIndexBy=function(e,t,r){return Jn(e,t,$i(r,2))},Pr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=Yn(e,t);if(n<r&&Ta(e[n],t))return n}return-1},Pr.sortedLastIndex=function(e,t){return Yn(e,t,!0)},Pr.sortedLastIndexBy=function(e,t,r){return Jn(e,t,$i(r,2),!0)},Pr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=Yn(e,t,!0)-1;if(Ta(e[r],t))return r}return-1},Pr.startCase=Ds,Pr.startsWith=function(e,t,r){return e=us(e),r=null==r?0:Jr(is(r),0,e.length),t=Xn(t),e.slice(r,r+t.length)==t},Pr.subtract=pu,Pr.sum=function(e){return e&&e.length?Pt(e,Gs):0},Pr.sumBy=function(e,t){return e&&e.length?Pt(e,$i(t,2)):0},Pr.template=function(e,t,r){var n=Pr.templateSettings;r&&uo(e,t,r)&&(t=void 0),e=us(e),t=ds({},t,n,Fi);var i,o,a=ds({},t.imports,n.imports,Fi),s=ws(a),u=It(a,s),f=0,c=t.interpolate||ce,d="__p += '",h=be((t.escape||ce).source+"|"+c.source+"|"+(c===q?re:ce).source+"|"+(t.evaluate||ce).source+"|$","g"),l="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ze+"]")+"\n";e.replace(h,(function(t,r,n,a,s,u){return n||(n=a),d+=e.slice(f,u).replace(de,zt),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),f=u+t.length,t})),d+="';\n";var p=Ee.call(t,"variable")&&t.variable;if(p){if(ee.test(p))throw new J("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(C,""):d).replace(L,"$1").replace(j,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var b=qs((function(){return he(s,l+"return "+d).apply(void 0,u)}));if(b.source=d,Ua(b))throw b;return b},Pr.times=function(e,t){if((e=is(e))<1||e>9007199254740991)return[];var r=4294967295,n=sr(e,4294967295);e-=4294967295;for(var i=Rt(n,t=$i(t));++r<e;)t(r);return i},Pr.toFinite=ns,Pr.toInteger=is,Pr.toLength=os,Pr.toLower=function(e){return us(e).toLowerCase()},Pr.toNumber=as,Pr.toSafeInteger=function(e){return e?Jr(is(e),-9007199254740991,9007199254740991):0===e?e:0},Pr.toString=us,Pr.toUpper=function(e){return us(e).toUpperCase()},Pr.trim=function(e,t,r){if((e=us(e))&&(r||void 0===t))return Tt(e);if(!e||!(t=Xn(t)))return e;var n=Gt(e),i=Gt(t);return ci(n,Lt(n,i),jt(n,i)+1).join("")},Pr.trimEnd=function(e,t,r){if((e=us(e))&&(r||void 0===t))return e.slice(0,Yt(e)+1);if(!e||!(t=Xn(t)))return e;var n=Gt(e);return ci(n,0,jt(n,Gt(t))+1).join("")},Pr.trimStart=function(e,t,r){if((e=us(e))&&(r||void 0===t))return e.replace(Y,"");if(!e||!(t=Xn(t)))return e;var n=Gt(e);return ci(n,Lt(n,Gt(t))).join("")},Pr.truncate=function(e,t){var r=30,n="...";if(Ha(t)){var i="separator"in t?t.separator:i;r="length"in t?is(t.length):r,n="omission"in t?Xn(t.omission):n}var o=(e=us(e)).length;if(Ut(e)){var a=Gt(e);o=a.length}if(r>=o)return e;var s=r-Vt(n);if(s<1)return n;var u=a?ci(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+n;if(a&&(s+=u.length-s),Ja(i)){if(e.slice(s).search(i)){var f,c=u;for(i.global||(i=be(i.source,us(ne.exec(i))+"g")),i.lastIndex=0;f=i.exec(c);)var d=f.index;u=u.slice(0,void 0===d?s:d)}}else if(e.indexOf(Xn(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+n},Pr.unescape=function(e){return(e=us(e))&&D.test(e)?e.replace(N,Jt):e},Pr.uniqueId=function(e){var t=++Me;return us(e)+t},Pr.upperCase=zs,Pr.upperFirst=Us,Pr.each=ua,Pr.eachRight=fa,Pr.first=No,$s(Pr,(du={},fn(Pr,(function(e,t){Ee.call(Pr.prototype,t)||(du[t]=e)})),du),{chain:!1}),Pr.VERSION="4.17.21",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Pr[e].placeholder=Pr})),st(["drop","take"],(function(e,t){Ir.prototype[e]=function(r){r=void 0===r?1:ar(is(r),0);var n=this.__filtered__&&!t?new Ir(this):this.clone();return n.__filtered__?n.__takeCount__=sr(r,n.__takeCount__):n.__views__.push({size:sr(r,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ir.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Ir.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$i(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),st(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Ir.prototype[e]=function(){return this[r](1).value()[0]}})),st(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Ir.prototype[e]=function(){return this.__filtered__?new Ir(this):this[r](1)}})),Ir.prototype.compact=function(){return this.filter(Gs)},Ir.prototype.find=function(e){return this.filter(e).head()},Ir.prototype.findLast=function(e){return this.reverse().find(e)},Ir.prototype.invokeMap=zn((function(e,t){return"function"==typeof e?new Ir(this):this.map((function(r){return mn(r,e,t)}))})),Ir.prototype.reject=function(e){return this.filter(Aa($i(e)))},Ir.prototype.slice=function(e,t){e=is(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Ir(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),void 0!==t&&(r=(t=is(t))<0?r.dropRight(-t):r.take(t-e)),r)},Ir.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ir.prototype.toArray=function(){return this.take(4294967295)},fn(Ir.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Pr[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Pr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,s=t instanceof Ir,u=a[0],f=s||La(t),c=function(e){var t=i.apply(Pr,pt([e],a));return n&&d?t[0]:t};f&&r&&"function"==typeof u&&1!=u.length&&(s=f=!1);var d=this.__chain__,h=!!this.__actions__.length,l=o&&!d,p=s&&!h;if(!o&&f){t=p?t:new Ir(this);var b=e.apply(t,a);return b.__actions__.push({func:na,args:[c],thisArg:void 0}),new kr(b,d)}return l&&p?e.apply(this,a):(b=this.thru(c),l?n?b.value()[0]:b.value():b)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Pr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[r]((function(r){return t.apply(La(r)?r:[],e)}))}})),fn(Ir.prototype,(function(e,t){var r=Pr[t];if(r){var n=r.name+"";Ee.call(mr,n)||(mr[n]=[]),mr[n].push({name:t,func:r})}})),mr[Ri(void 0,2).name]=[{name:"wrapper",func:void 0}],Ir.prototype.clone=function(){var e=new Ir(this.__wrapped__);return e.__actions__=yi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yi(this.__views__),e},Ir.prototype.reverse=function(){if(this.__filtered__){var e=new Ir(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ir.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=La(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=sr(t,e+a);break;case"takeRight":e=ar(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,f=n?s:a-1,c=this.__iteratees__,d=c.length,h=0,l=sr(u,this.__takeCount__);if(!r||!n&&i==u&&l==u)return ni(e,this.__actions__);var p=[];e:for(;u--&&h<l;){for(var b=-1,v=e[f+=t];++b<d;){var g=c[b],y=g.iteratee,m=g.type,_=y(v);if(2==m)v=_;else if(!_){if(1==m)continue e;break e}}p[h++]=v}return p},Pr.prototype.at=ia,Pr.prototype.chain=function(){return ra(this)},Pr.prototype.commit=function(){return new kr(this.value(),this.__chain__)},Pr.prototype.next=function(){void 0===this.__values__&&(this.__values__=rs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pr.prototype.plant=function(e){for(var t,r=this;r instanceof Tr;){var n=Ro(r);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},Pr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ir){var t=e;return this.__actions__.length&&(t=new Ir(this)),(t=t.reverse()).__actions__.push({func:na,args:[Ho],thisArg:void 0}),new kr(t,this.__chain__)}return this.thru(Ho)},Pr.prototype.toJSON=Pr.prototype.valueOf=Pr.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Pr.prototype.first=Pr.prototype.head,$e&&(Pr.prototype[$e]=function(){return this}),Pr}();Ge._=Zt,void 0===(i=function(){return Zt}.call(t,r,t,n))||(n.exports=i)}).call(this)}).call(this,r(11),r(50)(e))},function(e,t,r){(function(e,r){var n=/^\[object .+?Constructor\]$/,i=/^(?:0|[1-9]\d*)$/,o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1;var a="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),f=t&&!t.nodeType&&t,c=f&&"object"==typeof r&&r&&!r.nodeType&&r,d=c&&c.exports===f,h=d&&a.process,l=function(){try{var e=c&&c.require&&c.require("util").types;return e||h&&h.binding&&h.binding("util")}catch(e){}}(),p=l&&l.isTypedArray;function b(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var v,g,y,m=Array.prototype,_=Function.prototype,w=Object.prototype,S=u["__core-js_shared__"],E=_.toString,M=w.hasOwnProperty,A=(v=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",O=w.toString,x=E.call(Object),P=RegExp("^"+E.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=d?u.Buffer:void 0,T=u.Symbol,k=u.Uint8Array,I=R?R.allocUnsafe:void 0,C=(g=Object.getPrototypeOf,y=Object,function(e){return g(y(e))}),L=Object.create,j=w.propertyIsEnumerable,N=m.splice,B=T?T.toStringTag:void 0,D=function(){try{var e=fe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=R?R.isBuffer:void 0,U=Math.max,F=Date.now,q=fe(u,"Map"),W=fe(Object,"create"),H=function(){function e(){}return function(t){if(!we(t))return{};if(L)return L(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function K(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function V(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function G(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Y(e){var t=this.__data__=new V(e);this.size=t.size}function J(e,t){var r=ve(e),n=!r&&be(e),i=!r&&!n&&ye(e),o=!r&&!n&&!i&&Ee(e),a=r||n||i||o,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var f in e)!t&&!M.call(e,f)||a&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ce(f,u))||s.push(f);return s}function Z(e,t,r){(void 0!==r&&!pe(e[t],r)||void 0===r&&!(t in e))&&Q(e,t,r)}function $(e,t,r){var n=e[t];M.call(e,t)&&pe(n,r)&&(void 0!==r||t in e)||Q(e,t,r)}function X(e,t){for(var r=e.length;r--;)if(pe(e[r][0],t))return r;return-1}function Q(e,t,r){"__proto__"==t&&D?D(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}K.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},K.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},K.prototype.get=function(e){var t=this.__data__;if(W){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return M.call(t,e)?t[e]:void 0},K.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:M.call(t,e)},K.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this},V.prototype.clear=function(){this.__data__=[],this.size=0},V.prototype.delete=function(e){var t=this.__data__,r=X(t,e);return!(r<0)&&(r==t.length-1?t.pop():N.call(t,r,1),--this.size,!0)},V.prototype.get=function(e){var t=this.__data__,r=X(t,e);return r<0?void 0:t[r][1]},V.prototype.has=function(e){return X(this.__data__,e)>-1},V.prototype.set=function(e,t){var r=this.__data__,n=X(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(q||V),string:new K}},G.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return ue(this,e).get(e)},G.prototype.has=function(e){return ue(this,e).has(e)},G.prototype.set=function(e,t){var r=ue(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Y.prototype.clear=function(){this.__data__=new V,this.size=0},Y.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Y.prototype.get=function(e){return this.__data__.get(e)},Y.prototype.has=function(e){return this.__data__.has(e)},Y.prototype.set=function(e,t){var r=this.__data__;if(r instanceof V){var n=r.__data__;if(!q||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(e,t),this.size=r.size,this};var ee,te=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),a=o.length;a--;){var s=o[ee?a:++n];if(!1===t(i[s],s,i))break}return e};function re(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=M.call(e,B),r=e[B];try{e[B]=void 0;var n=!0}catch(e){}var i=O.call(e);n&&(t?e[B]=r:delete e[B]);return i}(e):function(e){return O.call(e)}(e)}function ne(e){return Se(e)&&"[object Arguments]"==re(e)}function ie(e){return!(!we(e)||function(e){return!!A&&A in e}(e))&&(me(e)?P:n).test(function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function oe(e){if(!we(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=de(e),r=[];for(var n in e)("constructor"!=n||!t&&M.call(e,n))&&r.push(n);return r}function ae(e,t,r,n,i){e!==t&&te(t,(function(o,a){if(i||(i=new Y),we(o))!function(e,t,r,n,i,o,a){var s=he(e,r),u=he(t,r),f=a.get(u);if(f)return void Z(e,r,f);var c=o?o(s,u,r+"",e,t,a):void 0,d=void 0===c;if(d){var h=ve(u),l=!h&&ye(u),p=!h&&!l&&Ee(u);c=u,h||l||p?ve(s)?c=s:Se(m=s)&&ge(m)?c=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):l?(d=!1,c=function(e,t){if(t)return e.slice();var r=e.length,n=I?I(r):new e.constructor(r);return e.copy(n),n}(u,!0)):p?(d=!1,b=u,v=!0?(g=b.buffer,y=new g.constructor(g.byteLength),new k(y).set(new k(g)),y):b.buffer,c=new b.constructor(v,b.byteOffset,b.length)):c=[]:function(e){if(!Se(e)||"[object Object]"!=re(e))return!1;var t=C(e);if(null===t)return!0;var r=M.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&E.call(r)==x}(u)||be(u)?(c=s,be(s)?c=function(e){return function(e,t,r,n){var i=!r;r||(r={});var o=-1,a=t.length;for(;++o<a;){var s=t[o],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),i?Q(r,s,u):$(r,s,u)}return r}(e,Me(e))}(s):we(s)&&!me(s)||(c=function(e){return"function"!=typeof e.constructor||de(e)?{}:H(C(e))}(u))):d=!1}var b,v,g,y;var m;d&&(a.set(u,c),i(c,u,n,o,a),a.delete(u));Z(e,r,c)}(e,t,a,r,ae,n,i);else{var s=n?n(he(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),Z(e,a,s)}}),Me)}function se(e,t){return le(function(e,t,r){return t=U(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=U(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),b(e,this,s)}}(e,t,xe),e+"")}function ue(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function fe(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ie(r)?r:void 0}function ce(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&i.test(e))&&e>-1&&e%1==0&&e<t}function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||w)}function he(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var le=function(e){var t=0,r=0;return function(){var n=F(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(D?function(e,t){return D(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:xe);function pe(e,t){return e===t||e!=e&&t!=t}var be=ne(function(){return arguments}())?ne:function(e){return Se(e)&&M.call(e,"callee")&&!j.call(e,"callee")},ve=Array.isArray;function ge(e){return null!=e&&_e(e.length)&&!me(e)}var ye=z||function(){return!1};function me(e){if(!we(e))return!1;var t=re(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function _e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function we(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var Ee=p?function(e){return function(t){return e(t)}}(p):function(e){return Se(e)&&_e(e.length)&&!!o[re(e)]};function Me(e){return ge(e)?J(e,!0):oe(e)}var Ae,Oe=(Ae=function(e,t,r){ae(e,t,r)},se((function(e,t){var r=-1,n=t.length,i=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(i=Ae.length>3&&"function"==typeof i?(n--,i):void 0,o&&function(e,t,r){if(!we(r))return!1;var n=typeof t;return!!("number"==n?ge(r)&&ce(t,r.length):"string"==n&&t in r)&&pe(r[t],e)}(t[0],t[1],o)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var a=t[r];a&&Ae(e,a,r,i)}return e})));function xe(e){return e}r.exports=Oe}).call(this,r(11),r(50)(e))},function(e,t,r){"use strict";var n=r(15),i=r(12),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var 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 f(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,f=[];for(a=0;a<n.length;a+=r.step){u=0;for(var c=a+r.step-1;c>=a;c--)u=(u<<1)+n[c];f.push(u)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a<f.length;a++)(u=f[a])===l?h=h.mixedAdd(r.points[a]):u===-l&&(h=h.mixedAdd(r.points[a].neg()));d=d.add(h)}return d.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),u=this.jpoint(null,null,null),f=a.length-1;f>=0;f--){for(var c=0;f>=0&&0===a[f];f--)c++;if(f>=0&&c++,u=u.dblp(c),f<0)break;var d=a[f];s(0!==d),u="affine"===e.type?d>0?u.mixedAdd(i[d-1>>1]):u.mixedAdd(i[-d-1>>1].neg()):d>0?u.add(i[d-1>>1]):u.add(i[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,f,c=this._wnafT1,d=this._wnafT2,h=this._wnafT3,l=0;for(s=0;s<n;s++){var p=(f=t[s])._getNAFPoints(e);c[s]=p.wnd,d[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,v=s;if(1===c[b]&&1===c[v]){var g=[t[b],null,null,t[v]];0===t[b].y.cmp(t[v].y)?(g[1]=t[b].add(t[v]),g[2]=t[b].toJ().mixedAdd(t[v].neg())):0===t[b].y.cmp(t[v].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[v]),g[2]=t[b].add(t[v].neg())):(g[1]=t[b].toJ().mixedAdd(t[v]),g[2]=t[b].toJ().mixedAdd(t[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[b],r[v]);for(l=Math.max(m[0].length,l),h[b]=new Array(l),h[v]=new Array(l),u=0;u<l;u++){var _=0|m[0][u],w=0|m[1][u];h[b][u]=y[3*(_+1)+(w+1)],h[v][u]=0,d[b]=g}}else h[b]=o(r[b],c[b],this._bitLength),h[v]=o(r[v],c[v],this._bitLength),l=Math.max(h[b].length,l),l=Math.max(h[v].length,l)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(s=l;s>=0;s--){for(var M=0;s>=0;){var A=!0;for(u=0;u<n;u++)E[u]=0|h[u][s],0!==E[u]&&(A=!1);if(!A)break;M++,s--}if(s>=0&&M++,S=S.dblp(M),s<0)break;for(u=0;u<n;u++){var O=E[u];0!==O&&(O>0?f=d[u][O-1>>1]:O<0&&(f=d[u][-O-1>>1].neg()),S="affine"===f.type?S.mixedAdd(f):S.add(f))}}for(s=0;s<n;s++)d[s]=null;return i?S:S.toP()},u.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},f.prototype.encodeCompressed=function(e){return this.encode(e,!0)},f.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},f.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},f.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},f.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},f.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(28);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(t){if(!e.isBuffer(t)){var r="This method only supports Buffer but input was: ".concat(t);throw new Error(r)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(9))},function(e,t,r){var n=r(133);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(i),e.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},function(e,t,r){"use strict";function n(e){let t=e,r=e=>{t=e};return new Proxy({},{get:(e,n)=>"setTarget"===n?r:t[n],set:(e,n,i)=>"setTarget"===n?(r=i,!0):(t[n]=i,!0)})}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"c",(function(){return c})),r.d(t,"d",(function(){return d})),r.d(t,"b",(function(){return h}));var n=r(0),i=r.n(n),o=r(8),a=r(109);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const f=r.n(a)()();function c(e){const t=new o.b;return t.sendAsync=async t=>{const r=await e.handle(t);if(r.error)throw new Error(r.error);return r.result},t.send=(t,r)=>{if("function"!=typeof r)throw new Error('Must provide callback to "send" method.');e.handle(t,r)},e.on&&e.on("notification",e=>{t.emit("data",null,e)}),t.request=async e=>{const r=u(u({},e),{},{id:f(),jsonrpc:"2.0"});return await t.sendAsync(r)},t}function d(e){const t=new o.a;t.push(e);return c(t)}function h(e){return async(t,r,n,i)=>{try{const n=await e.sendAsync(t);return r.result=n,i()}catch(e){return i(e.message)}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(8),i=r(1);function o(e){let{changeProvider:t}=e;return Object(n.c)(async(e,r,n)=>{const{method:o}=e;if(o!==i.p.SET_PROVIDER)return n();if(!t)throw new Error("CommunicationMiddleware - opts.changeProvider not provided");r.result=await t(e)})}function a(e){let{topup:t}=e;return Object(n.c)(async(e,r,n)=>{const{method:o}=e;if(o!==i.p.TOPUP)return n();if(!t)throw new Error("CommunicationMiddleware - opts.topup not provided");r.result=await t(e)})}function s(e,t){return Object(n.c)(async(r,n,i)=>{const{method:o}=r;if(o!==e)return i();if(!t)throw new Error("CommunicationMiddleware - ".concat(e," not provided"));const a=await t(r);if(!a)return i();n.result=a})}function u(e){const{getUserInfo:t,getWalletInstanceId:r,topup:u,logout:f,changeProvider:c,setIFrameStatus:d,handleWindowRpc:h,getProviderState:l,loginWithPrivateKey:p}=e;return Object(n.e)([o({changeProvider:c}),a({topup:u}),Object(n.d)({[i.p.LOGOUT]:f,[i.p.WALLET_INSTANCE_ID]:r,[i.p.USER_INFO]:t,[i.p.IFRAME_STATUS]:d,[i.p.OPENED_WINDOW]:h,[i.p.CLOSED_WINDOW]:h,[i.p.GET_PROVIDER_STATE]:l}),s(i.p.LOGIN_WITH_PRIVATE_KEY,p)])}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i}));const n={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},i={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo",TRANSAK:"transak"}},function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return i}));const n={ACTIVITY_ACTION_ALL:"walletActivity.allTransactions",ACTIVITY_ACTION_SEND:"walletActivity.send",ACTIVITY_ACTION_RECEIVE:"walletActivity.receive",ACTIVITY_ACTION_TOPUP:"walletActivity.topup"},i={NORMAL:"normal",THRESHOLD:"threshold",IMPORTED:"imported"}},function(e,t,r){(function(t){var n=r(40),i=function(){},o=function(e,r,a){if("function"==typeof r)return o(e,null,r);r||(r={}),a=n(a||i);var s=e._writableState,u=e._readableState,f=r.readable||!1!==r.readable&&e.readable,c=r.writable||!1!==r.writable&&e.writable,d=!1,h=function(){e.writable||l()},l=function(){c=!1,f||a.call(e)},p=function(){f=!1,c||a.call(e)},b=function(t){a.call(e,t?new Error("exited with error code: "+t):null)},v=function(t){a.call(e,t)},g=function(){t.nextTick(y)},y=function(){if(!d)return(!f||u&&u.ended&&!u.destroyed)&&(!c||s&&s.ended&&!s.destroyed)?void 0:a.call(e,new Error("premature close"))},m=function(){e.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?c&&!s&&(e.on("end",h),e.on("close",h)):(e.on("complete",l),e.on("abort",g),e.req?m():e.on("request",m)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",b),e.on("end",p),e.on("finish",l),!1!==r.error&&e.on("error",v),e.on("close",g),function(){d=!0,e.removeListener("complete",l),e.removeListener("abort",g),e.removeListener("request",m),e.req&&e.req.removeListener("finish",l),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",l),e.removeListener("exit",b),e.removeListener("end",p),e.removeListener("error",v),e.removeListener("close",g)}};e.exports=o}).call(this,r(9))},function(e,t,r){"use strict";var n=r(26).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},f=t._writableState&&t._writableState.finished,c=function(){s=!1,f=!0,a||o.call(t)},d=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,d=!0,s||o.call(t)},l=function(e){o.call(t,e)},p=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!f?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",c),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",h),t.on("finish",c),!1!==r.error&&t.on("error",l),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",h),t.removeListener("error",l),t.removeListener("close",p)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(62);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}t.EthereumRpcError=i;function o(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";(function(t){var n=r(137);
  /*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
   * @license  MIT
   */function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=r(138),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,f="foo"===function(){}.name;function c(e){return Object.prototype.toString.call(e)}function d(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=y,l=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(a.isFunction(e)){if(f)return e.name;var t=e.toString().match(l);return t&&t[1]}}function b(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function v(e){if(f||!a.isFunction(e))return a.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function y(e,t){e||g(e,!0,t,"==",h.ok)}function m(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(d(e)&&d(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=u.call(e),t=u.call(t),m(e,t,r);var s,f,c=E(e),d=E(t);if(c.length!==d.length)return!1;for(c.sort(),d.sort(),f=c.length-1;f>=0;f--)if(c[f]!==d[f])return!1;for(f=c.length-1;f>=0;f--)if(s=c[f],!m(e[s],t[s],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function S(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return b(v(e.actual),128)+" "+e.operator+" "+b(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=g,h.ok=y,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){m(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){m(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){m(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){m(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){S(!0,e,t,r)},h.doesNotThrow=function(e,t,r){S(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=n((function e(t,r){t||g(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var E=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(11))},function(e,t,r){"use strict";var n,i=t,o=r(53),a=r(87),s=r(12).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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{n=r(155)}catch(e){n=void 0}f("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",n]})},function(e,t,r){var n=t;n.utils=r(16),n.common=r(33),n.sha=r(149),n.ripemd=r(153),n.hmac=r(154),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=r(164),i=r(166),o=r(17),a=r(22),s=r(38);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(r,n){void 0===n&&(n=256),(0,s.assertIsString)(r);var i=e.from(r,"utf8");return(0,t.keccak)(i,n)};t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,a.toBuffer)(e),r)};t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,a.toBuffer)(e),r)};var u=function(e){return e=(0,a.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),u(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),u(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),u(e)};var f=function(e,t){e=(0,a.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,a.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),f(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),f(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),f(e,t)};t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}}).call(this,r(3).Buffer)},function(e,t,r){(t=e.exports=r(94)).Stream=t,t.Readable=t,t.Writable=r(57),t.Duplex=r(23),t.Transform=r(97),t.PassThrough=r(182)},function(e,t,r){var n=r(3),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(39);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var f=Object.create(r(34));f.inherits=r(30);var c={deprecate:r(181)},d=r(95),h=r(56).Buffer,l=i.Uint8Array||function(){};var p,b=r(96);function v(){}function g(e,t){s=s||r(23),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,f=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(M,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),M(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?u(_,e,r,a,i):_(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(23),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),M(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,m(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,d=r.callback;if(m(e,t,!1,t.objectMode?1:f.length,f,c,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),M(e,t)}))}function M(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}f.inherits(y,d),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof l);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,M(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(179).setImmediate,r(11))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=r(17),o=r(28),a=r(22);function s(t){return(0,a.unpadBuffer)(t.toArrayLike(e))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=s,t.bnToRlp=function(e){return s(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,a.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new i.BN(r);if(t===n.Number){var s=new i.BN(r),u=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(s.gt(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return s.toNumber()}return"0x".concat(r.toString("hex"))}}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fillOptionsWithDefaults=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=JSON.parse(JSON.stringify(e));void 0===t.webWorkerSupport&&(t.webWorkerSupport=!0);t.idb||(t.idb={});t.idb.ttl||(t.idb.ttl=45e3);t.idb.fallbackInterval||(t.idb.fallbackInterval=150);e.idb&&"function"==typeof e.idb.onclose&&(t.idb.onclose=e.idb.onclose);t.localstorage||(t.localstorage={});t.localstorage.removeTimeout||(t.localstorage.removeTimeout=6e4);e.methods&&(t.methods=e.methods);t.node||(t.node={});t.node.ttl||(t.node.ttl=12e4);t.node.maxParallelWrites||(t.node.maxParallelWrites=2048);void 0===t.node.useFastPath&&(t.node.useFastPath=!0);return t}},function(e,t,r){"use strict";(function(t,n){var i=r(14).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)o.getRandomValues(r.slice(a,a+65536));else o.getRandomValues(r);if("function"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(11),r(9))},function(e,t,r){e.exports=r(127)(r(130))},function(e,t){e.exports=o,o.default=o,o.stable=u,o.stableStringify=u;var r=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,o,s){var u;void 0===s&&(s=i()),function e(t,r,n,i,o,s,u){var f;if(s+=1,"object"==typeof t&&null!==t){for(f=0;f<i.length;f++)if(i[f]===t)return void a("[Circular]",t,r,o);if(void 0!==u.depthLimit&&s>u.depthLimit)return void a("[...]",t,r,o);if(void 0!==u.edgesLimit&&n+1>u.edgesLimit)return void a("[...]",t,r,o);if(i.push(t),Array.isArray(t))for(f=0;f<t.length;f++)e(t[f],f,f,i,t,s,u);else{var c=Object.keys(t);for(f=0;f<c.length;f++){var d=c[f];e(t[d],d,f,i,t,s,u)}}i.pop()}}(e,"",0,[],void 0,0,s);try{u=0===n.length?JSON.stringify(e,t,o):JSON.stringify(e,f(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function a(e,t,i,o){var a=Object.getOwnPropertyDescriptor(o,i);void 0!==a.get?a.configurable?(Object.defineProperty(o,i,{value:e}),r.push([o,i,t,a])):n.push([t,i,e]):(o[i]=e,r.push([o,i,t]))}function s(e,t){return e<t?-1:e>t?1:0}function u(e,t,o,u){void 0===u&&(u=i());var c,d=function e(t,n,i,o,u,f,c){var d;if(f+=1,"object"==typeof t&&null!==t){for(d=0;d<o.length;d++)if(o[d]===t)return void a("[Circular]",t,n,u);try{if("function"==typeof t.toJSON)return}catch(e){return}if(void 0!==c.depthLimit&&f>c.depthLimit)return void a("[...]",t,n,u);if(void 0!==c.edgesLimit&&i+1>c.edgesLimit)return void a("[...]",t,n,u);if(o.push(t),Array.isArray(t))for(d=0;d<t.length;d++)e(t[d],d,d,o,t,f,c);else{var h={},l=Object.keys(t).sort(s);for(d=0;d<l.length;d++){var p=l[d];e(t[p],p,d,o,t,f,c),h[p]=t[p]}if(void 0===u)return h;r.push([u,n,t]),u[n]=h}o.pop()}}(e,"",0,[],void 0,0,u)||e;try{c=0===n.length?JSON.stringify(d,t,o):JSON.stringify(d,f(t),o)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var h=r.pop();4===h.length?Object.defineProperty(h[0],h[1],h[3]):h[0][h[1]]=h[2]}}return c}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var i=0;i<n.length;i++){var o=n[i];if(o[1]===t&&o[0]===r){r=o[2],n.splice(i,1);break}}return e.call(this,t,r)}}},function(e,t,r){},function(e,t,r){"use strict";(function(t,n){var i;e.exports=A,A.ReadableState=M;r(25).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(65),s=r(3).Buffer,u=t.Uint8Array||function(){};var f,c=r(116);f=c&&c.debuglog?c.debuglog("stream"):function(){};var d,h,l,p=r(117),b=r(67),v=r(68).getHighWaterMark,g=r(26).codes,y=g.ERR_INVALID_ARG_TYPE,m=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(A,a);var S=b.errorOrDestroy,E=["error","close","destroy","pause","resume"];function M(e,t,n){i=i||r(27),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r(32).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function A(e){if(i=i||r(27),!(this instanceof A))return new A(e);var t=this instanceof i;this._readableState=new M(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function O(e,t,r,n,i){f("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(f("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)S(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?S(e,new w):x(e,a,t,!0);else if(a.ended)S(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):k(e,a)):x(e,a,t,!1)}else n||(a.reading=!1,k(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),k(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=b.destroy,A.prototype._undestroy=b.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),O(this,e,t,!1,r)},A.prototype.unshift=function(e){return O(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){d||(d=r(32).StringDecoder);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(T,e))}function T(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function k(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(f("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function C(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){f("readable nexttick read 0"),e.read(0)}function j(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function D(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(z,t,e))}function z(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):R(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",i=!0),t.ended||t.reading?f("reading or ended",i=!1):i&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new _("_read()"))},A.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:v;function s(t,n){f("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,f("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",c),e.removeListener("error",l),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",v),r.removeListener("data",h),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function u(){f("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,N(e))}}(r);e.on("drain",c);var d=!1;function h(t){f("ondata");var n=e.write(t);f("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!d&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function l(t){f("onerror",t),v(),e.removeListener("error",l),0===o(e,"error")&&S(e,t)}function p(){e.removeListener("finish",b),v()}function b(){f("onfinish"),e.removeListener("close",p),v()}function v(){f("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",l),e.once("close",p),e.once("finish",b),e.emit("pipe",r),i.flowing||(f("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?R(this):i.reading||n.nextTick(L,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(C,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(C,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(f("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<E.length;o++)e.on(E[o],this.emit.bind(this,E[o]));return this._read=function(t){f("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(121)),h(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=B,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===l&&(l=r(122)),l(A,e,t)})}).call(this,r(11),r(9))},function(e,t,r){e.exports=r(25).EventEmitter},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,r(9))},function(e,t,r){"use strict";var n=r(26).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=A,A.WritableState=M;var a={deprecate:r(119)},s=r(65),u=r(3).Buffer,f=t.Uint8Array||function(){};var c,d=r(67),h=r(68).getHighWaterMark,l=r(26).codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_METHOD_NOT_IMPLEMENTED,v=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,y=l.ERR_STREAM_DESTROYED,m=l.ERR_STREAM_NULL_VALUES,_=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;function E(){}function M(e,t,a){o=o||r(27),e=e||{},"boolean"!=typeof a&&(a=t instanceof o),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(k,e,t),e._writableState.errorEmitted=!0,S(e,i)):(o(i),e._writableState.errorEmitted=!0,S(e,i),k(e,t))}(e,r,i,t,o);else{var a=R(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),i?n.nextTick(x,e,r,a,o):x(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(e){var t=this instanceof(o=o||r(27));if(!t&&!c.call(A,this))return new A(e);this._writableState=new M(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function O(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,O(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,d=r.callback;if(O(e,t,!1,t.objectMode?1:f.length,f,c,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final((function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(6)(A,s),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(M.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===A&&(e&&e._writableState instanceof M)}})):c=function(e){return e instanceof this},A.prototype.pipe=function(){S(this,new g)},A.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof f);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new _;S(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,s,n,i,o);return f}(this,o,s,e,t,r)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new b("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this,r(11),r(9))},function(e,t,r){"use strict";e.exports=c;var n=r(26).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(27);function f(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(6)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(49),i=r(48),o=n.errorCodes.rpc.internal,a={code:o,message:s(o)};function s(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(d(n.errorValues,r))return n.errorValues[r].message;if(f(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!f(e)}function f(e){return e>=-32099&&e<=-32e3}function c(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=a,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const f={};if(e&&"object"==typeof e&&!Array.isArray(e)&&d(e,"code")&&u(e.code)){const t=e;f.code=t.code,t.message&&"string"==typeof t.message?(f.message=t.message,d(t,"data")&&(f.data=t.data)):(f.message=s(f.code),f.data={originalError:c(e)})}else{f.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;f.message=r&&"string"==typeof r?r:t.message,f.data={originalError:c(e)}}const h=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&h&&"string"==typeof h&&(f.stack=h),f}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),i=r.n(n),o=r(7);const a=(e,t)=>e+t,s=["sync","latest"];class u extends o.a{constructor(e){let{config:t={},state:r={}}=e;super({config:t,state:r}),i()(this,"name","BaseBlockTracker"),i()(this,"_blockResetTimeout",void 0),this.defaultState={_currentBlock:{idempotencyKey:""},_isRunning:!1},this.defaultConfig={blockResetDuration:2e4},this.initialize(),this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this.state._isRunning}getCurrentBlock(){return this.state._currentBlock}async getLatestBlock(){if(this.state._currentBlock)return this.state._currentBlock;return await new Promise(e=>this.once("latest",t=>{t._currentBlock&&e(t._currentBlock)}))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_start(){}_end(){}_newPotentialLatest(e){const t=this.state._currentBlock;t&&e.idempotencyKey===t.idempotencyKey||this._setCurrentBlock(e)}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener)}_onNewListener(){this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this.state._isRunning||(this.state._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this.state._isRunning&&(this.state._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return s.map(e=>this.listenerCount(e)).reduce(a)}_setCurrentBlock(e){const t=this.state._currentBlock;this.update({_currentBlock:e}),this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this.config.blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this.update({_currentBlock:{idempotencyKey:""}})}}},function(e,t,r){},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));const n=()=>!0,i=["newListener","removeListener"],o=e=>!i.includes(e);function a(e,t){let r=(t||{}).eventFilter||n;if("string"==typeof r&&"skipInternal"===r&&(r=o),"function"!=typeof r)throw new Error("createEventEmitterProxy - Invalid eventFilter");let i=e,a=e=>{const t=i;i=e,t.eventNames().filter(r).forEach(r=>{(function(e,t){return e.rawListeners(t)})(t,r).forEach(t=>e.on(r,t))}),t.removeAllListeners()};return new Proxy({},{get:(e,t)=>"setTarget"===t?a:i[t],set:(e,t,r)=>"setTarget"===t?(a=r,!0):(i[t]=r,!0)})}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(7);class i extends n.a{constructor(e){let{config:t={},state:r}=e;super({config:t,state:r}),this.defaultState={currentCurrency:"usd",conversionRate:0,conversionDate:"N/A",nativeCurrency:"ETH"},this.defaultConfig={pollInterval:6e5},this.initialize()}getNativeCurrency(){return this.state.nativeCurrency}setNativeCurrency(e){this.update({nativeCurrency:e,ticker:e})}getCurrentCurrency(){return this.state.currentCurrency}setCurrentCurrency(e){this.update({currentCurrency:e})}getConversionRate(){return this.state.conversionRate}setConversionRate(e){this.update({conversionRate:e})}getConversionDate(){return this.state.conversionDate}setConversionDate(e){this.update({conversionDate:e})}}},function(e,t,r){},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),i=r.n(n),o=r(8),a=r(7),s=r(41),u=r(42),f=r(43);class c extends a.a{constructor(e){let{config:t={},state:r}=e;super({config:t,state:r}),i()(this,"_communicationProviderProxy",void 0),this.defaultState={buttonPosition:"bottom-right",isIFrameFullScreen:!0,apiKey:"torus-default",oauthModalVisibility:!1,loginInProgress:!1,dappMetadata:{name:"",icon:""}},this.initialize()}initializeProvider(e){const t=new o.a,r=Object(f.b)(e);t.push(r);const n=Object(u.c)(t);this.setCommunicationProvider(n)}setCommunicationProvider(e){this._communicationProviderProxy?this._communicationProviderProxy.setTarget(e):this._communicationProviderProxy=Object(s.a)(e)}}},function(e,t,r){"use strict";var n=r(0),i=r.n(n),o=r(8),a=r(1);class s extends o.b{constructor(){super(...arguments),i()(this,"handleWindowRpc",(e,t,r,n)=>{const{method:i,params:o}=e;if(i===a.p.OPENED_WINDOW){const{windowId:e}=o;this.emit("".concat(e,":opened")),t.result=!0,n()}else if(i===a.p.CLOSED_WINDOW){const{windowId:e}=o;this.emit("".concat(e,":closed")),t.result=!0,n()}else r()})}}t.a=s},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(7),i=r(4);class o extends n.a{constructor(e){var t;let{config:r={},state:n}=e;super({config:r,state:n}),this.defaultState={wallets:null!==(t=n.wallets)&&void 0!==t?t:[]},this.initialize()}signAuthMessage(e,t){const r=this.state.wallets.find(t=>t.address===e);if(!r)throw new Error("key does not exist");const n=Object(i.l)(t).toString("hex");return Object(i.p)(r.privateKey,n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(3),i=r(17);t.MAX_UINT64=new i.BN("ffffffffffffffff",16),t.MAX_INTEGER=new i.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new i.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},function(e,t,r){"use strict";(function(e){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var o=i(r(51)),a=r(17),s=r(83),u=r(28),f=r(81),c=r(22),d=r(54),h=r(38),l=r(58),p=function(){function e(e,t,r,n){void 0===e&&(e=new a.BN(0)),void 0===t&&(t=new a.BN(0)),void 0===r&&(r=f.KECCAK256_RLP),void 0===n&&(n=f.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,i=t.stateRoot,o=t.codeHash;return new e(r?new a.BN((0,c.toBuffer)(r)):void 0,n?new a.BN((0,c.toBuffer)(n)):void 0,i?(0,c.toBuffer)(i):void 0,o?(0,c.toBuffer)(o):void 0)},e.fromRlpSerializedAccount=function(e){var t=a.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=n(t,4),i=r[0],o=r[1],s=r[2],u=r[3];return new e(new a.BN(i),new a.BN(o),s,u)},e.prototype._validate=function(){if(this.nonce.lt(new a.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new a.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return a.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(f.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(f.KECCAK256_NULL)},e}();t.Account=p;t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,u.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,l.toType)(t,l.TypeOutput.BN).toString()+"0x");for(var i=(0,d.keccakFromString)(n+r).toString("hex"),o="0x",a=0;a<r.length;a++)parseInt(i[a],16)>=8?o+=r[a].toUpperCase():o+=r[a];return o};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(t,r){(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r);var n=new a.BN(r);return n.isZero()?(0,d.rlphash)([t,null]).slice(-20):(0,d.rlphash)([t,e.from(n.toArray())]).slice(-20)};t.generateAddress2=function(t,r,n){return(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,h.assertIsBuffer)(n),(0,o.default)(20===t.length),(0,o.default)(32===r.length),(0,d.keccak256)(e.concat([e.from("ff","hex"),t,r,(0,d.keccak256)(n)])).slice(-20)};t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)};t.isValidPublic=function(t,r){return void 0===r&&(r=!1),(0,h.assertIsBuffer)(t),64===t.length?(0,s.publicKeyVerify)(e.concat([e.from([4]),t])):!!r&&(0,s.publicKeyVerify)(t)};t.pubToAddress=function(t,r){return void 0===r&&(r=!1),(0,h.assertIsBuffer)(t),r&&64!==t.length&&(t=e.from((0,s.publicKeyConvert)(t,!1).slice(1))),(0,o.default)(64===t.length),(0,d.keccak)(t).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(t){return(0,h.assertIsBuffer)(t),e.from((0,s.publicKeyCreate)(t,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(t){return(0,h.assertIsBuffer)(t),64!==t.length&&(t=e.from((0,s.publicKeyConvert)(t,!1).slice(1))),t};t.zeroAddress=function(){var e=(0,c.zeros)(20);return(0,c.bufferToHex)(e)};t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[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,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(84),a=r(163);t.createPrivateKey=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,a.getRandomBytes(32)];case 1:return e=t.sent(),o.privateKeyVerify(e)?[2,e]:[3,0];case 2:return[2]}}))}))},t.createPrivateKeySync=function(){for(;;){var e=a.getRandomBytesSync(32);if(o.privateKeyVerify(e))return e}},function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(84))},function(e,t,r){e.exports=r(141)(r(142))},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(145);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n=t;n.base=r(37),n.short=r(146),n.mont=r(147),n.edwards=r(148)},function(e,t,r){"use strict";var n=r(16).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(16),i=r(33),o=r(88),a=r(21),s=n.sum32,u=n.sum32_4,f=n.sum32_5,c=o.ch32,d=o.maj32,h=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,v=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,v),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],v=this.h[2],g=this.h[3],y=this.h[4],m=this.h[5],_=this.h[6],w=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var S=f(w,l(y),c(y,m,_),this.k[n],r[n]),E=s(h(i),d(i,o,v));w=_,_=m,m=y,y=s(g,S),g=v,v=o,o=i,i=s(S,E)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],v),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],m),this.h[6]=s(this.h[6],_),this.h[7]=s(this.h[7],w)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(16),i=r(33),o=r(21),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,f=n.shr64_lo,c=n.sum64,d=n.sum64_hi,h=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,v=n.sum64_5_lo,g=i.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 m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function S(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function E(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function M(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,1)^s(e,t,8)^f(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,19)^s(t,e,29)^f(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(m,g),e.exports=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=T(r[n-4],r[n-3]),o=k(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=P(r[n-30],r[n-29]),f=R(r[n-30],r[n-29]),c=r[n-32],d=r[n-31];r[n]=l(i,o,a,s,u,f,c,d),r[n+1]=p(i,o,a,s,u,f,c,d)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],f=this.h[5],l=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],m=this.h[10],P=this.h[11],R=this.h[12],T=this.h[13],k=this.h[14],I=this.h[15];o(this.k.length===r.length);for(var C=0;C<r.length;C+=2){var L=k,j=I,N=O(g,y),B=x(g,y),D=_(g,y,m,P,R),z=w(g,y,m,P,R,T),U=this.k[C],F=this.k[C+1],q=r[C],W=r[C+1],H=b(L,j,N,B,D,z,U,F,q,W),K=v(L,j,N,B,D,z,U,F,q,W);L=M(n,i),j=A(n,i),N=S(n,i,a,s,u),B=E(n,i,a,s,u,f);var V=d(L,j,N,B),G=h(L,j,N,B);k=R,I=T,R=m,T=P,m=g,P=y,g=d(l,p,H,K),y=h(p,p,H,K),l=u,p=f,u=a,f=s,a=n,s=i,n=d(H,K,V,G),i=h(H,K,V,G)}c(this.h,0,n,i),c(this.h,2,a,s),c(this.h,4,u,f),c(this.h,6,l,p),c(this.h,8,g,y),c(this.h,10,m,P),c(this.h,12,R,T),c(this.h,14,k,I)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(14).Buffer,i=r(18).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(6)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){var n=r(6),i=r(29),o=r(14).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function l(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var y=0;y<64;++y){var m=v+h(u)+f(u,p,b)+a[y]+r[y]|0,_=d(n)+c(n,i,o)|0;v=b,b=p,p=u,u=s+m|0,s=o,o=i,i=n,n=m+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(6),i=r(29),o=r(14).Buffer,a=[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],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,E=0|this._dl,M=0|this._el,A=0|this._fl,O=0|this._gl,x=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var R=t[P-30],T=t[P-30+1],k=l(R,T),I=p(T,R),C=b(R=t[P-4],T=t[P-4+1]),L=v(T,R),j=t[P-14],N=t[P-14+1],B=t[P-32],D=t[P-32+1],z=I+N|0,U=k+j+g(z,I)|0;U=(U=U+C+g(z=z+L|0,L)|0)+B+g(z=z+D|0,D)|0,t[P]=U,t[P+1]=z}for(var F=0;F<160;F+=2){U=t[F],z=t[F+1];var q=c(r,n,i),W=c(_,w,S),H=d(r,_),K=d(_,r),V=h(s,M),G=h(M,s),Y=a[F],J=a[F+1],Z=f(s,u,y),$=f(M,A,O),X=x+G|0,Q=m+V+g(X,x)|0;Q=(Q=(Q=Q+Z+g(X=X+$|0,$)|0)+Y+g(X=X+J|0,J)|0)+U+g(X=X+z|0,z)|0;var ee=K+W|0,te=H+q+g(ee,K)|0;m=y,x=O,y=u,O=A,u=s,A=M,s=o+Q+g(M=E+X|0,E)|0,o=i,E=S,i=n,S=w,n=r,w=_,r=Q+te+g(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+M|0,this._fl=this._fl+A|0,this._gl=this._gl+O|0,this._hl=this._hl+x|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,M)|0,this._fh=this._fh+u+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,O)|0,this._hh=this._hh+m+g(this._hl,x)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";(function(t,n){var i=r(39);e.exports=m;var o,a=r(66);m.ReadableState=y;r(25).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(95),f=r(56).Buffer,c=t.Uint8Array||function(){};var d=Object.create(r(34));d.inherits=r(30);var h=r(176),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(177),v=r(96);d.inherits(m,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(23));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(32).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function m(e){if(o=o||r(23),!(this instanceof m))return new m(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}(e,a)):(i||(o=function(e,t){var r;n=t,f.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=function(e){return f.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):A(e,a)):w(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),A(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=v.destroy,m.prototype._undestroy=v.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},m.prototype.unshift=function(e){return _(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return p||(p=r(32).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(M,e):M(e))}function M(e){l("emit readable"),e.emit("readable"),R(e)}function A(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(O,e,t))}function O(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function x(e){l("readable nexttick read 0"),e.read(0)}function P(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function k(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(I,t,e))}function I(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function C(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}m.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?k(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&k(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?T(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&k(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:m;function f(t,n){l("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,l("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",d),e.removeListener("error",v),e.removeListener("unpipe",f),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",b),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",f);var d=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,R(e))}}(r);e.on("drain",d);var h=!1;var p=!1;function b(t){l("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==C(o.pipes,e))&&!h&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){l("onerror",t),m(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),m()}function y(){l("onfinish"),e.removeListener("close",g),m()}function m(){l("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=C(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},m.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(x,this))}return r},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(P,e,t))}(this,e)),this},m.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=T}).call(this,r(11),r(9))},function(e,t,r){e.exports=r(25).EventEmitter},function(e,t,r){"use strict";var n=r(39);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";e.exports=a;var n=r(23),i=Object.create(r(34));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(30),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){},function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return c}));var n=r(8),i=r(19);const o=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function a(e){switch(e.status){case 405:throw i.ethErrors.rpc.methodNotFound();case 418:throw i.ethErrors.rpc.internal({message:"Request is being rate limited."});case 503:case 504:throw i.ethErrors.rpc.internal({message:"Gateway timeout. The request took too long to process.This can happen when querying over too wide a block range."})}}function s(e){return new Promise(t=>setTimeout(t,e))}function u(e,t){if(200!==e.status)throw i.ethErrors.rpc.internal({message:"Non-200 status code: '".concat(e.status,"'"),data:t});if(t.error)throw i.ethErrors.rpc.internal({data:t.error});return t.result}function f(e){let{req:t,rpcTarget:r,originHttpHeaderKey:n}=e;const i=new URL(r),o={id:t.id,jsonrpc:t.jsonrpc,method:t.method,params:t.params},a=t.origin,s={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)};return n&&a&&(s.headers[n]=a),{fetchUrl:i.href,fetchParams:s}}function c(e){let{rpcTarget:t,originHttpHeaderKey:r}=e;return Object(n.c)(async(e,n,i)=>{const{fetchUrl:c,fetchParams:d}=f({req:e,rpcTarget:t,originHttpHeaderKey:r});for(let e=0;e<5;e++){try{const e=await fetch(c,d);a(e);const t=await e.json(),r=u(e,t);return void(n.result=r)}catch(e){const t=e.toString();if(!o.some(e=>t.includes(e)))throw e}await s(1e3)}})}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),i=r.n(n);function o(e){return function(t,r,n){n(n=>{r.error&&i.a.warn("Error in RPC response:\n",r),t.isTorusInternal||(i.a.info("RPC (".concat(e.origin,"):"),t,"->",r),n())})}}},function(e,t,r){"use strict";function n(e){return function(t,r,n){t.origin=e.origin,n()}}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.r(t),r.d(t,"ObliviousSet",(function(){return n})),r.d(t,"removeTooOldValues",(function(){return i})),r.d(t,"now",(function(){return o}));var n=function(){function e(e){this.ttl=e,this.set=new Set,this.timeMap=new Map}return e.prototype.has=function(e){return this.set.has(e)},e.prototype.add=function(e){var t=this;this.timeMap.set(e,o()),this.set.add(e),setTimeout((function(){i(t)}),0)},e.prototype.clear=function(){this.set.clear(),this.timeMap.clear()},e}();function i(e){for(var t=o()-e.ttl,r=e.set[Symbol.iterator]();;){var n=r.next().value;if(!n)return;if(!(e.timeMap.get(n)<t))return;e.timeMap.delete(n),e.set.delete(n)}}function o(){return(new Date).getTime()}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),i=r.n(n),o=r(35),a=r(7),s=r(4),u=r(5);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class d extends a.a{constructor(e){let{config:t,state:r,getCurrentChainId:n}=e;super({config:t,state:r}),i()(this,"getCurrentChainId",void 0),this.defaultConfig={txHistoryLimit:40},this.defaultState={transactions:{},unapprovedTxs:{},currentNetworkTxsList:[]},this.initialize(),this.getCurrentChainId=n}getUnapprovedTxList(){const e=this.getCurrentChainId();return Object(o.pickBy)(this.state.transactions,t=>t.status===u.c.unapproved&&Object(s.s)(t,e))}getTransaction(e){const{transactions:t}=this.state;return t[e]}updateTransaction(e){const t=e.id;e.updated_at=(new Date).toISOString(),this.update({transactions:c(c({},this.state.transactions),{},{[t]:e})})}setTxStatusRejected(e){this._setTransactionStatus(e,u.c.rejected),this._deleteTransaction(e)}setTxStatusUnapproved(e){this._setTransactionStatus(e,u.c.unapproved)}setTxStatusApproved(e){this._setTransactionStatus(e,u.c.approved)}setTxStatusSigned(e){this._setTransactionStatus(e,u.c.signed)}setTxStatusSubmitted(e){this._setTransactionStatus(e,u.c.submitted)}setTxStatusDropped(e){this._setTransactionStatus(e,u.c.dropped)}setTxStatusExpired(e){this._setTransactionStatus(e,u.c.expired)}setTxStatusConfirmed(e){this._setTransactionStatus(e,u.c.confirmed)}setTxStatusFailed(e,t){const r=t||new Error("Internal torus failure"),n=this.getTransaction(e);n.error=r,this.updateTransaction(n),this._setTransactionStatus(e,u.c.failed)}isFinalState(e){return e===u.c.rejected||e===u.c.submitted||e===u.c.confirmed||e===u.c.failed||e===u.c.cancelled||e===u.c.expired}clearUnapprovedTxs(){this.update({transactions:Object(o.omitBy)(this.state.transactions,e=>e.status===u.c.unapproved)})}_addTransactionsToState(e){this.update({transactions:e.reduce((e,t)=>(e[t.id]=t,e),this.state.transactions)})}_setTransactionsToState(e){this.update({transactions:e.reduce((e,t)=>(e[t.id]=t,e),{})})}_deleteTransaction(e){const{transactions:t}=this.state;delete t[e],this.update({transactions:t})}_deleteTransactions(e){const{transactions:t}=this.state;e.forEach(e=>{delete t[e]}),this.update({transactions:t})}_setTransactionStatus(e,t){const r=this.getTransaction(e);r&&(r.status=t,this.updateTransaction(r),this.emit(u.b.TX_STATUS_UPDATE,{txId:e,status:t}),this.isFinalState(t)?this.emit("".concat(r.id,":finished"),r):this.emit("".concat(r.id,":").concat(t),e))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return b})),r.d(t,"c",(function(){return v})),r.d(t,"d",(function(){return g})),r.d(t,"e",(function(){return m})),r.d(t,"f",(function(){return l}));var n=r(0),i=r.n(n),o=r(10),a=r(1),s=r(4);class u{constructor(e){i()(this,"bc",void 0),i()(this,"channel",void 0);const t=new URLSearchParams(window.location.search).get("instanceId");this.channel="".concat(e,"_").concat(t),this.bc=new o.BroadcastChannel(this.channel,s.c)}getMessageFromChannel(){return new Promise((e,t)=>{this.bc.addEventListener("message",async r=>{this.bc.close(),r.error?t(r.error):e(r.data)}),this.bc.postMessage({data:{type:a.v}})})}}var f=r(7),c=r(2),d=r.n(c);class h extends f.a{constructor(e){let{config:t,state:r={}}=e;super({config:t,state:r}),i()(this,"closed",!1),this.initialize()}async open(){return new Promise((e,t)=>{const{communicationEngine:r,communicationWindowManager:n}=this.config;if(n.once("".concat(this.state.windowId,":closed"),()=>{this.closed=!0}),this.state.windowId){const r=new o.BroadcastChannel(this.state.windowId,s.c);let n=null;r.addEventListener("message",async i=>{try{d.a.info(i,"receiving data on channel: ".concat(r.name));const{error:o}=i;if(o)return void t(new Error(o));const{message:s}=i.data;s===a.v&&(n&&window.clearInterval(n),await r.postMessage({data:{url:this.state.url.href,message:""}}),e(this),r.close())}catch(e){t(e),r.close(),this.close()}}),n=window.setInterval(()=>{r.postMessage({data:{message:a.z}})},200)}else this.update({windowId:Object(s.o)()}),n.once("".concat(this.state.windowId,":opened"),()=>{e(this)}),r.emit("notification",{method:a.q.CREATE_WINDOW,params:{windowId:this.state.windowId,url:this.state.url.href}})})}close(){const{communicationEngine:e}=this.config;e.emit("notification",{method:a.q.CLOSE_WINDOW,params:{windowId:this.state.windowId}})}}var l=h;class p extends f.a{constructor(e){let{config:t,state:r}=e;super({config:t,state:r}),this.defaultConfig={dappStorageKey:"",features:Object(s.i)(a.s),target:"_blank",communicationEngine:null,communicationWindowManager:null},this.defaultState={windowTimer:null,window:null,iClosedWindow:!1,windowId:"",url:r.url},this.initialize(),this._setupTimer()}async open(){const{target:e,features:t,dappStorageKey:r,communicationEngine:n,communicationWindowManager:i}=this.config,{windowId:o,url:a}=this.state;if(r){const e=new URLSearchParams(a.hash.slice(1));e.append("dappStorageKey",r),a.hash=e.toString(),this.update({url:a})}if(!o){let r=window.open(a.href,e,t);return r||(r=new l({config:{communicationEngine:n,communicationWindowManager:i},state:{url:a}}),r.open()),void this.update({window:r})}const s=new l({config:{communicationEngine:n,communicationWindowManager:i},state:{url:a,windowId:o}});this.update({window:s}),await s.open()}close(){this.update({iClosedWindow:!0});const{window:e}=this.state;e&&e.close()}_setupTimer(){const e=window.setInterval(()=>{const{window:e,windowTimer:t,iClosedWindow:r}=this.state;e&&e.closed&&(t&&clearInterval(t),r||this.emit("close"),this.update({iClosedWindow:!1,window:null})),null===e&&t&&clearInterval(t)},500);this.update({windowTimer:e})}}var b=p;class v{constructor(e){let{instanceId:t,handleLogout:r,handleAccountImport:n,handleNetworkChange:o,handleSelectedAddressChange:a}=e;i()(this,"handleLogout",void 0),i()(this,"handleAccountImport",void 0),i()(this,"handleNetworkChange",void 0),i()(this,"handleSelectedAddressChange",void 0),i()(this,"instanceId",void 0),this.instanceId=t,this.handleLogout=r,this.handleAccountImport=n,this.handleNetworkChange=o,this.handleSelectedAddressChange=a}setupStoreChannels(){this.logoutChannel(),this.importAccountChannel(),this.networkChangeChannel(),this.selectedAddressChangeChannel()}logoutChannel(){new o.BroadcastChannel("".concat(a.n.WALLET_LOGOUT_CHANNEL,"_").concat(this.instanceId),s.c).addEventListener("message",e=>{var t;d.a.info("received logout message",e),e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.o.LOGOUT||(d.a.info("Logging Out"),this.handleLogout())})}importAccountChannel(){new o.BroadcastChannel("".concat(a.n.WALLET_ACCOUNT_IMPORT_CHANNEL,"_").concat(this.instanceId),s.c).addEventListener("message",e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.o.ACCOUNT_IMPORTED||this.handleAccountImport(null===(r=e.data)||void 0===r?void 0:r.privKey)})}networkChangeChannel(){new o.BroadcastChannel("".concat(a.n.WALLET_NETWORK_CHANGE_CHANNEL,"_").concat(this.instanceId),s.c).addEventListener("message",e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.o.NETWORK_CHANGE||this.handleNetworkChange(null===(r=e.data)||void 0===r?void 0:r.network)})}selectedAddressChangeChannel(){new o.BroadcastChannel("".concat(a.n.WALLET_SELECTED_ADDRESS_CHANNEL,"_").concat(this.instanceId),s.c).addEventListener("message",e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.o.SELECTED_ADDRESS_CHANGE||this.handleSelectedAddressChange(null===(r=e.data)||void 0===r?void 0:r.selectedAddress)})}}var g=class extends b{constructor(e){let{config:t,state:r,instanceId:n}=e;super({config:t,state:r}),i()(this,"bc",void 0),this.bc=new o.BroadcastChannel(n,s.c)}handle(e){return new Promise((t,r)=>{const n=()=>{this.bc.close(),r(new s.a("user closed popup")),this.removeListener("close",n)};this.on("close",n),this.bc.addEventListener("message",async n=>{d.a.info(n,"receiving data on channel: ".concat(this.bc.name));try{const{error:i,data:o}=n;if(i)return void r(new Error(i));e&&await e.call(this,o),t(o)}catch(e){r(e)}finally{this.bc.close(),this.close()}}),this.open().then(()=>{d.a.info("opened window ".concat(this.bc.name))}).catch(e=>{d.a.error(e,"something went wrong while opening window"),r(e)})})}handleWithHandshake(e,t){return new Promise((r,n)=>{const i=()=>{this.bc.close(),n(new s.a("user closed popup")),this.removeListener("close",i)};this.on("close",i),this.bc.addEventListener("message",async i=>{try{d.a.info(i,"receiving data on channel: ".concat(this.bc.name));const{error:o,data:s}=i;if(o)return void n(new Error(o));const{type:u=""}=s;u===a.v?await this.bc.postMessage({data:e}):u===a.w&&(t&&await t.call(this,s),r(s),this.bc.close(),this.close())}catch(e){n(e),this.bc.close(),this.close()}}),this.open().then(()=>{d.a.info("opened window ".concat(this.bc.name))}).catch(e=>{d.a.error(e,"something went wrong while opening window"),n(e)})})}},y=r(31);class m{constructor(){i()(this,"error",void 0),i()(this,"finalQueryParams",{}),i()(this,"instanceParameters",void 0),i()(this,"hashParameters",void 0);const{hash:e}=window.location;new URLSearchParams(window.location.search).forEach((e,t)=>{this.finalQueryParams[t]=e});const{error:t,instanceParameters:r,hashParameters:n}=Object(y.j)(e,this.finalQueryParams);this.error=t,this.instanceParameters=r,this.hashParameters=n}async handle(){return new Promise((e,t)=>{const{finalQueryParams:r,instanceParameters:n,hashParameters:i,error:s}=this;let u;try{r.windowId?(u=new o.BroadcastChannel("".concat(r.windowId),y.c),u.addEventListener("message",async t=>{const{url:n,message:i}=t.data;n?(e(),window.location.href=n):i===a.z&&await u.postMessage({data:{windowId:r.windowId,message:a.v}}),t.error&&""!==t.error&&(d.a.error(t.error),e(),u.close())})):(u=new o.BroadcastChannel("".concat(a.n.REDIRECT_CHANNEL,"_").concat(n.instanceId),y.c),u.addEventListener("message",async o=>{o.error?(t(o.error),window.close()):(e(),u.close(),d.a.info("posted",{finalQueryParams:r,hashParameters:i,instanceParameters:n}))}),u.postMessage({data:{instanceParams:n,hashParams:i,queryParams:r},error:s}),setTimeout(()=>{e(),window.location.href=window.location.origin+window.location.search+window.location.hash},5e3))}catch(e){d.a.info(e,"something went wrong"),t(e),u&&u.close(),window.close()}})}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return R})),r.d(t,"a",(function(){return T}));var n=r(0),i=r.n(n),o=r(36),a=r.n(o),s=r(2),u=r.n(s);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const d=u.a.getLogger("http-helpers");d.setLevel(s.levels.INFO);let h="torus-default",l="";function p(){const e={};return h&&(e["x-api-key"]=h),l&&(e["x-embed-host"]=l),e}function b(e){d.info("Response: ".concat(e.status," ").concat(e.statusText)),d.info("Url: ".concat(e.url))}const v=(e,t)=>{const r=new Promise((t,r)=>{const n=setTimeout(()=>{clearTimeout(n),r(new Error("Timed out in ".concat(e,"ms")))},e)});return Promise.race([t,r])},g=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={mode:"cors",headers:{}};r.useAPIKey&&(n.headers=c(c({},n.headers),p()));const i=a()(n,t,{method:"GET"}),o=await fetch(e,i);if(o.ok)return o.json();throw b(o),o},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};n.useAPIKey&&(i.headers=c(c({},i.headers),p()));const o=a()(i,r,{method:"POST"});return n.isUrlEncodedData?(o.body=t,"application/json; charset=utf-8"===o.headers["Content-Type"]&&delete o.headers["Content-Type"]):o.body=JSON.stringify(t),v(n.timeout||6e4,fetch(e,o).then(e=>{if(e.ok)return e.json();throw b(e),e}))},m=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};n.useAPIKey&&(i.headers=c(c({},i.headers),p()));const o=a()(i,r,{method:"PATCH"});n.isUrlEncodedData?(o.body=t,"application/json; charset=utf-8"===o.headers["Content-Type"]&&delete o.headers["Content-Type"]):o.body=JSON.stringify(t);const s=await fetch(e,o);if(s.ok)return s.json();throw b(s),s};var _=r(112),w=r.n(_),S=r(35),E=r(7),M=r(44),A=r(4),O=r(45);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const R={selectedCurrency:"USD",theme:"dark",locale:"en-US",accountType:O.a.NORMAL,contacts:[],jwtToken:"",fetchedPastTx:[],pastTransactions:[],paymentTx:[],defaultPublicAddress:"",customTokens:[],customNfts:[],crashReport:!0,userInfo:{aggregateVerifier:"",email:"",name:"",profileImage:"",typeOfLogin:M.a.GOOGLE,verifier:"",verifierId:""}};class T extends E.a{constructor(e){let{config:t,state:r,defaultPreferences:n,signAuthMessage:o}=e;if(super({config:t,state:r}),i()(this,"name","PreferencesController"),i()(this,"iframeOrigin",void 0),i()(this,"signAuthMessage",void 0),i()(this,"defaultPreferences",void 0),!t.api)throw new Error("PreferencesController - no api specified in config.");this.defaultState={identities:{},selectedAddress:"",lastErrorMessage:"",lastSuccessMessage:""},this.defaultConfig={api:t.api,pollInterval:18e4},this.initialize(),this.defaultPreferences=P(P({},R),n),this.signAuthMessage=o}setIframeOrigin(e){this.iframeOrigin=e}getAddressState(e){const t=e||this.state.selectedAddress;return this.state.identities[t]}setSelectedAddress(e){this.update({selectedAddress:e})}async getUser(e){return(await g("".concat(this.config.api,"/user?fetchTx=false"),this.headers(e),{useAPIKey:!0})).data}async createUser(e){const{selectedCurrency:t,theme:r,verifier:n,verifierId:i,locale:o,address:a}=e,s={default_currency:t,theme:r,verifier:n,verifier_id:i,locale:o};await y("".concat(this.config.api,"/user"),s,this.headers(a),{useAPIKey:!0}),this.updateState({theme:r,defaultPublicAddress:a,selectedCurrency:t,locale:o},a)}async storeUserLogin(e){const{verifierId:t,verifier:r,options:n,address:i}=e;if(!n.rehydrate){const e=w.a.getParser(window.navigator.userAgent),n=Object(A.h)(),o={os:e.getOSName(),os_version:e.getOSVersion()||"unidentified",browser:(null==n?void 0:n.browser)||e.getBrowserName()||"unidentified",browser_version:e.getBrowserVersion()||"unidentified",platform:e.getPlatform().type||"desktop",hostname:this.iframeOrigin,verifier:r,verifier_id:t};await y("".concat(this.config.api,"/user/recordLogin"),o,this.headers(i),{useAPIKey:!0})}}async setCrashReport(e){var t;if(e===(null===(t=this.getAddressState())||void 0===t?void 0:t.crashReport))return!0;try{return await m("".concat(this.config.api,"/user"),{enable_crash_reporter:e},this.headers(),{useAPIKey:!0}),this.updateState({crashReport:e}),!0}catch(e){return u.a.error(e),!1}}async setUserTheme(e){var t;if(e===(null===(t=this.getAddressState())||void 0===t?void 0:t.theme))return!0;try{return await m("".concat(this.config.api,"/user"),{theme:e},this.headers(),{useAPIKey:!0}),this.updateState({theme:e}),!0}catch(e){return u.a.error(e),!1}}async setUserLocale(e){var t;if(e!==(null===(t=this.getAddressState())||void 0===t?void 0:t.locale))try{return await m("".concat(this.config.api,"/user"),{locale:e},this.headers(),{useAPIKey:!0}),this.updateState({locale:e}),!0}catch(e){return u.a.error("unable to set locale",e),!1}}async setSelectedCurrency(e){var t;if(e.selectedCurrency===(null===(t=this.getAddressState())||void 0===t?void 0:t.selectedCurrency))return!0;try{return await m("".concat(this.config.api,"/user"),{default_currency:e.selectedCurrency},this.headers(),{useAPIKey:!0}),this.updateState({selectedCurrency:e.selectedCurrency}),!0}catch(e){return u.a.error(e),!1}}async addContact(e){try{var t;const r=await y("".concat(this.config.api,"/contact"),e,this.headers(),{useAPIKey:!0});return this.updateState({contacts:[...(null===(t=this.getAddressState())||void 0===t?void 0:t.contacts)||[],r.data]}),!0}catch(e){return u.a.error("unable to add contact",e),!1}}async deleteContact(e){try{var t;const r=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};n.useAPIKey&&(i.headers=c(c({},i.headers),p()));const o=a()(i,r,{method:"DELETE"});n.isUrlEncodedData?(o.body=t,"application/json; charset=utf-8"===o.headers["Content-Type"]&&delete o.headers["Content-Type"]):o.body=JSON.stringify(t);const s=await fetch(e,o);if(s.ok)return s.json();throw b(s),s}("".concat(this.config.api,"/contact/").concat(e),{},this.headers(),{useAPIKey:!0}),n=null===(t=this.getAddressState())||void 0===t?void 0:t.contacts.filter(e=>e.id!==r.data.id);return n&&this.updateState({contacts:[...n]}),!0}catch(e){return u.a.error("unable to delete contact",e),!1}}async revokeDiscord(e){try{const t=await y("".concat(this.config.api,"/revoke/discord"),{token:e},this.headers(),{useAPIKey:!0});u.a.info(t)}catch(e){u.a.error(e)}}async patchPastTx(e,t){try{const r=await m("".concat(this.config.api,"/transaction"),e,this.headers(t),{useAPIKey:!0});u.a.info("successfully patched",r)}catch(e){u.a.error("unable to patch tx",e)}}async postPastTx(e,t){try{const r=await y("".concat(this.config.api,"/transaction"),e,this.headers(t),{useAPIKey:!0});return u.a.info("successfully posted tx",r),r}catch(e){u.a.error(e,"unable to insert transaction")}}async getWalletOrders(e){try{const t=await g("".concat(this.config.api,"/transaction"),this.headers(e),{useAPIKey:!0});return t.success&&t.data?t.data:[]}catch(e){return u.a.error("unable to get wallet orders tx",e),[]}}async getTopUpOrders(e){try{return(await g("".concat(this.config.commonApiHost,"/transaction"),this.headers(e),{useAPIKey:!0})).data||[]}catch(e){u.a.error("unable to fetch past Top up orders",e)}}async getBillBoardData(){try{const e=await g("".concat(this.config.api,"/billboard"),this.headers(),{useAPIKey:!0});return e.success?e.data:[]}catch(e){return u.a.error("unable to get billboard data",e),[]}}async getMessageForSigning(e){return(await y("".concat(this.config.api,"/auth/message"),{public_address:e},{},{useAPIKey:!0})).message}async getTwitterId(e){const t=await g("".concat(this.config.api,"/twitter?screen_name=").concat(e.nick),this.headers(),{useAPIKey:!0});return"".concat(e.typeOfLogin.toLowerCase(),"|").concat(t.data.toString())}async sendEmail(e){return y("".concat(this.config.api,"/transaction/sendemail"),e.emailObject,this.headers(),{useAPIKey:!0})}async refreshJwt(){const e=this.state.selectedAddress,t=await this.getMessageForSigning(e);if(!t.startsWith(this.config.signInPrefix))throw new Error("Cannot sign on invalid message");const r=this.signAuthMessage(e,t),n=await y("".concat(this.config.api,"/auth/verify"),{public_address:e,signed_message:r},{},{useAPIKey:!0});this.updateState({jwtToken:n.token},e)}async getDappList(){try{const e=await g("".concat(this.config.api,"/dapps"),this.headers(),{useAPIKey:!0});return e.success?e.data:[]}catch(e){return u.a.error("unable to get billboard data",e),[]}}async init(e,t,r){let n={token:r};if(!this.getAddressState(e)){if(!r){const t=await this.getMessageForSigning(e);if(!t.startsWith(this.config.signInPrefix))throw new Error("Cannot sign on invalid message");const r=this.signAuthMessage(e,t);n=await y("".concat(this.config.api,"/auth/verify"),{public_address:e,signed_message:r},{},{useAPIKey:!0})}this.updateState({jwtToken:n.token,userInfo:t},e)}}updateState(e,t){const r=t||this.state.selectedAddress,n=P(P({},this.getAddressState(r)||Object(S.cloneDeep)(this.defaultPreferences)),e);return this.update({identities:P(P({},this.state.identities),{},{[r]:n})}),n}headers(e){var t;const r=e||this.state.selectedAddress;return{headers:{Authorization:"Bearer ".concat((null===(t=this.getAddressState(r))||void 0===t?void 0:t.jwtToken)||""),"Content-Type":"application/json; charset=utf-8"}}}}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return f}));var n=r(60),i=r.n(n),o=(r(0),r(107)),a=r.n(o),s=r(61),u=r.n(s);const f=()=>i()(32).toString("hex");URL;a.a;u.a}).call(this,r(3).Buffer)},function(e,t,r){e.exports=r(125).default,e.exports.default=e.exports},function(e,t,r){(function(t){var n=r(40),i=r(46),o=r(134),a=function(){},s=/^v?\.0/.test(t.version),u=function(e){return"function"==typeof e},f=function(e,t,r,f){f=n(f);var c=!1;e.on("close",(function(){c=!0})),i(e,{readable:t,writable:r},(function(e){if(e)return f(e);c=!0,f()}));var d=!1;return function(t){if(!c&&!d)return d=!0,function(e){return!!s&&(!!o&&((e instanceof(o.ReadStream||a)||e instanceof(o.WriteStream||a))&&u(e.close)))}(e)?e.close(a):function(e){return e.setHeader&&u(e.abort)}(e)?e.abort():u(e.destroy)?e.destroy():void f(t||new Error("stream was destroyed"))}},c=function(e){e()},d=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=u(t[t.length-1]||a)&&t.pop()||a;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map((function(i,o){var a=o<t.length-1;return f(i,a,o>0,(function(t){e||(e=t),t&&n.forEach(c),a||(n.forEach(c),r(e))}))}));return t.reduce(d)}}).call(this,r(9))},function(e,t){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}},function(e,t){e.exports=!1},function(e,t){},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),a=Math.max(i,o),s=0,u=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===s)return 0;a-=1}else if(u[0][a]<u[1][a])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var s=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)s();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(){}var t,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,(r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}])&&a(t,r),e}();t.default=s,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=u(r(92)),i=u(r(93)),o=u(r(94)),a=u(r(95)),s=u(r(17));function u(e){return e&&e.__esModule?e:{default:e}}var f=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"==typeof a&&(r[t]=a,n+=1)})),n>0){var a=Object.keys(r),u=s.default.find(a,(function(e){return t.isOS(e)}));if(u){var f=this.satisfies(r[u]);if(void 0!==f)return f}var c=s.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var d=this.satisfies(r[c]);if(void 0!==d)return d}}if(o>0){var h=Object.keys(i),l=s.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==l)return this.compareVersion(i[l])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=f,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})},function(e,t,r){"use strict";r.r(t);r(63);var n=r(7);r.d(t,"BaseController",(function(){return n.a}));var i=r(72);r.d(t,"BaseBlockTracker",(function(){return i.a}));r(73);var o=r(74);r.d(t,"createEventEmitterProxy",(function(){return o.a}));var a=r(41);r.d(t,"createSwappableProxy",(function(){return a.a}));var s=r(75);r.d(t,"BaseCurrencyController",(function(){return s.a}));r(76);var u=r(77);r.d(t,"BaseEmbedController",(function(){return u.a}));var f=r(43);r.d(t,"createChangeProviderMiddlewareMiddleware",(function(){return f.a})),r.d(t,"createTopupMiddleware",(function(){return f.d})),r.d(t,"createGenericJRPCMiddleware",(function(){return f.c})),r.d(t,"createCommunicationMiddleware",(function(){return f.b}));var c=r(78);r.d(t,"CommunicationWindowManager",(function(){return c.a}));var d=r(79);for(var h in d)["default","BaseController","createEventEmitterProxy","createSwappableProxy","CommunicationWindowManager","BaseBlockTracker","BaseCurrencyController","BaseEmbedController","createChangeProviderMiddlewareMiddleware","createTopupMiddleware","createGenericJRPCMiddleware","createCommunicationMiddleware"].indexOf(h)<0&&function(e){r.d(t,e,(function(){return d[e]}))}(h);var l=r(1);r.d(t,"FEATURES_PROVIDER_CHANGE_WINDOW",(function(){return l.u})),r.d(t,"FEATURES_DEFAULT_WALLET_WINDOW",(function(){return l.t})),r.d(t,"FEATURES_DEFAULT_POPUP_WINDOW",(function(){return l.s})),r.d(t,"FEATURES_CONFIRM_WINDOW",(function(){return l.r})),r.d(t,"POPUP_LOADED",(function(){return l.v})),r.d(t,"POPUP_RESULT",(function(){return l.w})),r.d(t,"SETUP_COMPLETE",(function(){return l.z})),r.d(t,"ACTIVITY_ACTION_ALL",(function(){return l.a})),r.d(t,"ACTIVITY_ACTION_SEND",(function(){return l.c})),r.d(t,"ACTIVITY_ACTION_RECEIVE",(function(){return l.b})),r.d(t,"ACTIVITY_ACTION_TOPUP",(function(){return l.d})),r.d(t,"ACTIVITY_PERIOD_ALL",(function(){return l.e})),r.d(t,"ACTIVITY_PERIOD_WEEK_ONE",(function(){return l.h})),r.d(t,"ACTIVITY_PERIOD_MONTH_ONE",(function(){return l.f})),r.d(t,"ACTIVITY_PERIOD_MONTH_SIX",(function(){return l.g})),r.d(t,"ACTIVITY_STATUS_SUCCESSFUL",(function(){return l.l})),r.d(t,"ACTIVITY_STATUS_UNSUCCESSFUL",(function(){return l.m})),r.d(t,"ACTIVITY_STATUS_PENDING",(function(){return l.k})),r.d(t,"ACTIVITY_STATUS_CANCELLED",(function(){return l.i})),r.d(t,"ACTIVITY_STATUS_CANCELLING",(function(){return l.j})),r.d(t,"COMMUNICATION_NOTIFICATIONS",(function(){return l.q})),r.d(t,"COMMUNICATION_JRPC_METHODS",(function(){return l.p})),r.d(t,"PROVIDER_JRPC_METHODS",(function(){return l.x})),r.d(t,"PROVIDER_NOTIFICATIONS",(function(){return l.y})),r.d(t,"BROADCAST_CHANNELS",(function(){return l.n})),r.d(t,"BROADCAST_CHANNELS_MSGS",(function(){return l.o}));var p=r(44);r.d(t,"LOGIN_PROVIDER",(function(){return p.a})),r.d(t,"PAYMENT_PROVIDER",(function(){return p.b}));var b=r(80);r.d(t,"BaseKeyringController",(function(){return b.a}));r(98);var v=r(99);r.d(t,"createFetchConfigFromReq",(function(){return v.a})),r.d(t,"createFetchMiddleware",(function(){return v.b}));var g=r(100);r.d(t,"createLoggerMiddleware",(function(){return g.a}));var y=r(101);r.d(t,"createOriginMiddleware",(function(){return y.a}));var m=r(42);r.d(t,"createRandomId",(function(){return m.a})),r.d(t,"providerFromEngine",(function(){return m.c})),r.d(t,"providerFromMiddleware",(function(){return m.d})),r.d(t,"providerAsMiddleware",(function(){return m.b}));var _=r(104);r.d(t,"BroadcastChannelHandler",(function(){return _.a})),r.d(t,"PopupHandler",(function(){return _.b})),r.d(t,"PopupStoreChannel",(function(){return _.c})),r.d(t,"PopupWithBcHandler",(function(){return _.d})),r.d(t,"RedirectHandler",(function(){return _.e})),r.d(t,"StreamWindow",(function(){return _.f}));var w=r(105);r.d(t,"DEFAULT_PREFERENCES",(function(){return w.b})),r.d(t,"BasePreferencesController",(function(){return w.a}));var S=r(45);r.d(t,"ACTIVITY_ACTION",(function(){return S.b})),r.d(t,"ACCOUNT_CATEGORY",(function(){return S.a}));var E=r(103);r.d(t,"BaseTransactionStateManager",(function(){return E.a}));var M=r(5);r.d(t,"TransactionStatus",(function(){return M.c})),r.d(t,"TRANSACTION_TYPES",(function(){return M.a})),r.d(t,"TX_EVENTS",(function(){return M.b}));var A=r(4);r.d(t,"getTxStatusText",(function(){return A.j})),r.d(t,"intToHex",(function(){return A.m})),r.d(t,"randomId",(function(){return A.o})),r.d(t,"padWithZeroes",(function(){return A.n})),r.d(t,"concatSig",(function(){return A.d})),r.d(t,"timeout",(function(){return A.r})),r.d(t,"formatSmallNumbers",(function(){return A.f})),r.d(t,"addressSlicer",(function(){return A.b})),r.d(t,"significantDigits",(function(){return A.q})),r.d(t,"formatDate",(function(){return A.e})),r.d(t,"formatTime",(function(){return A.g})),r.d(t,"transactionMatchesNetwork",(function(){return A.s})),r.d(t,"hashMessage",(function(){return A.l})),r.d(t,"signMessage",(function(){return A.p})),r.d(t,"getPopupFeatures",(function(){return A.i})),r.d(t,"broadcastChannelOptions",(function(){return A.c})),r.d(t,"getCustomDeviceInfo",(function(){return A.h})),r.d(t,"UserError",(function(){return A.a})),r.d(t,"handleRedirectParameters",(function(){return A.k}))},function(e,t,r){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=f(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function f(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,d=r?i-1:0,h=r?-1:1,l=e[t+d];for(d+=h,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=f}return(l?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<<f)-1,d=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+l]=255&a,l+=p,a/=256,f-=8);e[r+l-p]|=128*b}},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(3).Buffer,s=r(118).inspect,u=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,f;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),f&&o(t,f),e}()},function(e,t){},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(11))},function(e,t,r){
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  var n=r(3),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(47),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[c]=null,e[a]=null,e[s]=null,t(l(r,!1)))}}function b(e){t.nextTick(p,e)}var v=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[f])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(l(void 0,!0))}))}));var n,i=this[c];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[f]?r(l(void 0,!0)):t[d](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[d])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),n),v);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[c]=null,r[a]=null,r[s]=null,e(l(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[c]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[c]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[c]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[f]=!0})),e.on("readable",b.bind(null,r)),r}}).call(this,r(9))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(70);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(26).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(47)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function f(e){e()}function c(e,t){return e.pipe(t)}function d(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=d(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(f),o||(a.forEach(f),i(n))}))}));return t.reduce(c)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(126);function i(t,r){return void 0===r&&(r="utf8"),e.isBuffer(t)?a(t.toString("base64")):a(e.from(t,r).toString("base64"))}function o(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function a(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(t,r){return void 0===r&&(r="utf8"),e.from(o(t),"base64").toString(r)},s.toBase64=o,s.fromBase64=a,s.toBuffer=function(t){return e.from(o(t),"base64")},t.default=s}).call(this,r(3).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=t.length,n=r%4;if(!n)return t;var i=r,o=4-n,a=r+o,s=e.alloc(a);for(s.write(t);o--;)s.write("=",i++);return s.toString()}}).call(this,r(3).Buffer)},function(e,t,r){const n=r(128),i=r(129);e.exports=function(e){const t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},function(e,t,r){(function(t){const{Transform:n}=r(18);e.exports=e=>class r extends n{constructor(t,r,n,i,o){super(o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,r){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return t.isBuffer(e)||(e=t.from(e,r)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new r(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}}).call(this,r(3).Buffer)},function(e,t,r){(function(t){const{Transform:n}=r(18);e.exports=e=>class r extends n{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,r){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return t.isBuffer(e)||(e=t.from(e,r)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new r(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}}).call(this,r(3).Buffer)},function(e,t,r){(function(t){const n=r(131);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&n.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,n.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const r=t.alloc(e);for(let t=0;t<e;++t)r[t]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return r},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i}).call(this,r(3).Buffer)},function(e,t){const r=[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];t.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let l=d^(o<<1|a>>>31),p=h^(a<<1|o>>>31);const b=e[0]^l,v=e[1]^p,g=e[10]^l,y=e[11]^p,m=e[20]^l,_=e[21]^p,w=e[30]^l,S=e[31]^p,E=e[40]^l,M=e[41]^p;l=n^(s<<1|u>>>31),p=i^(u<<1|s>>>31);const A=e[2]^l,O=e[3]^p,x=e[12]^l,P=e[13]^p,R=e[22]^l,T=e[23]^p,k=e[32]^l,I=e[33]^p,C=e[42]^l,L=e[43]^p;l=o^(f<<1|c>>>31),p=a^(c<<1|f>>>31);const j=e[4]^l,N=e[5]^p,B=e[14]^l,D=e[15]^p,z=e[24]^l,U=e[25]^p,F=e[34]^l,q=e[35]^p,W=e[44]^l,H=e[45]^p;l=s^(d<<1|h>>>31),p=u^(h<<1|d>>>31);const K=e[6]^l,V=e[7]^p,G=e[16]^l,Y=e[17]^p,J=e[26]^l,Z=e[27]^p,$=e[36]^l,X=e[37]^p,Q=e[46]^l,ee=e[47]^p;l=f^(n<<1|i>>>31),p=c^(i<<1|n>>>31);const te=e[8]^l,re=e[9]^p,ne=e[18]^l,ie=e[19]^p,oe=e[28]^l,ae=e[29]^p,se=e[38]^l,ue=e[39]^p,fe=e[48]^l,ce=e[49]^p,de=b,he=v,le=y<<4|g>>>28,pe=g<<4|y>>>28,be=m<<3|_>>>29,ve=_<<3|m>>>29,ge=S<<9|w>>>23,ye=w<<9|S>>>23,me=E<<18|M>>>14,_e=M<<18|E>>>14,we=A<<1|O>>>31,Se=O<<1|A>>>31,Ee=P<<12|x>>>20,Me=x<<12|P>>>20,Ae=R<<10|T>>>22,Oe=T<<10|R>>>22,xe=I<<13|k>>>19,Pe=k<<13|I>>>19,Re=C<<2|L>>>30,Te=L<<2|C>>>30,ke=N<<30|j>>>2,Ie=j<<30|N>>>2,Ce=B<<6|D>>>26,Le=D<<6|B>>>26,je=U<<11|z>>>21,Ne=z<<11|U>>>21,Be=F<<15|q>>>17,De=q<<15|F>>>17,ze=H<<29|W>>>3,Ue=W<<29|H>>>3,Fe=K<<28|V>>>4,qe=V<<28|K>>>4,We=Y<<23|G>>>9,He=G<<23|Y>>>9,Ke=J<<25|Z>>>7,Ve=Z<<25|J>>>7,Ge=$<<21|X>>>11,Ye=X<<21|$>>>11,Je=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,$e=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|ue>>>24,it=ue<<8|se>>>24,ot=fe<<14|ce>>>18,at=ce<<14|fe>>>18;e[0]=de^~Ee&je,e[1]=he^~Me&Ne,e[10]=Fe^~Qe&be,e[11]=qe^~et&ve,e[20]=we^~Ce&Ke,e[21]=Se^~Le&Ve,e[30]=$e^~le&Ae,e[31]=Xe^~pe&Oe,e[40]=ke^~We&tt,e[41]=Ie^~He&rt,e[2]=Ee^~je&Ge,e[3]=Me^~Ne&Ye,e[12]=Qe^~be&xe,e[13]=et^~ve&Pe,e[22]=Ce^~Ke&nt,e[23]=Le^~Ve&it,e[32]=le^~Ae&Be,e[33]=pe^~Oe&De,e[42]=We^~tt&ge,e[43]=He^~rt&ye,e[4]=je^~Ge&ot,e[5]=Ne^~Ye&at,e[14]=be^~xe&ze,e[15]=ve^~Pe&Ue,e[24]=Ke^~nt&me,e[25]=Ve^~it&_e,e[34]=Ae^~Be&Je,e[35]=Oe^~De&Ze,e[44]=tt^~ge&Re,e[45]=rt^~ye&Te,e[6]=Ge^~ot&de,e[7]=Ye^~at&he,e[16]=xe^~ze&Fe,e[17]=Pe^~Ue&qe,e[26]=nt^~me&we,e[27]=it^~_e&Se,e[36]=Be^~Je&$e,e[37]=De^~Ze&Xe,e[46]=ge^~Re&ke,e[47]=ye^~Te&Ie,e[8]=ot^~de&Ee,e[9]=at^~he&Me,e[18]=ze^~Fe&Qe,e[19]=Ue^~qe&et,e[28]=me^~we&Ce,e[29]=_e^~Se&Le,e[38]=Je^~$e&le,e[39]=Ze^~Xe&pe,e[48]=Re^~ke&We,e[49]=Te^~Ie&He,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(48),i=r(71),o=r(49);function a(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function s(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>a(o.errorCodes.rpc.parse,e),invalidRequest:e=>a(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>a(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>a(o.errorCodes.rpc.methodNotFound,e),internal:e=>a(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return a(t,e)},invalidInput:e=>a(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>a(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>a(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>a(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>a(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>a(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>s(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>s(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>s(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>s(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>s(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},function(e,t){e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},function(e,t){},function(e,t){},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var i=n(r(15));function o(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function a(t,r){if(t<56)return e.from([t+r]);var n=u(t),i=u(r+55+n.length/2);return e.from(i+n,"hex")}function s(e){return"0x"===e.slice(0,2)}function u(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function f(t){if(!e.isBuffer(t)){if("string"==typeof t)return s(t)?e.from((n="string"!=typeof(o=t)?o:s(o)?o.slice(2):o).length%2?"0"+n:n,"hex"):e.from(t);if("number"==typeof t||"bigint"==typeof t)return t?(r=u(t),e.from(r,"hex")):e.from([]);if(null==t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(i.default.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var r,n,o;return t}t.encode=function t(r){if(Array.isArray(r)){for(var n=[],i=0;i<r.length;i++)n.push(t(r[i]));var o=e.concat(n);return e.concat([a(o.length,192),o])}var s=f(r);return 1===s.length&&s[0]<128?s:e.concat([a(s.length,128),s])},t.decode=function(t,r){if(void 0===r&&(r=!1),!t||0===t.length)return e.from([]);var n=function t(r){var n,i,a,s,u,f=[],c=r[0];if(c<=127)return{data:r.slice(0,1),remainder:r.slice(1)};if(c<=183){if(n=c-127,a=128===c?e.from([]):r.slice(1,n),2===n&&a[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:a,remainder:r.slice(n)}}if(c<=191){if(i=c-182,r.length-1<i)throw new Error("invalid RLP: not enough bytes for string length");if((n=o(r.slice(1,i).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((a=r.slice(i,n+i)).length<n)throw new Error("invalid RLP: not enough bytes for string");return{data:a,remainder:r.slice(n+i)}}if(c<=247){for(n=c-191,s=r.slice(1,n);s.length;)u=t(s),f.push(u.data),s=u.remainder;return{data:f,remainder:r.slice(n)}}i=c-246,n=o(r.slice(1,i).toString("hex"),16);var d=i+n;if(d>r.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=r.slice(i,d)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=t(s),f.push(u.data),s=u.remainder;return{data:f,remainder:r.slice(d)}}(f(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=f(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var i=n-246;return i+o(r.slice(1,i).toString("hex"),16)}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";
  /*
  object-assign
  (c) Sindre Sorhus
  @license MIT
  */var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),f=1;f<arguments.length;f++){for(var c in r=Object(arguments[f]))i.call(r,c)&&(u[c]=r[c]);if(n){s=n(r);for(var d=0;d<s.length;d++)o.call(r,s[d])&&(u[s[d]]=r[s[d]])}}return u}},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])b(u)||!_(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function s(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function f(e,t){return e}function c(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=c(e,i,n)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return d(r)}var f,_="",M=!1,A=["{","}"];(l(r)&&(M=!0,A=["[","]"]),E(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),S(r)&&(_=" "+d(r)),0!==a.length||M&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),f=M?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)P(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return h(e,r,n,s,t,M)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(f,_,A)):A[0]+_+A[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),P(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return"  "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return"   "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function m(e){return _(e)&&"[object RegExp]"===M(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===M(e)}function S(e){return _(e)&&("[object Error]"===M(e)||e instanceof Error)}function E(e){return"function"==typeof e}function M(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=l,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=m,t.isObject=_,t.isDate=w,t.isError=S,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(139);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",x(),t.format.apply(t,arguments))},t.inherits=r(140),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=R,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then((function(t){e.nextTick(a,null,t)}),(function(t){e.nextTick(T,t,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this,r(9))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){const r="Impossible case. Please create issue.",n="The tweak was out of range or the resulted private key is invalid",i="The tweak was out of range or equal to zero",o="Unknow error on context randomization",a="Private Key is invalid",s="Public Key could not be parsed",u="Public Key serialization error",f="The sum of the public keys is not valid",c="Signature could not be parsed",d="The nonce generation function failed, or the private key was invalid",h="Public key could not be recover",l="Scalar was invalid (zero or overflow)";function p(e,t){if(!e)throw new Error(t)}function b(e,t,r){if(p(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;p(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;p(t.length===r,n)}}function v(e){p("Boolean"===y(e),"Expected compressed to be a Boolean")}function g(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),b("output",e,t),e}function y(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){switch(p(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&b("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(o)}},privateKeyVerify:t=>(b("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(t){switch(b("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakAdd(t,r){switch(b("private key",t,32),b("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(n)}},privateKeyTweakMul(t,r){switch(b("private key",t,32),b("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(i)}},publicKeyVerify:t=>(b("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,n){switch(b("private key",t,32),v(r),n=g(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(u)}},publicKeyConvert(t,r=!0,n){switch(b("public key",t,[33,65]),v(r),n=g(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u)}},publicKeyNegate(t,n=!0,i){switch(b("public key",t,[33,65]),v(n),i=g(i,n?33:65),e.publicKeyNegate(i,t)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(r);case 3:throw new Error(u)}},publicKeyCombine(t,r=!0,n){p(Array.isArray(t),"Expected public keys to be an Array"),p(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)b("public key",e,[33,65]);switch(v(r),n=g(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(f);case 3:throw new Error(u)}},publicKeyTweakAdd(t,r,i=!0,o){switch(b("public key",t,[33,65]),b("tweak",r,32),v(i),o=g(o,i?33:65),e.publicKeyTweakAdd(o,t,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},publicKeyTweakMul(t,r,n=!0,o){switch(b("public key",t,[33,65]),b("tweak",r,32),v(n),o=g(o,n?33:65),e.publicKeyTweakMul(o,t,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(i)}},signatureNormalize(t){switch(b("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(c)}},signatureExport(t,n){b("signature",t,64);const i={output:n=g(n,72),outputlen:72};switch(e.signatureExport(i,t)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(c);case 2:throw new Error(r)}},signatureImport(t,n){switch(b("signature",t),n=g(n,64),e.signatureImport(n,t)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(r)}},ecdsaSign(t,n,i={},o){b("message",t,32),b("private key",n,32),p("Object"===y(i),"Expected options to be an Object"),void 0!==i.data&&b("options.data",i.data),void 0!==i.noncefn&&p("Function"===y(i.noncefn),"Expected options.noncefn to be a Function");const a={signature:o=g(o,64),recid:null};switch(e.ecdsaSign(a,t,n,i.data,i.noncefn)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(r)}},ecdsaVerify(t,r,n){switch(b("signature",t,64),b("message",r,32),b("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(s)}},ecdsaRecover(t,n,i,o=!0,a){switch(b("signature",t,64),p("Number"===y(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),b("message",i,32),v(o),a=g(a,o?33:65),e.ecdsaRecover(a,t,n,i)){case 0:return a;case 1:throw new Error(c);case 2:throw new Error(h);case 3:throw new Error(r)}},ecdh(t,r,n={},i){switch(b("public key",t,[33,65]),b("private key",r,32),p("Object"===y(n),"Expected options to be an Object"),void 0!==n.data&&b("options.data",n.data),void 0!==n.hashfn?(p("Function"===y(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&b("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&b("options.ybuf",n.ybuf,32),b("output",i)):i=g(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(l)}}})},function(e,t,r){const n=new(0,r(143).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function a(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let a=new o(t),s=new o(r);if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),s=s.toRed(i.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null;const u=a.redSqr().redIMul(a);return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function s(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===a(e)?1:0,publicKeyCreate(e,t){const r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;return s(e,n.keyFromPrivate(t).getPublic()),0},publicKeyConvert(e,t){const r=a(t);if(null===r)return 1;return s(e,r.getPublic()),0},publicKeyNegate(e,t){const r=a(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),s(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=a(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(s(e,n),0)},publicKeyTweakAdd(e,t,r){const n=a(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(s(e,u),0)},publicKeyTweakMul(e,t,r){const n=a(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return s(e,n.getPublic().mul(r)),0},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:a}=e;let s=a.subarray(4,37);s[0]=0,s.set(r,1);let u=33,f=0;for(;u>1&&0===s[f]&&!(128&s[f+1]);--u,++f);if(s=s.subarray(f),128&s[0])return 1;if(u>1&&0===s[0]&&!(128&s[1]))return 1;let c=a.subarray(39,72);c[0]=0,c.set(n,1);let d=33,h=0;for(;d>1&&0===c[h]&&!(128&c[h+1]);--d,++h);return c=c.subarray(h),128&c[0]||d>1&&0===c[0]&&!(128&c[1])?1:(e.outputlen=6+u+d,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=c.length,a.set(c,6+u),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let a=t.subarray(4,4+r);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=t.subarray(6+r);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let u=new o(a);u.cmp(i.n)>=0&&(u=new o(0));let f=new o(t.subarray(6+r));return f.cmp(i.n)>=0&&(f=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(f.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,a,s){if(s){const e=s;s=n=>{const i=e(t,r,null,a,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let f;try{f=n.sign(t,r,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(f.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(f.s.toArrayLike(Uint8Array,"be",32),32),e.recid=f.recoveryParam,0},ecdsaVerify(e,t,r){const s={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(s.r),f=new o(s.s);if(u.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(1===f.cmp(n.nh)||u.isZero()||f.isZero())return 3;const c=a(r);if(null===c)return 2;const d=c.getPublic();return n.verify(t,s,d)?0:3},ecdsaRecover(e,t,r,a){const u={r:t.slice(0,32),s:t.slice(32,64)},f=new o(u.r),c=new o(u.s);if(f.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(f.isZero()||c.isZero())return 2;let d;try{d=n.recoverPubKey(a,u,r)}catch(e){return 2}return s(e,d),0},ecdh(e,t,r,s,u,f,c){const d=a(t);if(null===d)return 1;const h=new o(r);if(h.cmp(i.n)>=0||h.isZero())return 2;const l=d.getPublic().mul(h);if(void 0===u){const t=l.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{f||(f=new Uint8Array(32));const t=l.getX().toArray("be",32);for(let e=0;e<32;++e)f[e]=t[e];c||(c=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let e=0;e<32;++e)c[e]=r[e];const n=u(f,c,s);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},function(e,t,r){"use strict";var n=t;n.version=r(144).version,n.utils=r(12),n.rand=r(86),n.curve=r(87),n.curves=r(52),n.ec=r(156),n.eddsa=r(160)},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t){},function(e,t,r){"use strict";var n=r(12),i=r(15),o=r(6),a=r(37),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(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(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(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.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,f,c,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),p=new i(1),b=new i(0),v=new i(0),g=new i(1),y=0;0!==h.cmpn(0);){var m=l.div(h);f=l.sub(m.mul(h)),c=v.sub(m.mul(p));var _=g.sub(m.mul(b));if(!n&&f.cmp(d)<0)t=u.neg(),r=p,n=f.neg(),o=c;else if(n&&2==++y)break;u=f,l=h,h=f,v=p,p=c,g=b,b=_}a=f.neg(),s=c;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return f},o(f,a.BasePoint),u.prototype.point=function(e,t,r){return new f(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},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(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},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(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.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(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),d=n.redMul(f),h=u.redSqr().redIAdd(c).redISub(d).redISub(d),l=u.redMul(d.redISub(h)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),f=u.redMul(a),c=r.redMul(u),d=s.redSqr().redIAdd(f).redISub(c).redISub(c),h=s.redMul(c.redISub(d)).redISub(i.redMul(f)),l=this.z.redMul(a);return this.curve.jpoint(d,h,l)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),f=a.redAdd(a);for(t=0;t<e;t++){var c=o.redSqr(),d=f.redSqr(),h=d.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(d),b=l.redSqr().redISub(p.redAdd(p)),v=p.redISub(b),g=l.redMul(v);g=g.redIAdd(g).redISub(h);var y=f.redMul(s);t+1<e&&(u=u.redMul(h)),o=b,s=y,f=g}return this.curve.jpoint(o,f.redMul(i),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 e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=u,t=s.redMul(a.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),l=this.x.redAdd(d).redSqr().redISub(c).redISub(h);l=l.redIAdd(l);var p=c.redAdd(c).redIAdd(c),b=p.redSqr(),v=h.redIAdd(h);v=(v=v.redIAdd(v)).redIAdd(v),e=b.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=s.redMul(a.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),l=this.x.redSub(c).redMul(this.x.redAdd(c));l=l.redAdd(l).redIAdd(l);var p=h.redIAdd(h),b=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(c);var v=d.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=l.redMul(p.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),f=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(f.redAdd(f)),d=f.redISub(c),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,l,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=t.redMul(f);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.x.redMul(s).redISub(c);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(f.redMul(u.redISub(f)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,l)},c.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),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(e,t,r){"use strict";var n=r(15),i=r(6),o=r(37),a=r(12);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,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)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(12),i=r(15),o=r(6),a=r(37),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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 i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new f(this,e,t,r,n)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[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 e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),f=o.redMul(s),c=i.redMul(s),d=a.redMul(o);return this.curve.point(u,f,d,c)},f.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(f.redSub(this.curve.two)),t=f.redMul(n.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(i=this.z.redSqr(),o=f.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=f.redMul(n.redSub(u)),r=f.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),f=o.redMul(a),c=s.redMul(u),d=o.redMul(u),h=a.redMul(s);return this.curve.point(f,c,h,d)},f.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(t=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(d,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),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(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,r){"use strict";t.sha1=r(150),t.sha224=r(151),t.sha256=r(89),t.sha384=r(152),t.sha512=r(90)},function(e,t,r){"use strict";var n=r(16),i=r(33),o=r(88),a=n.rotl32,s=n.sum32,u=n.sum32_5,f=o.ft_1,c=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,c),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(a(i,5),f(p,o,c,h),l,r[n],d[p]);l=h,h=c,c=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(16),i=r(89);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(16),i=r(90);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(16),i=r(33),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,f=i.BlockHash;function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(c,f),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],c=this.h[4],y=r,m=n,_=i,w=f,S=c,E=0;E<80;E++){var M=a(o(u(r,d(E,n,i,f),e[p[E]+t],h(E)),v[E]),c);r=c,c=f,f=o(i,10),i=n,n=M,M=a(o(u(y,d(79-E,m,_,w),e[b[E]+t],l(E)),g[E]),S),y=S,S=w,w=o(_,10),_=m,m=M}M=s(this.h[1],i,w),this.h[1]=s(this.h[2],f,S),this.h[2]=s(this.h[3],c,y),this.h[3]=s(this.h[4],r,m),this.h[4]=s(this.h[0],n,_),this.h[0]=M},c.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[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],g=[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(e,t,r){"use strict";var n=r(16),i=r(21);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.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(e,t,r){"use strict";var n=r(15),i=r(157),o=r(12),a=r(52),s=r(86),u=o.assert,f=r(158),c=r(159);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new f(this,e)},d.prototype.keyFromPrivate=function(e,t){return f.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return f.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),f=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new n(1)),h=0;;h++){var l=o.k?o.k(h):new n(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(d)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var g=l.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new c({r:v,s:g,recoveryParam:y})}}}}}},d.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),f=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new n(e),s=t.r,f=t.s,d=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var l=t.r.invm(o),p=o.sub(a).mul(l).umod(o),b=f.mul(l).umod(o);return this.g.mulAdd(p,s,b)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(53),i=r(85),o=r(21);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(15),i=r(12).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(15),i=r(12),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function f(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var f=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var c=u(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var d=e.slice(r.place,c+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(f),this.s=new n(d),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=f(t),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(53),i=r(52),o=r(12),a=o.assert,s=o.parseBytes,u=r(161),f=r(162);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof f?e:new f(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return o.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(12),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},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 e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),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(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";var n=r(15),i=r(12),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.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 i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(60);t.getRandomBytes=function(e){return new Promise((function(t,r){n(e,(function(e,n){e?r(e):t(n)}))}))},t.getRandomBytesSync=function(e){return n(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(165),i=r(61);t.keccak224=n.createHashFunction((function(){return i("keccak224")})),t.keccak256=n.createHashFunction((function(){return i("keccak256")})),t.keccak384=n.createHashFunction((function(){return i("keccak384")})),t.keccak512=n.createHashFunction((function(){return i("keccak512")}))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.createHashFunction=function(t){return function(r){var n=t();return n.update(r),e.from(n.digest())}}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";var n=r(6),i=r(167),o=r(168),a=r(169),s=r(174);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){"use strict";var n=r(6),i=r(91),o=r(14).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function f(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function c(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=f(r,n,i,o,e[0],3614090360,7),o=f(o,r,n,i,e[1],3905402710,12),i=f(i,o,r,n,e[2],606105819,17),n=f(n,i,o,r,e[3],3250441966,22),r=f(r,n,i,o,e[4],4118548399,7),o=f(o,r,n,i,e[5],1200080426,12),i=f(i,o,r,n,e[6],2821735955,17),n=f(n,i,o,r,e[7],4249261313,22),r=f(r,n,i,o,e[8],1770035416,7),o=f(o,r,n,i,e[9],2336552879,12),i=f(i,o,r,n,e[10],4294925233,17),n=f(n,i,o,r,e[11],2304563134,22),r=f(r,n,i,o,e[12],1804603682,7),o=f(o,r,n,i,e[13],4254626195,12),i=f(i,o,r,n,e[14],2792965006,17),r=c(r,n=f(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=c(o,r,n,i,e[6],3225465664,9),i=c(i,o,r,n,e[11],643717713,14),n=c(n,i,o,r,e[0],3921069994,20),r=c(r,n,i,o,e[5],3593408605,5),o=c(o,r,n,i,e[10],38016083,9),i=c(i,o,r,n,e[15],3634488961,14),n=c(n,i,o,r,e[4],3889429448,20),r=c(r,n,i,o,e[9],568446438,5),o=c(o,r,n,i,e[14],3275163606,9),i=c(i,o,r,n,e[3],4107603335,14),n=c(n,i,o,r,e[8],1163531501,20),r=c(r,n,i,o,e[13],2850285829,5),o=c(o,r,n,i,e[2],4243563512,9),i=c(i,o,r,n,e[7],1735328473,14),r=d(r,n=c(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=d(o,r,n,i,e[8],2272392833,11),i=d(i,o,r,n,e[11],1839030562,16),n=d(n,i,o,r,e[14],4259657740,23),r=d(r,n,i,o,e[1],2763975236,4),o=d(o,r,n,i,e[4],1272893353,11),i=d(i,o,r,n,e[7],4139469664,16),n=d(n,i,o,r,e[10],3200236656,23),r=d(r,n,i,o,e[13],681279174,4),o=d(o,r,n,i,e[0],3936430074,11),i=d(i,o,r,n,e[3],3572445317,16),n=d(n,i,o,r,e[6],76029189,23),r=d(r,n,i,o,e[9],3654602809,4),o=d(o,r,n,i,e[12],3873151461,11),i=d(i,o,r,n,e[15],530742520,16),r=h(r,n=d(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(3).Buffer,i=r(6),o=r(91),a=new Array(16),s=[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],u=[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],f=[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],c=[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],d=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function l(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(l,o),l.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,E=0|this._d,M=0|this._e,A=0;A<80;A+=1){var O,x;A<16?(O=b(r,n,i,o,l,e[s[A]],d[0],f[A]),x=m(_,w,S,E,M,e[u[A]],h[0],c[A])):A<32?(O=v(r,n,i,o,l,e[s[A]],d[1],f[A]),x=y(_,w,S,E,M,e[u[A]],h[1],c[A])):A<48?(O=g(r,n,i,o,l,e[s[A]],d[2],f[A]),x=g(_,w,S,E,M,e[u[A]],h[2],c[A])):A<64?(O=y(r,n,i,o,l,e[s[A]],d[3],f[A]),x=v(_,w,S,E,M,e[u[A]],h[3],c[A])):(O=m(r,n,i,o,l,e[s[A]],d[4],f[A]),x=b(_,w,S,E,M,e[u[A]],h[4],c[A])),r=l,l=o,o=p(i,10),i=n,n=O,_=M,M=E,E=p(S,10),S=w,w=x}var P=this._b+i+E|0;this._b=this._c+o+M|0,this._c=this._d+l+_|0,this._d=this._e+r+w|0,this._e=this._a+n+S|0,this._a=P},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=l},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(170),t.sha1=r(171),t.sha224=r(172),t.sha256=r(92),t.sha384=r(173),t.sha512=r(93)},function(e,t,r){var n=r(6),i=r(29),o=r(14).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=r[d-3]^r[d-8]^r[d-14]^r[d-16];for(var h=0;h<80;++h){var l=~~(h/20),p=0|((t=n)<<5|t>>>27)+c(l,i,o,s)+u+r[h]+a[l];u=s,s=o,o=f(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(6),i=r(29),o=r(14).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function d(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=f(n)+d(p,i,o,s)+u+r[l]+a[p]|0;u=s,s=o,o=c(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(6),i=r(92),o=r(29),a=r(14).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(6),i=r(93),o=r(29),a=r(14).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){var n=r(14).Buffer,i=r(175).Transform,o=r(32).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(6)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){e.exports=i;var n=r(25).EventEmitter;function i(){n.call(this)}r(30)(i,n),i.Readable=r(55),i.Writable=r(183),i.Duplex=r(184),i.Transform=r(185),i.PassThrough=r(186),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function f(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",f),e.on("error",f),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var n=r(56).Buffer,i=r(178);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(180),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(11))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,f={},c=!1,d=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return f[u]=i,n(u),u++},h.clearImmediate=l}function l(e){delete f[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=f[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{l(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(11),r(9))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(11))},function(e,t,r){"use strict";e.exports=o;var n=r(97),i=Object.create(r(34));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(30),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(57)},function(e,t,r){e.exports=r(23)},function(e,t,r){e.exports=r(55).Transform},function(e,t,r){e.exports=r(55).PassThrough},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=n(r(51)),o=r(17),a=r(22),s=r(82),u=function(){function t(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return t.zero=function(){return new t((0,a.zeros)(20))},t.fromString=function(e){return(0,i.default)((0,s.isValidAddress)(e),"Invalid address"),new t((0,a.toBuffer)(e))},t.fromPublicKey=function(r){return(0,i.default)(e.isBuffer(r),"Public key should be Buffer"),new t((0,s.pubToAddress)(r))},t.fromPrivateKey=function(r){return(0,i.default)(e.isBuffer(r),"Private key should be Buffer"),new t((0,s.privateToAddress)(r))},t.generate=function(r,n){return(0,i.default)(o.BN.isBN(n)),new t((0,s.generateAddress)(r.buf,n.toArrayLike(e)))},t.generate2=function(r,n,o){return(0,i.default)(e.isBuffer(n)),(0,i.default)(e.isBuffer(o)),new t((0,s.generateAddress2)(r.buf,n,o))},t.prototype.equals=function(e){return this.buf.equals(e.buf)},t.prototype.isZero=function(){return this.equals(t.zero())},t.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex");return e.gte(t)&&e.lte(r)},t.prototype.toString=function(){return"0x"+this.buf.toString("hex")},t.prototype.toBuffer=function(){return e.from(this.buf)},t}();t.Address=u}).call(this,r(3).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=r(83),i=r(17),o=r(22),a=r(54),s=r(38),u=r(58);function f(e,t){var r=(0,u.toType)(e,u.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,u.toType)(t,u.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function c(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(t,r,i){var o=(0,n.ecdsaSign)(t,r),a=o.signature,s=o.recid,f=e.from(a.slice(0,32)),c=e.from(a.slice(32,64));if(!i||"number"==typeof i){if(i&&!Number.isSafeInteger(i))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:f,s:c,v:i?s+(2*i+35):s+27}}return{r:f,s:c,v:(0,u.toType)(i,u.TypeOutput.BN).muln(2).addn(35).addn(s).toArrayLike(e)}};t.ecrecover=function(t,r,i,a,s){var u=e.concat([(0,o.setLengthLeft)(i,32),(0,o.setLengthLeft)(a,32)],64),d=f(r,s);if(!c(d))throw new Error("Invalid signature v value");var h=(0,n.ecdsaRecover)(u,d.toNumber(),t);return e.from((0,n.publicKeyConvert)(h,!1).slice(1))};t.toRpcSig=function(t,r,n,i){if(!c(f(t,i)))throw new Error("Invalid signature v value");return(0,o.bufferToHex)(e.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(n,32),(0,o.toBuffer)(t)]))};t.toCompactSig=function(t,r,n,i){if(!c(f(t,i)))throw new Error("Invalid signature v value");var a=(0,u.toType)(t,u.TypeOutput.Number),s=n;return(a>28&&a%2==1||1===a||28===a)&&((s=e.from(n))[0]|=128),(0,o.bufferToHex)(e.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(s,32)]))};t.fromRpcSig=function(e){var t,r,n,i=(0,o.toBuffer)(e);if(i.length>=65)t=i.slice(0,32),r=i.slice(32,64),n=(0,o.bufferToInt)(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");t=i.slice(0,32),r=i.slice(32,64),n=(0,o.bufferToInt)(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}};t.isValidSignature=function(e,t,r,n,o){void 0===n&&(n=!0);var a=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!c(f(e,o)))return!1;var u=new i.BN(t),d=new i.BN(r);return!(u.isZero()||u.gt(s)||d.isZero()||d.gt(s))&&(!n||1!==d.cmp(a))};t.hashPersonalMessage=function(t){(0,s.assertIsBuffer)(t);var r=e.from("Ethereum Signed Message:\n".concat(t.length),"utf-8");return(0,a.keccak)(e.concat([r,t]))}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;var i=n(r(51)),o=r(28),a=r(17),s=r(22);t.defineProperties=function(t,r,n){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x".concat(t[e].toString("hex"))})),r}return(0,s.baToJSON)(t.raw)},t.serialize=function(){return a.rlp.encode(t.raw)},r.forEach((function(r,n){function o(){return t.raw[n]}function a(o){"00"!==(o=(0,s.toBuffer)(o)).toString("hex")||r.allowZero||(o=e.allocUnsafe(0)),r.allowLess&&r.length?(o=(0,s.unpadBuffer)(o),(0,i.default)(r.length>=o.length,"The field ".concat(r.name," must not have more ").concat(r.length," bytes"))):r.allowZero&&0===o.length||!r.length||(0,i.default)(r.length===o.length,"The field ".concat(r.name," must have byte length of ").concat(r.length)),t.raw[n]=o}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:o,set:a}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:a,get:o})})),n)if("string"==typeof n&&(n=e.from((0,o.stripHexPrefix)(n),"hex")),e.isBuffer(n)&&(n=a.rlp.decode(n)),Array.isArray(n)){if(n.length>t._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(e,r){t[t._fields[r]]=(0,s.toBuffer)(e)}))}else{if("object"!=typeof n)throw new Error("invalid data");var u=Object.keys(n);r.forEach((function(e){-1!==u.indexOf(e.name)&&(t[e.name]=n[e.name]),-1!==u.indexOf(e.alias)&&(t[e.alias]=n[e.alias])}))}}}).call(this,r(3).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BroadcastChannel",{enumerable:!0,get:function(){return n.BroadcastChannel}}),Object.defineProperty(t,"OPEN_BROADCAST_CHANNELS",{enumerable:!0,get:function(){return n.OPEN_BROADCAST_CHANNELS}}),Object.defineProperty(t,"beLeader",{enumerable:!0,get:function(){return i.beLeader}}),Object.defineProperty(t,"clearNodeFolder",{enumerable:!0,get:function(){return n.clearNodeFolder}}),Object.defineProperty(t,"createLeaderElection",{enumerable:!0,get:function(){return i.createLeaderElection}}),Object.defineProperty(t,"enforceOptions",{enumerable:!0,get:function(){return n.enforceOptions}});var n=r(191),i=r(199)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OPEN_BROADCAST_CHANNELS=t.BroadcastChannel=void 0,t.clearNodeFolder=function(e){e=(0,o.fillOptionsWithDefaults)(e);var t=(0,i.chooseMethod)(e);return"node"===t.type?t.clearNodeFolder().then((function(){return!0})):n.PROMISE_RESOLVED_FALSE},t.enforceOptions=function(e){s=e};var n=r(24),i=r(192),o=r(59),a=new Set;t.OPEN_BROADCAST_CHANNELS=a;var s,u=0,f=function(e,t){var r,f;this.id=u++,a.add(this),this.name=e,s&&(t=s),this.options=(0,o.fillOptionsWithDefaults)(t),this.method=(0,i.chooseMethod)(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,f=(r=this).method.create(r.name,r.options),(0,n.isPromise)(f)?(r._prepP=f,f.then((function(e){r._state=e}))):r._state=f};function c(e,t,r){var i={time:e.method.microSeconds(),type:t,data:r};return(e._prepP?e._prepP:n.PROMISE_RESOLVED_VOID).then((function(){var t=e.method.postMessage(e._state,i);return e._uMP.add(t),t.catch().then((function(){return e._uMP.delete(t)})),t}))}function d(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function h(e,t,r){e._addEL[t].push(r),function(e){if(!e._iL&&d(e)){var t=function(t){e._addEL[t.type].forEach((function(e){var r=e.time-1e5;t.time>=r&&e.fn(t.data)}))},r=e.method.microSeconds();e._prepP?e._prepP.then((function(){e._iL=!0,e.method.onMessage(e._state,t,r)})):(e._iL=!0,e.method.onMessage(e._state,t,r))}}(e)}function l(e,t,r){e._addEL[t]=e._addEL[t].filter((function(e){return e!==r})),function(e){if(e._iL&&!d(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}(e)}t.BroadcastChannel=f,f._pubkey=!0,f.prototype={postMessage:function(e){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(e));return c(this,"message",e)},postInternal:function(e){return c(this,"internal",e)},set onmessage(e){var t={time:this.method.microSeconds(),fn:e};l(this,"message",this._onML),e&&"function"==typeof e?(this._onML=t,h(this,"message",t)):this._onML=null},addEventListener:function(e,t){h(this,e,{time:this.method.microSeconds(),fn:t})},removeEventListener:function(e,t){l(this,e,this._addEL[e].find((function(e){return e.fn===t})))},close:function(){var e=this;if(!this.closed){a.delete(this),this.closed=!0;var t=this._prepP?this._prepP:n.PROMISE_RESOLVED_VOID;return this._onML=null,this._addEL.message=[],t.then((function(){return Promise.all(Array.from(e._uMP))})).then((function(){return Promise.all(e._befC.map((function(e){return e()})))})).then((function(){return e.method.close(e._state)}))}},get type(){return this.method.type},get isClosed(){return this.closed}}},function(e,t,r){"use strict";var n=r(193);r(194);Object.defineProperty(t,"__esModule",{value:!0}),t.chooseMethod=function(e){var t=[].concat(e.methods,f).filter(Boolean);if(e.type){if("simulate"===e.type)return s.default;var r=t.find((function(t){return t.type===e.type}));if(r)return r;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||u.isNode||(t=t.filter((function(e){return"idb"!==e.type})));var n=t.find((function(e){return e.canBeUsed()}));if(n)return n;throw new Error("No useable method found in "+JSON.stringify(f.map((function(e){return e.type}))))};var i=n(r(195)),o=n(r(196)),a=n(r(197)),s=n(r(198)),u=r(24);var f=[i.default,o.default,a.default]},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=c,t.canBeUsed=f,t.close=a,t.create=o,t.microSeconds=t.default=void 0,t.onMessage=u,t.postMessage=s,t.type=void 0;var n=r(24),i=n.microSeconds;t.microSeconds=i;function o(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(e){t.messagesCallback&&t.messagesCallback(e.data)},t}function a(e){e.bc.close(),e.subFns=[]}function s(e,t){try{return e.bc.postMessage(t,!1),n.PROMISE_RESOLVED_VOID}catch(e){return Promise.reject(e)}}function u(e,t){e.messagesCallback=t}function f(){if(n.isNode&&"undefined"==typeof window)return!1;if("function"==typeof BroadcastChannel){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}return!1}function c(){return 150}t.type="native";var d={create:o,close:a,onMessage:u,postMessage:s,canBeUsed:f,type:"native",averageResponseTime:c,microSeconds:i};t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=_,t.canBeUsed=m,t.cleanOldMessages=l,t.close=v,t.create=p,t.createDatabase=u,t.default=void 0,t.getAllMessages=function(e){var t=e.transaction("messages").objectStore("messages"),r=[];return new Promise((function(e){t.openCursor().onsuccess=function(t){var n=t.target.result;n?(r.push(n.value),n.continue()):e(r)}}))},t.getIdb=s,t.getMessagesHigherThan=c,t.getOldMessages=h,t.microSeconds=void 0,t.onMessage=y,t.postMessage=g,t.removeMessageById=d,t.type=void 0,t.writeMessage=f;var n=r(24),i=r(102),o=r(59),a=n.microSeconds;t.microSeconds=a;function s(){if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof window){if(void 0!==window.mozIndexedDB)return window.mozIndexedDB;if(void 0!==window.webkitIndexedDB)return window.webkitIndexedDB;if(void 0!==window.msIndexedDB)return window.msIndexedDB}return!1}function u(e){var t="pubkey.broadcast-channel-0-"+e,r=s().open(t,1);return r.onupgradeneeded=function(e){e.target.result.createObjectStore("messages",{keyPath:"id",autoIncrement:!0})},new Promise((function(e,t){r.onerror=function(e){return t(e)},r.onsuccess=function(){e(r.result)}}))}function f(e,t,r){var n={uuid:t,time:(new Date).getTime(),data:r},i=e.transaction(["messages"],"readwrite");return new Promise((function(e,t){i.oncomplete=function(){return e()},i.onerror=function(e){return t(e)},i.objectStore("messages").add(n)}))}function c(e,t){var r=e.transaction("messages").objectStore("messages"),n=[];return new Promise((function(e){(function(){try{var e=IDBKeyRange.bound(t+1,1/0);return r.openCursor(e)}catch(e){return r.openCursor()}}()).onsuccess=function(r){var i=r.target.result;i?i.value.id<t+1?i.continue(t+1):(n.push(i.value),i.continue()):e(n)}}))}function d(e,t){var r=e.transaction(["messages"],"readwrite").objectStore("messages").delete(t);return new Promise((function(e){r.onsuccess=function(){return e()}}))}function h(e,t){var r=(new Date).getTime()-t,n=e.transaction("messages").objectStore("messages"),i=[];return new Promise((function(e){n.openCursor().onsuccess=function(t){var n=t.target.result;if(n){var o=n.value;if(!(o.time<r))return void e(i);i.push(o),n.continue()}else e(i)}}))}function l(e,t){return h(e,t).then((function(t){return Promise.all(t.map((function(t){return d(e,t.id)})))}))}function p(e,t){return t=(0,o.fillOptionsWithDefaults)(t),u(e).then((function(r){var o={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:(0,n.randomToken)(),eMIs:new i.ObliviousSet(2*t.idb.ttl),writeBlockPromise:n.PROMISE_RESOLVED_VOID,messagesCallback:null,readQueuePromises:[],db:r};return r.onclose=function(){o.closed=!0,t.idb.onclose&&t.idb.onclose()},function e(t){if(t.closed)return;b(t).then((function(){return(0,n.sleep)(t.options.idb.fallbackInterval)})).then((function(){return e(t)}))}(o),o}))}function b(e){return e.closed?n.PROMISE_RESOLVED_VOID:e.messagesCallback?c(e.db,e.lastCursorId).then((function(t){return t.filter((function(e){return!!e})).map((function(t){return t.id>e.lastCursorId&&(e.lastCursorId=t.id),t})).filter((function(t){return function(e,t){return e.uuid!==t.uuid&&(!t.eMIs.has(e.id)&&!(e.data.time<t.messagesCallbackTime))}(t,e)})).sort((function(e,t){return e.time-t.time})).forEach((function(t){e.messagesCallback&&(e.eMIs.add(t.id),e.messagesCallback(t.data))})),n.PROMISE_RESOLVED_VOID})):n.PROMISE_RESOLVED_VOID}function v(e){e.closed=!0,e.db.close()}function g(e,t){return e.writeBlockPromise=e.writeBlockPromise.then((function(){return f(e.db,e.uuid,t)})).then((function(){0===(0,n.randomInt)(0,10)&&l(e.db,e.options.idb.ttl)})),e.writeBlockPromise}function y(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t,b(e)}function m(){return!n.isNode&&!!s()}function _(e){return 2*e.idb.fallbackInterval}t.type="idb";var w={create:p,close:v,onMessage:y,postMessage:g,canBeUsed:m,type:"idb",averageResponseTime:_,microSeconds:a};t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addStorageEventListener=c,t.averageResponseTime=v,t.canBeUsed=b,t.close=l,t.create=h,t.default=void 0,t.getLocalStorage=s,t.microSeconds=void 0,t.onMessage=p,t.postMessage=f,t.removeStorageEventListener=d,t.storageKey=u,t.type=void 0;var n=r(102),i=r(59),o=r(24),a=o.microSeconds;t.microSeconds=a;function s(){var e;if("undefined"==typeof window)return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch(e){}return e}function u(e){return"pubkey.broadcastChannel-"+e}function f(e,t){return new Promise((function(r){(0,o.sleep)().then((function(){var n=u(e.channelName),i={token:(0,o.randomToken)(),time:(new Date).getTime(),data:t,uuid:e.uuid},a=JSON.stringify(i);s().setItem(n,a);var f=document.createEvent("Event");f.initEvent("storage",!0,!0),f.key=n,f.newValue=a,window.dispatchEvent(f),r()}))}))}function c(e,t){var r=u(e),n=function(e){e.key===r&&t(JSON.parse(e.newValue))};return window.addEventListener("storage",n),n}function d(e){window.removeEventListener("storage",e)}function h(e,t){if(t=(0,i.fillOptionsWithDefaults)(t),!b())throw new Error("BroadcastChannel: localstorage cannot be used");var r=(0,o.randomToken)(),a=new n.ObliviousSet(t.localstorage.removeTimeout),s={channelName:e,uuid:r,eMIs:a};return s.listener=c(e,(function(e){s.messagesCallback&&e.uuid!==r&&e.token&&!a.has(e.token)&&(e.data.time&&e.data.time<s.messagesCallbackTime||(a.add(e.token),s.messagesCallback(e.data)))})),s}function l(e){d(e.listener)}function p(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t}function b(){if(o.isNode)return!1;var e=s();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch(e){return!1}return!0}function v(){var e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?240:120}t.type="localstorage";var g={create:h,close:l,onMessage:p,postMessage:f,canBeUsed:b,type:"localstorage",averageResponseTime:v,microSeconds:a};t.default=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=c,t.canBeUsed=f,t.close=a,t.create=o,t.microSeconds=t.default=void 0,t.onMessage=u,t.postMessage=s,t.type=void 0;var n=r(24).microSeconds;t.microSeconds=n;t.type="simulate";var i=new Set;function o(e){var t={name:e,messagesCallback:null};return i.add(t),t}function a(e){i.delete(e)}function s(e,t){return new Promise((function(r){return setTimeout((function(){Array.from(i).filter((function(t){return t.name===e.name})).filter((function(t){return t!==e})).filter((function(e){return!!e.messagesCallback})).forEach((function(e){return e.messagesCallback(t)})),r()}),5)}))}function u(e,t){e.messagesCallback=t}function f(){return!0}function c(){return 5}var d={create:o,close:a,onMessage:u,postMessage:s,canBeUsed:f,type:"simulate",averageResponseTime:c,microSeconds:n};t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beLeader=s,t.createLeaderElection=function(e,t){if(e._leaderElector)throw new Error("BroadcastChannel already has a leader-elector");t=function(e,t){e||(e={});(e=JSON.parse(JSON.stringify(e))).fallbackInterval||(e.fallbackInterval=3e3);e.responseTime||(e.responseTime=t.method.averageResponseTime(t.options));return e}(t,e);var r=new o(e,t);return e._befC.push((function(){return r.die()})),e._leaderElector=r,r};var n=r(24),i=r(200),o=function(e,t){var r=this;this.broadcastChannel=e,this._options=t,this.isLeader=!1,this.hasLeader=!1,this.isDead=!1,this.token=(0,n.randomToken)(),this._aplQ=n.PROMISE_RESOLVED_VOID,this._aplQC=0,this._unl=[],this._lstns=[],this._dpL=function(){},this._dpLC=!1;var i=function(e){"leader"===e.context&&("death"===e.action&&(r.hasLeader=!1),"tell"===e.action&&(r.hasLeader=!0))};this.broadcastChannel.addEventListener("internal",i),this._lstns.push(i)};function a(e,t){var r={context:"leader",action:t,token:e.token};return e.broadcastChannel.postInternal(r)}function s(e){e.isLeader=!0,e.hasLeader=!0;var t=(0,i.add)((function(){return e.die()}));e._unl.push(t);var r=function(t){"leader"===t.context&&"apply"===t.action&&a(e,"tell"),"leader"!==t.context||"tell"!==t.action||e._dpLC||(e._dpLC=!0,e._dpL(),a(e,"tell"))};return e.broadcastChannel.addEventListener("internal",r),e._lstns.push(r),a(e,"tell")}o.prototype={applyOnce:function(e){var t=this;if(this.isLeader)return(0,n.sleep)(0,!0);if(this.isDead)return(0,n.sleep)(0,!1);if(this._aplQC>1)return this._aplQ;return this._aplQC=this._aplQC+1,this._aplQ=this._aplQ.then((function(){return function(){if(t.isLeader)return n.PROMISE_RESOLVED_TRUE;var r,i=!1,o=new Promise((function(e){r=function(){i=!0,e()}})),u=[],f=function(e){"leader"===e.context&&e.token!=t.token&&(u.push(e),"apply"===e.action&&e.token>t.token&&r(),"tell"===e.action&&(r(),t.hasLeader=!0))};t.broadcastChannel.addEventListener("internal",f);var c=e?4*t._options.responseTime:t._options.responseTime;return a(t,"apply").then((function(){return Promise.race([(0,n.sleep)(c),o.then((function(){return Promise.reject(new Error)}))])})).then((function(){return a(t,"apply")})).then((function(){return Promise.race([(0,n.sleep)(c),o.then((function(){return Promise.reject(new Error)}))])})).catch((function(){})).then((function(){return t.broadcastChannel.removeEventListener("internal",f),!i&&s(t).then((function(){return!0}))}))}()})).then((function(){t._aplQC=t._aplQC-1})),this._aplQ.then((function(){return t.isLeader}))},awaitLeadership:function(){return this._aLP||(this._aLP=function(e){if(e.isLeader)return n.PROMISE_RESOLVED_VOID;return new Promise((function(t){var r=!1;function i(){r||(r=!0,e.broadcastChannel.removeEventListener("internal",o),t(!0))}e.applyOnce().then((function(){e.isLeader&&i()}));!function t(){return(0,n.sleep)(e._options.fallbackInterval).then((function(){if(!e.isDead&&!r)return e.isLeader?void i():e.applyOnce(!0).then((function(){e.isLeader?i():t()}))}))}();var o=function(t){"leader"===t.context&&"death"===t.action&&(e.hasLeader=!1,e.applyOnce().then((function(){e.isLeader&&i()})))};e.broadcastChannel.addEventListener("internal",o),e._lstns.push(o)}))}(this)),this._aLP},set onduplicate(e){this._dpL=e},die:function(){var e=this;return this._lstns.forEach((function(t){return e.broadcastChannel.removeEventListener("internal",t)})),this._lstns=[],this._unl.forEach((function(e){return e.remove()})),this._unl=[],this.isLeader&&(this.hasLeader=!1,this.isLeader=!1),this.isDead=!0,a(this,"death")}}},function(e,t,r){"use strict";r.r(t),r.d(t,"add",(function(){return d})),r.d(t,"runAll",(function(){return h})),r.d(t,"removeAll",(function(){return l})),r.d(t,"getSize",(function(){return p}));var n=r(110),i=r.n(n);var o={add:function(e){if("function"==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope);else{if("function"!=typeof window.addEventListener)return;window.addEventListener("beforeunload",(function(){e()}),!0),window.addEventListener("unload",(function(){e()}),!0)}}},a=r(111),s=r.n(a),u=i.a?s.a:o,f=new Set,c=!1;function d(e){if(c||(c=!0,u.add(h)),"function"!=typeof e)throw new Error("Listener is no function");return f.add(e),{remove:function(){return f.delete(e)},run:function(){return f.delete(e),e()}}}function h(){var e=[];return f.forEach((function(t){e.push(t()),f.delete(t)})),Promise.all(e)}function l(){f.clear()}function p(){return f.size}}])}));
  //# sourceMappingURL=baseControllers.umd.min.js.map