!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}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=695)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}},,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),i=r(58),f=r(135),c=r(10),a=r(108),o=r(34),s=r(83),d=function(e){function t(r,n,i){var c=e.call(this)||this;switch(c.syncErrorValue=null,c.syncErrorThrown=!1,c.syncErrorThrowable=!1,c.isStopped=!1,arguments.length){case 0:c.destination=f.a;break;case 1:if(!r){c.destination=f.a;break}if("object"==typeof r){r instanceof t?(c.syncErrorThrowable=r.syncErrorThrowable,c.destination=r,r.add(c)):(c.syncErrorThrowable=!0,c.destination=new u(c,r));break}default:c.syncErrorThrowable=!0,c.destination=new u(c,r,n,i)}return c}return n.a(t,e),t.prototype[a.a]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(c.a),u=function(e){function t(t,r,n,c){var a,o=e.call(this)||this;o._parentSubscriber=t;var s=o;return Object(i.a)(r)?a=r:r&&(a=r.next,n=r.error,c=r.complete,r!==f.a&&(s=Object.create(r),Object(i.a)(s.unsubscribe)&&o.add(s.unsubscribe.bind(s)),s.unsubscribe=o.unsubscribe.bind(o))),o._context=s,o._next=a,o._error=n,o._complete=c,o}return n.a(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;o.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=o.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(s.a)(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;Object(s.a)(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};o.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),o.a.useDeprecatedSynchronousErrorHandling)throw e;Object(s.a)(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!o.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return o.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(Object(s.a)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d)},function(e,t,r){var n=r(13),i=r(28),f=r(49),c=r(42),a=r(59),o=function(e,t,r){var s,d,u,h,l=e&o.F,p=e&o.G,b=e&o.S,m=e&o.P,y=e&o.B,g=p?n:b?n[t]||(n[t]={}):(n[t]||{}).prototype,v=p?i:i[t]||(i[t]={}),w=v.prototype||(v.prototype={});for(s in p&&(r=t),r)u=((d=!l&&g&&void 0!==g[s])?g:r)[s],h=y&&d?a(u,n):m&&"function"==typeof u?a(Function.call,u):u,g&&c(g,s,u,e&o.U),v[s]!=u&&f(v,s,h),m&&w[s]!=u&&(w[s]=u)};n.core=i,o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,e.exports=o},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return s}));var n=r(0),i=r(2),f=r(7),c=r(82),a=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return n.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(i.a),o=(i.a,function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.a(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(i.a));i.a;function s(e,t){if(!t.closed){if(e instanceof f.a)return e.subscribe(t);var r;try{r=Object(c.a)(e)(t)}catch(e){t.error(e)}return r}}},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(132),i=r(2),f=r(108),c=r(135);var a=r(53),o=r(106),s=r(34),d=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,a=function(e,t,r){if(e){if(e instanceof i.a)return e;if(e[f.a])return e[f.a]()}return e||t||r?new i.a(e,t,r):new i.a(c.a)}(e,t,r);if(n?a.add(n.call(a,this.source)):a.add(this.source||s.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),s.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),Object(n.a)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=u(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[a.a]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:Object(o.b)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=u(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function u(e){if(e||(e=s.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},,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";r.d(t,"a",(function(){return a}));var n=r(18),i=r(131),f=r(58),c=r(109),a=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this._parentOrParents,a=this._ctorUnsubscribe,s=this._unsubscribe,d=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var u=0;u<r.length;++u){r[u].remove(this)}if(Object(f.a)(s)){a&&(this._unsubscribe=void 0);try{s.call(this)}catch(e){t=e instanceof c.a?o(e.errors):[e]}}if(Object(n.a)(d)){u=-1;for(var h=d.length;++u<h;){var l=d[u];if(Object(i.a)(l))try{l.unsubscribe()}catch(e){t=t||[],e instanceof c.a?t=t.concat(o(e.errors)):t.push(e)}}}if(t)throw new c.a(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var f=this._subscriptions;return null===f?this._subscriptions=[r]:f.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=((t=new e).closed=!0,t),e}();function o(e){return e.reduce((function(e,t){return e.concat(t instanceof c.a?t.errors:t)}),[])}},function(e,t,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=r(19),i=n.Buffer;function f(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(f(n,t),t.Buffer=c),c.prototype=Object.create(i.prototype),f(i,c),c.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},c.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},c.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},c.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";r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return u}));var n=r(0),i=r(7),f=r(2),c=r(10),a=r(54),o=r(188),s=r(108),d=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return n.a(t,e),t}(f.a),u=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.a(t,e),t.prototype[s.a]=function(){return new d(this)},t.prototype.lift=function(e){var t=new h(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new a.a;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new a.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new a.a;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new a.a;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new a.a;return this.hasError?(e.error(this.thrownError),c.a.EMPTY):this.isStopped?(e.complete(),c.a.EMPTY):(this.observers.push(e),new o.a(this,e))},t.prototype.asObservable=function(){var e=new i.a;return e.source=this,e},t.create=function(e,t){return new h(e,t)},t}(i.a),h=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return n.a(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):c.a.EMPTY},t}(u)},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(16);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return f}));var n=r(73),i=new(r(71).a)(n.a),f=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()},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(149),i=r(569),f=r(291);function c(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(c()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=o.prototype:(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(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 u(this,e)}return s(this,e,t,r)}function s(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);o.TYPED_ARRAY_SUPPORT?(e=t).__proto__=o.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(!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(o.isBuffer(t)){var r=0|l(t.length);return 0===(e=a(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?a(e,0):h(e,t);if("Buffer"===t.type&&f(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 d(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 u(e,t){if(d(t),e=a(e,t<0?0:0|l(t)),!o.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=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(e){if(e>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|e}function p(e,t){if(o.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 z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return z(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 E(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(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=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var f,c=1,a=e.length,o=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;c=2,a/=2,o/=2,r/=2}function s(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(i){var d=-1;for(f=r;f<a;f++)if(s(e,f)===s(t,-1===d?0:f-d)){if(-1===d&&(d=f),f-d+1===o)return d*c}else-1!==d&&(f-=f-d),d=-1}else for(r+o>a&&(r=a-o),f=r;f>=0;f--){for(var u=!0,h=0;h<o;h++)if(s(e,f+h)!==s(t,h)){u=!1;break}if(u)return f}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var f=t.length;if(f%2!=0)throw new TypeError("Invalid hex string");n>f/2&&(n=f/2);for(var c=0;c<n;++c){var a=parseInt(t.substr(2*c,2),16);if(isNaN(a))return c;e[r+c]=a}return c}function w(e,t,r,n){return q(z(t,e.length-r),e,r,n)}function M(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 O(e,t,r,n){return M(e,t,r,n)}function x(e,t,r,n){return q(V(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){for(var r,n,i,f=[],c=0;c<e.length&&!((t-=2)<0);++c)r=e.charCodeAt(c),n=r>>8,i=r%256,f.push(i),f.push(n);return f}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var f,c,a,o,s=e[i],d=null,u=s>239?4:s>223?3:s>191?2:1;if(i+u<=r)switch(u){case 1:s<128&&(d=s);break;case 2:128==(192&(f=e[i+1]))&&(o=(31&s)<<6|63&f)>127&&(d=o);break;case 3:f=e[i+1],c=e[i+2],128==(192&f)&&128==(192&c)&&(o=(15&s)<<12|(63&f)<<6|63&c)>2047&&(o<55296||o>57343)&&(d=o);break;case 4:f=e[i+1],c=e[i+2],a=e[i+3],128==(192&f)&&128==(192&c)&&128==(192&a)&&(o=(15&s)<<18|(63&f)<<12|(63&c)<<6|63&a)>65535&&o<1114112&&(d=o)}null===d?(d=65533,u=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),i+=u}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=o,t.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},t.INSPECT_MAX_BYTES=50,o.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=c(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,r){return s(null,e,t,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,r){return function(e,t,r,n){return d(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},o.allocUnsafe=function(e){return u(null,e)},o.allocUnsafeSlow=function(e){return u(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,f=Math.min(r,n);i<f;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.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}},o.concat=function(e,t){if(!f(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var c=e[r];if(!o.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(n,i),i+=c.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.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)m(this,t,t+1);return this},o.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)m(this,t,t+3),m(this,t+1,t+2);return this},o.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):b.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.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+">"},o.prototype.compare=function(e,t,r,n,i){if(!o.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 f=(i>>>=0)-(n>>>=0),c=(r>>>=0)-(t>>>=0),a=Math.min(f,c),s=this.slice(n,i),d=e.slice(t,r),u=0;u<a;++u)if(s[u]!==d[u]){f=s[u],c=d[u];break}return f<c?-1:c<f?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},o.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 f=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return M(this,e,t,r);case"latin1":case"binary":return O(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(f)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(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 A(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 E(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",f=t;f<r;++f)i+=L(e[f]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",f=0;f<n.length;f+=2)i+=String.fromCharCode(n[f]+256*n[f+1]);return i}function T(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 R(e,t,r,n,i,f){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<f)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,f=Math.min(e.length-r,2);i<f;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function _(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,f=Math.min(e.length-r,4);i<f;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function C(e,t,r,n,i,f){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,f){return f||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,f){return f||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}o.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),o.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=o.prototype;else{var i=t-e;r=new o(i,void 0);for(var f=0;f<i;++f)r[f]=this[f+e]}return r},o.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e],i=1,f=0;++f<t&&(i*=256);)n+=this[e+f]*i;return n},o.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return t||T(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||T(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||T(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=this[e],i=1,f=0;++f<t&&(i*=256);)n+=this[e+f]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||T(e,t,this.length);for(var n=t,i=1,f=this[e+--n];n>0&&(i*=256);)f+=this[e+--n]*i;return f>=(i*=128)&&(f-=Math.pow(2,8*t)),f},o.prototype.readInt8=function(e,t){return t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,f=0;for(this[t]=255&e;++f<r&&(i*=256);)this[t+f]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,f=1;for(this[t+i]=255&e;--i>=0&&(f*=256);)this[t+i]=e/f&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var f=0,c=1,a=0;for(this[t]=255&e;++f<r&&(c*=256);)e<0&&0===a&&0!==this[t+f-1]&&(a=1),this[t+f]=(e/c>>0)-a&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var f=r-1,c=1,a=0;for(this[t+f]=255&e;--f>=0&&(c*=256);)e<0&&0===a&&0!==this[t+f+1]&&(a=1),this[t+f]=(e/c>>0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},o.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,f=n-r;if(this===e&&r<t&&t<n)for(i=f-1;i>=0;--i)e[i+t]=this[i+r];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<f;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+f),t);return f},o.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&&!o.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 f;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(f=t;f<r;++f)this[f]=e;else{var c=o.isBuffer(e)?e:z(new o(e,n).toString()),a=c.length;for(f=0;f<r-t;++f)this[f+t]=c[f%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var r;t=t||1/0;for(var n=e.length,i=null,f=[],c=0;c<n;++c){if((r=e.charCodeAt(c))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&f.push(239,191,189);continue}if(c+1===n){(t-=3)>-1&&f.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&f.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&f.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;f.push(r)}else if(r<2048){if((t-=2)<0)break;f.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;f.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;f.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return f}function V(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(32))},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(567).Buffer}catch(e){}function a(e,t,r){for(var i=0,f=Math.min(e.length,r),c=0,a=t;a<f;a++){var o,s=e.charCodeAt(a)-48;i<<=4,i|=o=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:s,c|=o}return n(!(240&c),"Invalid character in "+e),i}function o(e,t,r,i){for(var f=0,c=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;f*=i,c=s>=49?s-49+10:s>=17?s-17+10:s,n(s>=0&&c<i,"Invalid character"),f+=c}return f}function s(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this._strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this._strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype._move=function(e){s(e,this)},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){f.prototype.inspect=d}else f.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?u[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 s=h[e],d=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(d).toString(e);r=(p=p.idivn(d)).isZero()?b+r:u[s-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")},f.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},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r._strip()}f.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0");var c=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,f);return this["_toArrayLike"+("le"===t?"LE":"BE")](c,i),c},f.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,f=0;i<this.length;i++){var c=this.words[i]<<f|n;e[r++]=255&c,r<e.length&&(e[r++]=c>>8&255),r<e.length&&(e[r++]=c>>16&255),6===f?(r<e.length&&(e[r++]=c>>24&255),n=0,f=0):(n=c>>>24,f+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},f.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,f=0;i<this.length;i++){var c=this.words[i]<<f|n;e[r--]=255&c,r>=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===f?(r>=0&&(e[r--]=c>>24&255),n=0,f=0):(n=c>>>24,f+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r._strip()}function y(e,t,r){return m(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(b=p),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):r<63?p(this,e,t):r<1024?m(this,e,t):y(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.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},g.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},g.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},g.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},g.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}},g.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},g.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),y(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.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 f=(0|this.words[i])*e,c=(67108863&f)+(67108863&r);r>>=26,r+=f/67108864|0,r+=c>>>26,this.words[i]=67108863&c}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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 f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this._strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,f=this.length-1;f>=0;f--)i=(r*i+(0|this.words[f]))%e;return t?-i:i},f.prototype.modn=function(e){return this.modrn(e)},f.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 f=(0|this.words[i])+67108864*r;this.words[i]=f/e|0,r=f%e}return this._strip(),t?this.ineg():this},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new k(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function O(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=f._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 j(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(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 f(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(M,w),M.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<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(O,w),i(x,w),i(S,w),S.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},f._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new O;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.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")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.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)},k.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},k.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)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}return h},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},f.mont=function(e){return new j(e)},i(j,k),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t,r){var n=r(152)("wks"),i=r(94),f=r(13).Symbol,c="function"==typeof f;(e.exports=function(e){return n[e]||(n[e]=c&&f[e]||(c?f:i)("Symbol."+e))}).store=n},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(0),i=r(2);function f(e,t){return function(r){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new c(e,t))}}var c=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}(),a=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return n.a(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(i.a)},function(e,t,r){"use strict";function n(e){return e&&"function"==typeof e.schedule}r.d(t,"a",(function(){return n}))},,function(e,t,r){var n=r(61),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t){var r,n,i=e.exports={};function f(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===f||!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:f}catch(e){r=f}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var o,s=[],d=!1,u=-1;function h(){d&&o&&(d=!1,o.length?s=o.concat(s):u=-1,s.length&&l())}function l(){if(!d){var e=a(h);d=!0;for(var t=s.length;t;){for(o=s,s=[];++u<t;)o&&o[u].run();u=-1,t=s.length}o=null,d=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!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];s.push(new p(e,t)),1!==s.length||d||a(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";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return f}));var n=r(7),i=new n.a((function(e){return e.complete()}));function f(e){return e?function(e){return new n.a((function(t){return e.schedule((function(){return t.complete()}))}))}(e):i}},function(e,t){var r=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=r)},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7),i=r(82),f=r(182);function c(e,t){return t?Object(f.a)(e,t):e instanceof n.a?e:new n.a(Object(i.a)(e))}},function(e,t,r){e.exports=!r(14)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(15),i=r(258),f=r(85),c=Object.defineProperty;t.f=r(30)?Object.defineProperty:function(e,t,r){if(n(e),t=f(t,!0),n(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},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";r.d(t,"a",(function(){return a}));var n=r(0),i=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return n.a(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(r(2).a),f=r(82),c=r(7);function a(e,t,r,n,a){if(void 0===a&&(a=new i(e,r,n)),!a.closed)return t instanceof c.a?t.subscribe(a):Object(f.a)(t)(a)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;n=e},get useDeprecatedSynchronousErrorHandling(){return n}}},function(e,t,r){var n=r(76);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";function n(e){return e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return c}));var n=r(89),i=r(92);function f(e,t){if(!e)throw new Error(Object(n.a)(t)?t():t)}function c(e,t){return f(!Object(i.a)(e),t),e}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.a(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(r(2).a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(0),i=r(2);function f(e,t){return function(r){return r.lift(new c(e,t))}}var c=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.predicate,this.thisArg))},e}(),a=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return n.a(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(i.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(37),i=r(184),f=r(183),c=r(90),a=r(91),o=r(194),s=r(185);function d(e){return e?Object(c.a)(e)?Object(i.a)(e):Object(a.a)(e)?Object(s.a)(e):Array.isArray(e)||Object(f.a)(e)?new Uint8Array(e):(Object(n.a)(Object(o.a)(e),()=>`Unable to convert ${e.toString()} (typeof ${typeof e}) to a Uint8Array`),e):new Uint8Array}},function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a}));var n,i=r(27),f=r(88),c=r(124);n||(n={});var a=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return Object(f.a)(this.value);case"E":return Object(c.a)(this.error);case"C":return Object(i.b)()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},function(e,t,r){var n=r(13),i=r(49),f=r(48),c=r(94)("src"),a=r(385),o=(""+a).split("toString");r(28).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,r,a){var s="function"==typeof r;s&&(f(r,"name")||i(r,"name",t)),e[t]!==r&&(s&&(f(r,c)||i(r,c,e[t]?""+e[t]:o.join(String(t)))),e===n?e[t]=r:a?e[t]?e[t]=r:i(e,t,r):(delete e[t],i(e,t,r)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[c]||a.call(this)}))},function(e,t,r){var n=r(3),i=r(14),f=r(76),c=/"/g,a=function(e,t,r,n){var i=String(f(e)),a="<"+t;return""!==r&&(a+=" "+r+'="'+String(n).replace(c,"&quot;")+'"'),a+">"+i+"</"+t+">"};e.exports=function(e,t){var r={};r[e]=t(a),n(n.P+n.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",r)}},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){r.d(t,"a",(function(){return n}));const n="undefined"!=typeof globalThis?globalThis:void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0}).call(this,r(32))},function(e,t,r){"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}r.d(t,"a",(function(){return i}));var i=n()},function(e,t,r){"use strict";function n(){}r.d(t,"a",(function(){return n}))},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(31),i=r(93);e.exports=r(30)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(138),i=r(76);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=t,i=r(79),f=r(44),c=r(226);n.assert=f,n.toArray=c.toArray,n.zero2=c.zero2,n.toHex=c.toHex,n.encode=c.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,f=e.clone(),c=0;c<n.length;c++){var a,o=f.andln(i-1);f.isOdd()?(a=o>(i>>1)-1?(i>>1)-o:o,f.isubn(a)):a=0,n[c]=a,f.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,f=0;e.cmpn(-i)>0||t.cmpn(-f)>0;){var c,a,o=e.andln(3)+i&3,s=t.andln(3)+f&3;3===o&&(o=-1),3===s&&(s=-1),c=0==(1&o)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==s?o:-o,r[0].push(c),a=0==(1&s)?0:3!==(n=t.andln(7)+f&7)&&5!==n||2!==o?s:-s,r[1].push(a),2*i===c+1&&(i=1-i),2*f===a+1&&(f=1-f),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=t,i=r(80),f=r(44),c=r(226);n.assert=f,n.toArray=c.toArray,n.zero2=c.zero2,n.toHex=c.toHex,n.encode=c.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,f=e.clone(),c=0;c<n.length;c++){var a,o=f.andln(i-1);f.isOdd()?(a=o>(i>>1)-1?(i>>1)-o:o,f.isubn(a)):a=0,n[c]=a,f.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var f,c,a,o=e.andln(3)+n&3,s=t.andln(3)+i&3;if(3===o&&(o=-1),3===s&&(s=-1),0==(1&o))f=0;else f=3!==(a=e.andln(7)+n&7)&&5!==a||2!==s?o:-o;if(r[0].push(f),0==(1&s))c=0;else c=3!==(a=t.andln(7)+i&7)&&5!==a||2!==o?s:-s;r[1].push(c),2*n===f+1&&(n=1-n),2*i===c+1&&(i=1-i),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";r.d(t,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},,function(e,t,r){"use strict";var n=r(14);e.exports=function(e,t){return!!e&&n((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,r){"use strict";function n(e){return"function"==typeof e}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(60);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(139),i=r(93),f=r(50),c=r(85),a=r(48),o=r(258),s=Object.getOwnPropertyDescriptor;t.f=r(30)?s:function(e,t){if(e=f(e),t=c(t,!0),o)try{return s(e,t)}catch(e){}if(a(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){var n=r(3),i=r(28),f=r(14);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],c={};c[e]=t(r),n(n.S+n.F*f((function(){r(1)})),"Object",c)}},function(e,t,r){var n=r(59),i=r(138),f=r(35),c=r(25),a=r(274);e.exports=function(e,t){var r=1==e,o=2==e,s=3==e,d=4==e,u=6==e,h=5==e||u,l=t||a;return function(t,a,p){for(var b,m,y=f(t),g=i(y),v=n(a,p,3),w=c(g.length),M=0,O=r?l(t,w):o?l(t,0):void 0;w>M;M++)if((h||M in g)&&(m=v(b=g[M],M,y),e))if(r)O[M]=m;else if(m)switch(e){case 3:return!0;case 5:return b;case 6:return M;case 2:O.push(b)}else if(d)return!1;return u?-1:s||d?d:O}}},function(e,t,r){"use strict";var n=r(44),i=r(9);function f(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function c(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function o(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 c=e.charCodeAt(i);c<128?r[n++]=c:c<2048?(r[n++]=c>>6|192,r[n++]=63&c|128):f(e,i)?(c=65536+((1023&c)<<10)+(1023&e.charCodeAt(++i)),r[n++]=c>>18|240,r[n++]=c>>12&63|128,r[n++]=c>>6&63|128,r[n++]=63&c|128):(r[n++]=c>>12|224,r[n++]=c>>6&63|128,r[n++]=63&c|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+=a(e[r].toString(16));return t},t.htonl=c,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=c(i)),r+=o(i.toString(16))}return r},t.zero2=a,t.zero8=o,t.join32=function(e,t,r,i){var f=r-t;n(f%4==0);for(var c=new Array(f/4),a=0,o=t;a<c.length;a++,o+=4){var s;s="big"===i?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:e[o+3]<<24|e[o+2]<<16|e[o+1]<<8|e[o],c[a]=s>>>0}return c},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var f=e[n];"big"===t?(r[i]=f>>>24,r[i+1]=f>>>16&255,r[i+2]=f>>>8&255,r[i+3]=255&f):(r[i+3]=f>>>24,r[i+2]=f>>>16&255,r[i+1]=f>>>8&255,r[i]=255&f)}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],f=n+e[t+1]>>>0,c=(f<n?1:0)+r+i;e[t]=c>>>0,e[t+1]=f},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,f,c,a){var o=0,s=t;return o+=(s=s+n>>>0)<t?1:0,o+=(s=s+f>>>0)<f?1:0,e+r+i+c+(o+=(s=s+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,f,c,a){return t+n+f+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,f,c,a,o,s){var d=0,u=t;return d+=(u=u+n>>>0)<t?1:0,d+=(u=u+f>>>0)<f?1:0,d+=(u=u+a>>>0)<a?1:0,e+r+i+c+o+(d+=(u=u+s>>>0)<s?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,f,c,a,o,s){return t+n+f+a+s>>>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){var n=t;n.utils=r(65),n.common=r(143),n.sha=r(579),n.ripemd=r(583),n.hmac=r(584),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";r.d(t,"a",(function(){return n}));var n=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return d}));var n=r(0),i=r(22),f=r(29),c=r(4);function a(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?function(n){return n.pipe(a((function(r,n){return Object(f.a)(e(r,n)).pipe(Object(i.a)((function(e,i){return t(r,e,n,i)})))}),r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new o(e,r))})}var o=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent))},e}(),s=function(e){function t(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return n.a(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new c.a(this),r=this.destination;r.add(t);var n=Object(c.c)(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(c.b),d=a},function(e,t,r){!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),f=new Uint8Array(32);f[0]=9;var c=t(),a=t([1]),o=t([56129,1]),s=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function b(e,t,r,n,i){var f,c=0;for(f=0;f<i;f++)c|=e[t+f]^r[n+f];return(1&c-1>>>8)-1}function m(e,t,r,n){return b(e,t,r,n,16)}function y(e,t,r,n){return b(e,t,r,n,32)}function g(e,t,r,n){!function(e,t,r,n){for(var i,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,o=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,s=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,g=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=f,O=c,x=a,S=o,k=s,j=d,P=u,A=h,E=l,I=p,T=b,R=m,N=y,_=g,C=v,B=w,H=0;H<20;H+=2)M^=(i=(N^=(i=(E^=(i=(k^=(i=M+N|0)<<7|i>>>25)+M|0)<<9|i>>>23)+k|0)<<13|i>>>19)+E|0)<<18|i>>>14,j^=(i=(O^=(i=(_^=(i=(I^=(i=j+O|0)<<7|i>>>25)+j|0)<<9|i>>>23)+I|0)<<13|i>>>19)+_|0)<<18|i>>>14,T^=(i=(P^=(i=(x^=(i=(C^=(i=T+P|0)<<7|i>>>25)+T|0)<<9|i>>>23)+C|0)<<13|i>>>19)+x|0)<<18|i>>>14,B^=(i=(R^=(i=(A^=(i=(S^=(i=B+R|0)<<7|i>>>25)+B|0)<<9|i>>>23)+S|0)<<13|i>>>19)+A|0)<<18|i>>>14,M^=(i=(S^=(i=(x^=(i=(O^=(i=M+S|0)<<7|i>>>25)+M|0)<<9|i>>>23)+O|0)<<13|i>>>19)+x|0)<<18|i>>>14,j^=(i=(k^=(i=(A^=(i=(P^=(i=j+k|0)<<7|i>>>25)+j|0)<<9|i>>>23)+P|0)<<13|i>>>19)+A|0)<<18|i>>>14,T^=(i=(I^=(i=(E^=(i=(R^=(i=T+I|0)<<7|i>>>25)+T|0)<<9|i>>>23)+R|0)<<13|i>>>19)+E|0)<<18|i>>>14,B^=(i=(C^=(i=(_^=(i=(N^=(i=B+C|0)<<7|i>>>25)+B|0)<<9|i>>>23)+N|0)<<13|i>>>19)+_|0)<<18|i>>>14;M=M+f|0,O=O+c|0,x=x+a|0,S=S+o|0,k=k+s|0,j=j+d|0,P=P+u|0,A=A+h|0,E=E+l|0,I=I+p|0,T=T+b|0,R=R+m|0,N=N+y|0,_=_+g|0,C=C+v|0,B=B+w|0,e[0]=M>>>0&255,e[1]=M>>>8&255,e[2]=M>>>16&255,e[3]=M>>>24&255,e[4]=O>>>0&255,e[5]=O>>>8&255,e[6]=O>>>16&255,e[7]=O>>>24&255,e[8]=x>>>0&255,e[9]=x>>>8&255,e[10]=x>>>16&255,e[11]=x>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=j>>>0&255,e[21]=j>>>8&255,e[22]=j>>>16&255,e[23]=j>>>24&255,e[24]=P>>>0&255,e[25]=P>>>8&255,e[26]=P>>>16&255,e[27]=P>>>24&255,e[28]=A>>>0&255,e[29]=A>>>8&255,e[30]=A>>>16&255,e[31]=A>>>24&255,e[32]=E>>>0&255,e[33]=E>>>8&255,e[34]=E>>>16&255,e[35]=E>>>24&255,e[36]=I>>>0&255,e[37]=I>>>8&255,e[38]=I>>>16&255,e[39]=I>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=N>>>0&255,e[49]=N>>>8&255,e[50]=N>>>16&255,e[51]=N>>>24&255,e[52]=_>>>0&255,e[53]=_>>>8&255,e[54]=_>>>16&255,e[55]=_>>>24&255,e[56]=C>>>0&255,e[57]=C>>>8&255,e[58]=C>>>16&255,e[59]=C>>>24&255,e[60]=B>>>0&255,e[61]=B>>>8&255,e[62]=B>>>16&255,e[63]=B>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,o=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,s=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,d=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,g=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=0;M<20;M+=2)f^=(i=(y^=(i=(l^=(i=(s^=(i=f+y|0)<<7|i>>>25)+f|0)<<9|i>>>23)+s|0)<<13|i>>>19)+l|0)<<18|i>>>14,d^=(i=(c^=(i=(g^=(i=(p^=(i=d+c|0)<<7|i>>>25)+d|0)<<9|i>>>23)+p|0)<<13|i>>>19)+g|0)<<18|i>>>14,b^=(i=(u^=(i=(a^=(i=(v^=(i=b+u|0)<<7|i>>>25)+b|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(m^=(i=(h^=(i=(o^=(i=w+m|0)<<7|i>>>25)+w|0)<<9|i>>>23)+o|0)<<13|i>>>19)+h|0)<<18|i>>>14,f^=(i=(o^=(i=(a^=(i=(c^=(i=f+o|0)<<7|i>>>25)+f|0)<<9|i>>>23)+c|0)<<13|i>>>19)+a|0)<<18|i>>>14,d^=(i=(s^=(i=(h^=(i=(u^=(i=d+s|0)<<7|i>>>25)+d|0)<<9|i>>>23)+u|0)<<13|i>>>19)+h|0)<<18|i>>>14,b^=(i=(p^=(i=(l^=(i=(m^=(i=b+p|0)<<7|i>>>25)+b|0)<<9|i>>>23)+m|0)<<13|i>>>19)+l|0)<<18|i>>>14,w^=(i=(v^=(i=(g^=(i=(y^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+y|0)<<13|i>>>19)+g|0)<<18|i>>>14;e[0]=f>>>0&255,e[1]=f>>>8&255,e[2]=f>>>16&255,e[3]=f>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=l>>>0&255,e[25]=l>>>8&255,e[26]=l>>>16&255,e[27]=l>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function M(e,t,r,n,i,f,c){var a,o,s=new Uint8Array(16),d=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=f[o];for(;i>=64;){for(g(d,s,c,w),o=0;o<64;o++)e[t+o]=r[n+o]^d[o];for(a=1,o=8;o<16;o++)a=a+(255&s[o])|0,s[o]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(g(d,s,c,w),o=0;o<i;o++)e[t+o]=r[n+o]^d[o];return 0}function O(e,t,r,n,i){var f,c,a=new Uint8Array(16),o=new Uint8Array(64);for(c=0;c<16;c++)a[c]=0;for(c=0;c<8;c++)a[c]=n[c];for(;r>=64;){for(g(o,a,i,w),c=0;c<64;c++)e[t+c]=o[c];for(f=1,c=8;c<16;c++)f=f+(255&a[c])|0,a[c]=255&f,f>>>=8;r-=64,t+=64}if(r>0)for(g(o,a,i,w),c=0;c<r;c++)e[t+c]=o[c];return 0}function x(e,t,r,n,i){var f=new Uint8Array(32);v(f,n,i,w);for(var c=new Uint8Array(8),a=0;a<8;a++)c[a]=n[a+16];return O(e,t,r,c,f)}function S(e,t,r,n,i,f,c){var a=new Uint8Array(32);v(a,f,c,w);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=f[s+16];return M(e,t,r,n,i,o,a)}var k=function(e){var t,r,n,i,f,c,a,o;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),f=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|f<<12),this.r[5]=f>>>1&8190,c=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(f>>>14|c<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(c>>>11|a<<5),o=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|o<<8),this.r[9]=o>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function j(e,t,r,n,i,f){var c=new k(f);return c.update(r,n,i),c.finish(e,t),0}function P(e,t,r,n,i,f){var c=new Uint8Array(16);return j(c,0,r,n,i,f),m(e,t,c,0)}function A(e,t,r,n,i){var f;if(r<32)return-1;for(S(e,0,t,0,r,n,i),j(e,16,e,32,r-32,e),f=0;f<16;f++)e[f]=0;return 0}function E(e,t,r,n,i){var f,c=new Uint8Array(32);if(r<32)return-1;if(x(c,0,32,n,i),0!==P(t,16,t,32,r-32,c))return-1;for(S(e,0,t,0,r,n,i),f=0;f<32;f++)e[f]=0;return 0}function I(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function R(e,t,r){for(var n,i=~(r-1),f=0;f<16;f++)n=i&(e[f]^t[f]),e[f]^=n,t[f]^=n}function N(e,r){var n,i,f,c=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(T(a),T(a),T(a),i=0;i<2;i++){for(c[0]=a[0]-65517,n=1;n<15;n++)c[n]=a[n]-65535-(c[n-1]>>16&1),c[n-1]&=65535;c[15]=a[15]-32767-(c[14]>>16&1),f=c[15]>>16&1,c[14]&=65535,R(a,c,1-f)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function _(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return N(r,e),N(n,t),y(r,0,n,0)}function C(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function B(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function H(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function D(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function L(e,t,r){var n,i,f=0,c=0,a=0,o=0,s=0,d=0,u=0,h=0,l=0,p=0,b=0,m=0,y=0,g=0,v=0,w=0,M=0,O=0,x=0,S=0,k=0,j=0,P=0,A=0,E=0,I=0,T=0,R=0,N=0,_=0,C=0,B=r[0],H=r[1],D=r[2],L=r[3],z=r[4],V=r[5],q=r[6],U=r[7],F=r[8],W=r[9],K=r[10],X=r[11],Z=r[12],G=r[13],Y=r[14],J=r[15];f+=(n=t[0])*B,c+=n*H,a+=n*D,o+=n*L,s+=n*z,d+=n*V,u+=n*q,h+=n*U,l+=n*F,p+=n*W,b+=n*K,m+=n*X,y+=n*Z,g+=n*G,v+=n*Y,w+=n*J,c+=(n=t[1])*B,a+=n*H,o+=n*D,s+=n*L,d+=n*z,u+=n*V,h+=n*q,l+=n*U,p+=n*F,b+=n*W,m+=n*K,y+=n*X,g+=n*Z,v+=n*G,w+=n*Y,M+=n*J,a+=(n=t[2])*B,o+=n*H,s+=n*D,d+=n*L,u+=n*z,h+=n*V,l+=n*q,p+=n*U,b+=n*F,m+=n*W,y+=n*K,g+=n*X,v+=n*Z,w+=n*G,M+=n*Y,O+=n*J,o+=(n=t[3])*B,s+=n*H,d+=n*D,u+=n*L,h+=n*z,l+=n*V,p+=n*q,b+=n*U,m+=n*F,y+=n*W,g+=n*K,v+=n*X,w+=n*Z,M+=n*G,O+=n*Y,x+=n*J,s+=(n=t[4])*B,d+=n*H,u+=n*D,h+=n*L,l+=n*z,p+=n*V,b+=n*q,m+=n*U,y+=n*F,g+=n*W,v+=n*K,w+=n*X,M+=n*Z,O+=n*G,x+=n*Y,S+=n*J,d+=(n=t[5])*B,u+=n*H,h+=n*D,l+=n*L,p+=n*z,b+=n*V,m+=n*q,y+=n*U,g+=n*F,v+=n*W,w+=n*K,M+=n*X,O+=n*Z,x+=n*G,S+=n*Y,k+=n*J,u+=(n=t[6])*B,h+=n*H,l+=n*D,p+=n*L,b+=n*z,m+=n*V,y+=n*q,g+=n*U,v+=n*F,w+=n*W,M+=n*K,O+=n*X,x+=n*Z,S+=n*G,k+=n*Y,j+=n*J,h+=(n=t[7])*B,l+=n*H,p+=n*D,b+=n*L,m+=n*z,y+=n*V,g+=n*q,v+=n*U,w+=n*F,M+=n*W,O+=n*K,x+=n*X,S+=n*Z,k+=n*G,j+=n*Y,P+=n*J,l+=(n=t[8])*B,p+=n*H,b+=n*D,m+=n*L,y+=n*z,g+=n*V,v+=n*q,w+=n*U,M+=n*F,O+=n*W,x+=n*K,S+=n*X,k+=n*Z,j+=n*G,P+=n*Y,A+=n*J,p+=(n=t[9])*B,b+=n*H,m+=n*D,y+=n*L,g+=n*z,v+=n*V,w+=n*q,M+=n*U,O+=n*F,x+=n*W,S+=n*K,k+=n*X,j+=n*Z,P+=n*G,A+=n*Y,E+=n*J,b+=(n=t[10])*B,m+=n*H,y+=n*D,g+=n*L,v+=n*z,w+=n*V,M+=n*q,O+=n*U,x+=n*F,S+=n*W,k+=n*K,j+=n*X,P+=n*Z,A+=n*G,E+=n*Y,I+=n*J,m+=(n=t[11])*B,y+=n*H,g+=n*D,v+=n*L,w+=n*z,M+=n*V,O+=n*q,x+=n*U,S+=n*F,k+=n*W,j+=n*K,P+=n*X,A+=n*Z,E+=n*G,I+=n*Y,T+=n*J,y+=(n=t[12])*B,g+=n*H,v+=n*D,w+=n*L,M+=n*z,O+=n*V,x+=n*q,S+=n*U,k+=n*F,j+=n*W,P+=n*K,A+=n*X,E+=n*Z,I+=n*G,T+=n*Y,R+=n*J,g+=(n=t[13])*B,v+=n*H,w+=n*D,M+=n*L,O+=n*z,x+=n*V,S+=n*q,k+=n*U,j+=n*F,P+=n*W,A+=n*K,E+=n*X,I+=n*Z,T+=n*G,R+=n*Y,N+=n*J,v+=(n=t[14])*B,w+=n*H,M+=n*D,O+=n*L,x+=n*z,S+=n*V,k+=n*q,j+=n*U,P+=n*F,A+=n*W,E+=n*K,I+=n*X,T+=n*Z,R+=n*G,N+=n*Y,_+=n*J,w+=(n=t[15])*B,c+=38*(O+=n*D),a+=38*(x+=n*L),o+=38*(S+=n*z),s+=38*(k+=n*V),d+=38*(j+=n*q),u+=38*(P+=n*U),h+=38*(A+=n*F),l+=38*(E+=n*W),p+=38*(I+=n*K),b+=38*(T+=n*X),m+=38*(R+=n*Z),y+=38*(N+=n*G),g+=38*(_+=n*Y),v+=38*(C+=n*J),f=(n=(f+=38*(M+=n*H))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=(f+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),f+=i-1+37*(i-1),e[0]=f,e[1]=c,e[2]=a,e[3]=o,e[4]=s,e[5]=d,e[6]=u,e[7]=h,e[8]=l,e[9]=p,e[10]=b,e[11]=m,e[12]=y,e[13]=g,e[14]=v,e[15]=w}function z(e,t){L(e,t,t)}function V(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)z(i,i),2!==n&&4!==n&&L(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function q(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)z(i,i),1!==n&&L(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function U(e,r,n){var i,f,c=new Uint8Array(32),a=new Float64Array(80),s=t(),d=t(),u=t(),h=t(),l=t(),p=t();for(f=0;f<31;f++)c[f]=r[f];for(c[31]=127&r[31]|64,c[0]&=248,B(a,n),f=0;f<16;f++)d[f]=a[f],h[f]=s[f]=u[f]=0;for(s[0]=h[0]=1,f=254;f>=0;--f)R(s,d,i=c[f>>>3]>>>(7&f)&1),R(u,h,i),H(l,s,u),D(s,s,u),H(u,d,h),D(d,d,h),z(h,l),z(p,s),L(s,u,s),L(u,d,l),H(l,s,u),D(s,s,u),z(d,s),D(u,h,p),L(s,u,o),H(s,s,h),L(u,u,s),L(s,h,p),L(h,d,a),z(d,l),R(s,d,i),R(u,h,i);for(f=0;f<16;f++)a[f+16]=s[f],a[f+32]=u[f],a[f+48]=d[f],a[f+64]=h[f];var b=a.subarray(32),m=a.subarray(16);return V(b,b),L(m,m,b),N(e,m),0}function F(e,t){return U(e,t,f)}function W(e,t){return n(t,32),F(e,t)}function K(e,t,r){var n=new Uint8Array(32);return U(n,r,t),v(e,i,n,w)}k.prototype.blocks=function(e,t,r){for(var n,i,f,c,a,o,s,d,u,h,l,p,b,m,y,g,v,w,M,O=this.fin?0:2048,x=this.h[0],S=this.h[1],k=this.h[2],j=this.h[3],P=this.h[4],A=this.h[5],E=this.h[6],I=this.h[7],T=this.h[8],R=this.h[9],N=this.r[0],_=this.r[1],C=this.r[2],B=this.r[3],H=this.r[4],D=this.r[5],L=this.r[6],z=this.r[7],V=this.r[8],q=this.r[9];r>=16;)h=u=0,h+=(x+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*N,h+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),h+=(k+=8191&(i>>>10|(f=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*V),h+=(j+=8191&(f>>>7|(c=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*z),u=(h+=(P+=8191&(c>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,h&=8191,h+=(A+=a>>>1&8191)*(5*D),h+=(E+=8191&(a>>>14|(o=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*H),h+=(I+=8191&(o>>>11|(s=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*B),h+=(T+=8191&(s>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*C),l=u+=(h+=(R+=d>>>5|O)*(5*_))>>>13,l+=x*_,l+=S*N,l+=k*(5*q),l+=j*(5*V),u=(l+=P*(5*z))>>>13,l&=8191,l+=A*(5*L),l+=E*(5*D),l+=I*(5*H),l+=T*(5*B),u+=(l+=R*(5*C))>>>13,l&=8191,p=u,p+=x*C,p+=S*_,p+=k*N,p+=j*(5*q),u=(p+=P*(5*V))>>>13,p&=8191,p+=A*(5*z),p+=E*(5*L),p+=I*(5*D),p+=T*(5*H),b=u+=(p+=R*(5*B))>>>13,b+=x*B,b+=S*C,b+=k*_,b+=j*N,u=(b+=P*(5*q))>>>13,b&=8191,b+=A*(5*V),b+=E*(5*z),b+=I*(5*L),b+=T*(5*D),m=u+=(b+=R*(5*H))>>>13,m+=x*H,m+=S*B,m+=k*C,m+=j*_,u=(m+=P*N)>>>13,m&=8191,m+=A*(5*q),m+=E*(5*V),m+=I*(5*z),m+=T*(5*L),y=u+=(m+=R*(5*D))>>>13,y+=x*D,y+=S*H,y+=k*B,y+=j*C,u=(y+=P*_)>>>13,y&=8191,y+=A*N,y+=E*(5*q),y+=I*(5*V),y+=T*(5*z),g=u+=(y+=R*(5*L))>>>13,g+=x*L,g+=S*D,g+=k*H,g+=j*B,u=(g+=P*C)>>>13,g&=8191,g+=A*_,g+=E*N,g+=I*(5*q),g+=T*(5*V),v=u+=(g+=R*(5*z))>>>13,v+=x*z,v+=S*L,v+=k*D,v+=j*H,u=(v+=P*B)>>>13,v&=8191,v+=A*C,v+=E*_,v+=I*N,v+=T*(5*q),w=u+=(v+=R*(5*V))>>>13,w+=x*V,w+=S*z,w+=k*L,w+=j*D,u=(w+=P*H)>>>13,w&=8191,w+=A*B,w+=E*C,w+=I*_,w+=T*N,M=u+=(w+=R*(5*q))>>>13,M+=x*q,M+=S*V,M+=k*z,M+=j*L,u=(M+=P*D)>>>13,M&=8191,M+=A*H,M+=E*B,M+=I*C,M+=T*_,x=h=8191&(u=(u=((u+=(M+=R*N)>>>13)<<2)+u|0)+(h&=8191)|0),S=l+=u>>>=13,k=p&=8191,j=b&=8191,P=m&=8191,A=y&=8191,E=g&=8191,I=v&=8191,T=w&=8191,R=M&=8191,t+=16,r-=16;this.h[0]=x,this.h[1]=S,this.h[2]=k,this.h[3]=j,this.h[4]=P,this.h[5]=A,this.h[6]=E,this.h[7]=I,this.h[8]=T,this.h[9]=R},k.prototype.finish=function(e,t){var r,n,i,f,c=new Uint16Array(10);if(this.leftover){for(f=this.leftover,this.buffer[f++]=1;f<16;f++)this.buffer[f]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,f=2;f<10;f++)this.h[f]+=r,r=this.h[f]>>>13,this.h[f]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,c[0]=this.h[0]+5,r=c[0]>>>13,c[0]&=8191,f=1;f<10;f++)c[f]=this.h[f]+r,r=c[f]>>>13,c[f]&=8191;for(c[9]-=8192,n=(1^r)-1,f=0;f<10;f++)c[f]&=n;for(n=~n,f=0;f<10;f++)this.h[f]=this.h[f]&n|c[f];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,f=1;f<8;f++)i=(this.h[f]+this.pad[f]|0)+(i>>>16)|0,this.h[f]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var X=A,Z=E;var G=[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 Y(e,t,r,n){for(var i,f,c,a,o,s,d,u,h,l,p,b,m,y,g,v,w,M,O,x,S,k,j,P,A,E,I=new Int32Array(16),T=new Int32Array(16),R=e[0],N=e[1],_=e[2],C=e[3],B=e[4],H=e[5],D=e[6],L=e[7],z=t[0],V=t[1],q=t[2],U=t[3],F=t[4],W=t[5],K=t[6],X=t[7],Z=0;n>=128;){for(O=0;O<16;O++)x=8*O+Z,I[O]=r[x+0]<<24|r[x+1]<<16|r[x+2]<<8|r[x+3],T[O]=r[x+4]<<24|r[x+5]<<16|r[x+6]<<8|r[x+7];for(O=0;O<80;O++)if(i=R,f=N,c=_,a=C,o=B,s=H,d=D,L,h=z,l=V,p=q,b=U,m=F,y=W,g=K,X,j=65535&(k=X),P=k>>>16,A=65535&(S=L),E=S>>>16,j+=65535&(k=(F>>>14|B<<18)^(F>>>18|B<<14)^(B>>>9|F<<23)),P+=k>>>16,A+=65535&(S=(B>>>14|F<<18)^(B>>>18|F<<14)^(F>>>9|B<<23)),E+=S>>>16,j+=65535&(k=F&W^~F&K),P+=k>>>16,A+=65535&(S=B&H^~B&D),E+=S>>>16,j+=65535&(k=G[2*O+1]),P+=k>>>16,A+=65535&(S=G[2*O]),E+=S>>>16,S=I[O%16],P+=(k=T[O%16])>>>16,A+=65535&S,E+=S>>>16,A+=(P+=(j+=65535&k)>>>16)>>>16,j=65535&(k=M=65535&j|P<<16),P=k>>>16,A=65535&(S=w=65535&A|(E+=A>>>16)<<16),E=S>>>16,j+=65535&(k=(z>>>28|R<<4)^(R>>>2|z<<30)^(R>>>7|z<<25)),P+=k>>>16,A+=65535&(S=(R>>>28|z<<4)^(z>>>2|R<<30)^(z>>>7|R<<25)),E+=S>>>16,P+=(k=z&V^z&q^V&q)>>>16,A+=65535&(S=R&N^R&_^N&_),E+=S>>>16,u=65535&(A+=(P+=(j+=65535&k)>>>16)>>>16)|(E+=A>>>16)<<16,v=65535&j|P<<16,j=65535&(k=b),P=k>>>16,A=65535&(S=a),E=S>>>16,P+=(k=M)>>>16,A+=65535&(S=w),E+=S>>>16,N=i,_=f,C=c,B=a=65535&(A+=(P+=(j+=65535&k)>>>16)>>>16)|(E+=A>>>16)<<16,H=o,D=s,L=d,R=u,V=h,q=l,U=p,F=b=65535&j|P<<16,W=m,K=y,X=g,z=v,O%16==15)for(x=0;x<16;x++)S=I[x],j=65535&(k=T[x]),P=k>>>16,A=65535&S,E=S>>>16,S=I[(x+9)%16],j+=65535&(k=T[(x+9)%16]),P+=k>>>16,A+=65535&S,E+=S>>>16,w=I[(x+1)%16],j+=65535&(k=((M=T[(x+1)%16])>>>1|w<<31)^(M>>>8|w<<24)^(M>>>7|w<<25)),P+=k>>>16,A+=65535&(S=(w>>>1|M<<31)^(w>>>8|M<<24)^w>>>7),E+=S>>>16,w=I[(x+14)%16],P+=(k=((M=T[(x+14)%16])>>>19|w<<13)^(w>>>29|M<<3)^(M>>>6|w<<26))>>>16,A+=65535&(S=(w>>>19|M<<13)^(M>>>29|w<<3)^w>>>6),E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,I[x]=65535&A|E<<16,T[x]=65535&j|P<<16;j=65535&(k=z),P=k>>>16,A=65535&(S=R),E=S>>>16,S=e[0],P+=(k=t[0])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[0]=R=65535&A|E<<16,t[0]=z=65535&j|P<<16,j=65535&(k=V),P=k>>>16,A=65535&(S=N),E=S>>>16,S=e[1],P+=(k=t[1])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[1]=N=65535&A|E<<16,t[1]=V=65535&j|P<<16,j=65535&(k=q),P=k>>>16,A=65535&(S=_),E=S>>>16,S=e[2],P+=(k=t[2])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[2]=_=65535&A|E<<16,t[2]=q=65535&j|P<<16,j=65535&(k=U),P=k>>>16,A=65535&(S=C),E=S>>>16,S=e[3],P+=(k=t[3])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[3]=C=65535&A|E<<16,t[3]=U=65535&j|P<<16,j=65535&(k=F),P=k>>>16,A=65535&(S=B),E=S>>>16,S=e[4],P+=(k=t[4])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[4]=B=65535&A|E<<16,t[4]=F=65535&j|P<<16,j=65535&(k=W),P=k>>>16,A=65535&(S=H),E=S>>>16,S=e[5],P+=(k=t[5])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[5]=H=65535&A|E<<16,t[5]=W=65535&j|P<<16,j=65535&(k=K),P=k>>>16,A=65535&(S=D),E=S>>>16,S=e[6],P+=(k=t[6])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[6]=D=65535&A|E<<16,t[6]=K=65535&j|P<<16,j=65535&(k=X),P=k>>>16,A=65535&(S=L),E=S>>>16,S=e[7],P+=(k=t[7])>>>16,A+=65535&S,E+=S>>>16,E+=(A+=(P+=(j+=65535&k)>>>16)>>>16)>>>16,e[7]=L=65535&A|E<<16,t[7]=X=65535&j|P<<16,Z+=128,n-=128}return n}function J(e,t,r){var n,i=new Int32Array(8),f=new Int32Array(8),c=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,f[0]=4089235720,f[1]=2227873595,f[2]=4271175723,f[3]=1595750129,f[4]=2917565137,f[5]=725511199,f[6]=4215389547,f[7]=327033209,Y(i,f,t,r),r%=128,n=0;n<r;n++)c[n]=t[a-r+n];for(c[r]=128,c[(r=256-128*(r<112?1:0))-9]=0,p(c,r-8,a/536870912|0,a<<3),Y(i,f,c,r),n=0;n<8;n++)p(e,8*n,i[n],f[n]);return 0}function Q(e,r){var n=t(),i=t(),f=t(),c=t(),a=t(),o=t(),s=t(),u=t(),h=t();D(n,e[1],e[0]),D(h,r[1],r[0]),L(n,n,h),H(i,e[0],e[1]),H(h,r[0],r[1]),L(i,i,h),L(f,e[3],r[3]),L(f,f,d),L(c,e[2],r[2]),H(c,c,c),D(a,i,n),D(o,c,f),H(s,c,f),H(u,i,n),L(e[0],a,o),L(e[1],u,s),L(e[2],s,o),L(e[3],a,u)}function $(e,t,r){var n;for(n=0;n<4;n++)R(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),f=t();V(f,r[2]),L(n,r[0],f),L(i,r[1],f),N(e,i),e[31]^=C(n)<<7}function te(e,t,r){var n,i;for(I(e[0],c),I(e[1],a),I(e[2],a),I(e[3],c),i=255;i>=0;--i)$(e,t,n=r[i/8|0]>>(7&i)&1),Q(t,e),Q(e,e),$(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];I(n[0],u),I(n[1],h),I(n[2],a),L(n[3],u,h),te(e,n,r)}function ne(e,r,i){var f,c=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),J(c,r,32),c[0]&=248,c[31]&=127,c[31]|=64,re(a,c),ee(e,a),f=0;f<32;f++)r[f+32]=e[f];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function fe(e,t){var r,n,i,f;for(n=63;n>=32;--n){for(r=0,i=n-32,f=n-12;i<f;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ce(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;fe(e,r)}function ae(e,r,n,i){var f,c,a=new Uint8Array(64),o=new Uint8Array(64),s=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];J(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var h=n+64;for(f=0;f<n;f++)e[64+f]=r[f];for(f=0;f<32;f++)e[32+f]=a[32+f];for(J(s,e.subarray(32),n+32),ce(s),re(u,s),ee(e,u),f=32;f<64;f++)e[f]=i[f];for(J(o,e,n+64),ce(o),f=0;f<64;f++)d[f]=0;for(f=0;f<32;f++)d[f]=s[f];for(f=0;f<32;f++)for(c=0;c<32;c++)d[f+c]+=o[f]*a[c];return fe(e.subarray(32),d),h}function oe(e,r,n,i){var f,o=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],h=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),f=t(),o=t(),d=t(),u=t(),h=t();return I(e[2],a),B(e[1],r),z(f,e[1]),L(o,f,s),D(f,f,e[2]),H(o,e[2],o),z(d,o),z(u,d),L(h,u,d),L(n,h,f),L(n,n,o),q(n,n),L(n,n,f),L(n,n,o),L(n,n,o),L(e[0],n,o),z(i,e[0]),L(i,i,o),_(i,f)&&L(e[0],e[0],l),z(i,e[0]),L(i,i,o),_(i,f)?-1:(C(e[0])===r[31]>>7&&D(e[0],c,e[0]),L(e[3],e[0],e[1]),0)}(h,i))return-1;for(f=0;f<n;f++)e[f]=r[f];for(f=0;f<32;f++)e[f+32]=i[f];if(J(d,e,n),ce(d),te(u,h,d),re(h,r.subarray(32)),Q(u,h),ee(o,u),n-=64,y(r,0,o,0)){for(f=0;f<n;f++)e[f]=0;return-1}for(f=0;f<n;f++)e[f]=r[f+64];return n}function se(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function de(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function ue(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:x,crypto_stream_salsa20_xor:M,crypto_stream_salsa20:O,crypto_onetimeauth:j,crypto_onetimeauth_verify:P,crypto_verify_16:m,crypto_verify_32:y,crypto_secretbox:A,crypto_secretbox_open:E,crypto_scalarmult:U,crypto_scalarmult_base:F,crypto_box_beforenm:K,crypto_box_afternm:X,crypto_box:function(e,t,r,n,i,f){var c=new Uint8Array(32);return K(c,i,f),X(e,t,r,n,c)},crypto_box_open:function(e,t,r,n,i,f){var c=new Uint8Array(32);return K(c,i,f),Z(e,t,r,n,c)},crypto_box_keypair:W,crypto_hash:J,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:oe,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:s,L:ie,pack25519:N,unpack25519:B,M:L,A:H,S:z,Z:D,pow2523:q,add:Q,set25519:I,modL:fe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){de(e,t,r),se(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),f=0;f<e.length;f++)n[f+32]=e[f];return A(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){de(e,t,r),se(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),f=0;f<e.length;f++)n[f+16]=e[f];return n.length<32||0!==E(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(de(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return U(r,e,t),r},e.scalarMult.base=function(e){if(de(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return F(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var f=e.box.before(n,i);return e.secretbox(t,r,f)},e.box.before=function(e,t){de(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var f=e.box.before(n,i);return e.secretbox.open(t,r,f)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(de(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return F(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(de(e,t),64!==t.length)throw new Error("bad secret key size");var r=new Uint8Array(64+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(de(e,t),32!==t.length)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=oe(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),f=0;f<i.length;f++)i[f]=r[f];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(64),f=0;f<i.length;f++)i[f]=n[f];return i},e.sign.detached.verify=function(e,t,r){if(de(e,t,r),64!==t.length)throw new Error("bad signature size");if(32!==r.length)throw new Error("bad public key size");var n,i=new Uint8Array(64+e.length),f=new Uint8Array(64+e.length);for(n=0;n<64;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+64]=e[n];return oe(f,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(de(e),64!==e.length)throw new Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(de(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(32),r=new Uint8Array(64),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=32,e.sign.secretKeyLength=64,e.sign.seedLength=32,e.sign.signatureLength=64,e.hash=function(e){de(e);var t=new Uint8Array(64);return J(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return de(e,t),0!==e.length&&0!==t.length&&(e.length===t.length&&0===b(e,0,t,0,e.length))},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];ue(i)}))}else(t=r(592))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];ue(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7),i=r(189),f=r(133);function c(e,t){return t?Object(f.a)(e,t):new n.a(Object(i.a)(e))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(0),i=r(150),f=function(e){function t(r,n){void 0===n&&(n=i.a.now);var f=e.call(this,r,(function(){return t.delegate&&t.delegate!==f?t.delegate.now():n()}))||this;return f.actions=[],f.active=!1,f.scheduled=void 0,f}return n.a(t,e),t.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(i.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),i=r(12),f=r(10),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return n.a(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),f.a.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),f.a.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(i.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),i=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return n.a(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||new Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,r){return e.call(this)||this}return n.a(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(10).a))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(18);function i(e){return!Object(n.a)(e)&&e-parseFloat(e)+1>=0}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,r){"use strict";if(r(30)){var n=r(95),i=r(13),f=r(14),c=r(3),a=r(163),o=r(222),s=r(59),d=r(114),u=r(93),h=r(49),l=r(115),p=r(61),b=r(25),m=r(285),y=r(97),g=r(85),v=r(48),w=r(140),M=r(16),O=r(35),x=r(214),S=r(98),k=r(100),j=r(99).f,P=r(216),A=r(94),E=r(21),I=r(64),T=r(153),R=r(141),N=r(218),_=r(112),C=r(156),B=r(113),H=r(217),D=r(276),L=r(31),z=r(62),V=L.f,q=z.f,U=i.RangeError,F=i.TypeError,W=i.Uint8Array,K=Array.prototype,X=o.ArrayBuffer,Z=o.DataView,G=I(0),Y=I(2),J=I(3),Q=I(4),$=I(5),ee=I(6),te=T(!0),re=T(!1),ne=N.values,ie=N.keys,fe=N.entries,ce=K.lastIndexOf,ae=K.reduce,oe=K.reduceRight,se=K.join,de=K.sort,ue=K.slice,he=K.toString,le=K.toLocaleString,pe=E("iterator"),be=E("toStringTag"),me=A("typed_constructor"),ye=A("def_constructor"),ge=a.CONSTR,ve=a.TYPED,we=a.VIEW,Me=I(1,(function(e,t){return je(R(e,e[ye]),t)})),Oe=f((function(){return 1===new W(new Uint16Array([1]).buffer)[0]})),xe=!!W&&!!W.prototype.set&&f((function(){new W(1).set({})})),Se=function(e,t){var r=p(e);if(r<0||r%t)throw U("Wrong offset!");return r},ke=function(e){if(M(e)&&ve in e)return e;throw F(e+" is not a typed array!")},je=function(e,t){if(!M(e)||!(me in e))throw F("It is not a typed array constructor!");return new e(t)},Pe=function(e,t){return Ae(R(e,e[ye]),t)},Ae=function(e,t){for(var r=0,n=t.length,i=je(e,n);n>r;)i[r]=t[r++];return i},Ee=function(e,t,r){V(e,t,{get:function(){return this._d[r]}})},Ie=function(e){var t,r,n,i,f,c,a=O(e),o=arguments.length,d=o>1?arguments[1]:void 0,u=void 0!==d,h=P(a);if(null!=h&&!x(h)){for(c=h.call(a),n=[],t=0;!(f=c.next()).done;t++)n.push(f.value);a=n}for(u&&o>2&&(d=s(d,arguments[2],2)),t=0,r=b(a.length),i=je(this,r);r>t;t++)i[t]=u?d(a[t],t):a[t];return i},Te=function(){for(var e=0,t=arguments.length,r=je(this,t);t>e;)r[e]=arguments[e++];return r},Re=!!W&&f((function(){le.call(new W(1))})),Ne=function(){return le.apply(Re?ue.call(ke(this)):ke(this),arguments)},_e={copyWithin:function(e,t){return D.call(ke(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(ke(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return H.apply(ke(this),arguments)},filter:function(e){return Pe(this,Y(ke(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return $(ke(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(ke(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){G(ke(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return re(ke(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(ke(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return se.apply(ke(this),arguments)},lastIndexOf:function(e){return ce.apply(ke(this),arguments)},map:function(e){return Me(ke(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ae.apply(ke(this),arguments)},reduceRight:function(e){return oe.apply(ke(this),arguments)},reverse:function(){for(var e,t=ke(this).length,r=Math.floor(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this},some:function(e){return J(ke(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return de.call(ke(this),e)},subarray:function(e,t){var r=ke(this),n=r.length,i=y(e,n);return new(R(r,r[ye]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,b((void 0===t?n:y(t,n))-i))}},Ce=function(e,t){return Pe(this,ue.call(ke(this),e,t))},Be=function(e){ke(this);var t=Se(arguments[1],1),r=this.length,n=O(e),i=b(n.length),f=0;if(i+t>r)throw U("Wrong length!");for(;f<i;)this[t+f]=n[f++]},He={entries:function(){return fe.call(ke(this))},keys:function(){return ie.call(ke(this))},values:function(){return ne.call(ke(this))}},De=function(e,t){return M(e)&&e[ve]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Le=function(e,t){return De(e,t=g(t,!0))?u(2,e[t]):q(e,t)},ze=function(e,t,r){return!(De(e,t=g(t,!0))&&M(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?V(e,t,r):(e[t]=r.value,e)};ge||(z.f=Le,L.f=ze),c(c.S+c.F*!ge,"Object",{getOwnPropertyDescriptor:Le,defineProperty:ze}),f((function(){he.call({})}))&&(he=le=function(){return se.call(this)});var Ve=l({},_e);l(Ve,He),h(Ve,pe,He.values),l(Ve,{slice:Ce,set:Be,constructor:function(){},toString:he,toLocaleString:Ne}),Ee(Ve,"buffer","b"),Ee(Ve,"byteOffset","o"),Ee(Ve,"byteLength","l"),Ee(Ve,"length","e"),V(Ve,be,{get:function(){return this[ve]}}),e.exports=function(e,t,r,o){var s=e+((o=!!o)?"Clamped":"")+"Array",u="get"+e,l="set"+e,p=i[s],y=p||{},g=p&&k(p),v=!p||!a.ABV,O={},x=p&&p.prototype,P=function(e,r){V(e,r,{get:function(){return function(e,r){var n=e._d;return n.v[u](r*t+n.o,Oe)}(this,r)},set:function(e){return function(e,r,n){var i=e._d;o&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),i.v[l](r*t+i.o,n,Oe)}(this,r,e)},enumerable:!0})};v?(p=r((function(e,r,n,i){d(e,p,s,"_d");var f,c,a,o,u=0,l=0;if(M(r)){if(!(r instanceof X||"ArrayBuffer"==(o=w(r))||"SharedArrayBuffer"==o))return ve in r?Ae(p,r):Ie.call(p,r);f=r,l=Se(n,t);var y=r.byteLength;if(void 0===i){if(y%t)throw U("Wrong length!");if((c=y-l)<0)throw U("Wrong length!")}else if((c=b(i)*t)+l>y)throw U("Wrong length!");a=c/t}else a=m(r),f=new X(c=a*t);for(h(e,"_d",{b:f,o:l,l:c,e:a,v:new Z(f)});u<a;)P(e,u++)})),x=p.prototype=S(Ve),h(x,"constructor",p)):f((function(){p(1)}))&&f((function(){new p(-1)}))&&C((function(e){new p,new p(null),new p(1.5),new p(e)}),!0)||(p=r((function(e,r,n,i){var f;return d(e,p,s),M(r)?r instanceof X||"ArrayBuffer"==(f=w(r))||"SharedArrayBuffer"==f?void 0!==i?new y(r,Se(n,t),i):void 0!==n?new y(r,Se(n,t)):new y(r):ve in r?Ae(p,r):Ie.call(p,r):new y(m(r))})),G(g!==Function.prototype?j(y).concat(j(g)):j(y),(function(e){e in p||h(p,e,y[e])})),p.prototype=x,n||(x.constructor=p));var A=x[pe],E=!!A&&("values"==A.name||null==A.name),I=He.values;h(p,me,!0),h(x,ve,s),h(x,we,!0),h(x,ye,p),(o?new p(1)[be]==s:be in x)||V(x,be,{get:function(){return s}}),O[s]=p,c(c.G+c.W+c.F*(p!=y),O),c(c.S,s,{BYTES_PER_ELEMENT:t}),c(c.S+c.F*f((function(){y.of.call(p,1)})),s,{from:Ie,of:Te}),"BYTES_PER_ELEMENT"in x||h(x,"BYTES_PER_ELEMENT",t),c(c.P,s,_e),B(s),c(c.P+c.F*xe,s,{set:Be}),c(c.P+c.F*!E,s,He),n||x.toString==he||(x.toString=he),c(c.P+c.F*f((function(){new p(1).slice()})),s,{slice:Ce}),c(c.P+c.F*(f((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!f((function(){x.toLocaleString.call([1,2])}))),s,{toLocaleString:Ne}),_[s]=E?A:I,n||E||h(x,pe,I)}}else e.exports=function(){}},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){(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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(574).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(652).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(88),i=r(177);function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Object(i.a)()(n.a.apply(void 0,e))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(189),i=r(83),f=r(46),c=r(53),a=r(190),o=r(191),s=r(131),d=function(e){if(e&&"function"==typeof e[c.a])return d=e,function(e){var t=d[c.a]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(Object(a.a)(e))return Object(n.a)(e);if(Object(o.a)(e))return r=e,function(e){return r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,i.a),e};if(e&&"function"==typeof e[f.a])return t=e,function(e){for(var r=t[f.a]();;){var n=void 0;try{n=r.next()}catch(t){return e.error(t),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}return"function"==typeof r.return&&e.add((function(){r.return&&r.return()})),e};var t,r,d,u=Object(s.a)(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+u+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(e,t,r){"use strict";function n(e){setTimeout((function(){throw e}),0)}r.d(t,"a",(function(){return n}))},,function(e,t,r){var n=r(16);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(94)("meta"),i=r(16),f=r(48),c=r(31).f,a=0,o=Object.isExtensible||function(){return!0},s=!r(14)((function(){return o(Object.preventExtensions({}))})),d=function(e){c(e,n,{value:{i:"O"+ ++a,w:{}}})},u=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!f(e,n)){if(!o(e))return"F";if(!t)return"E";d(e)}return e[n].i},getWeak:function(e,t){if(!f(e,n)){if(!o(e))return!0;if(!t)return!1;d(e)}return e[n].w},onFreeze:function(e){return s&&u.NEED&&o(e)&&!f(e,n)&&d(e),e}}},function(e,t,r){var n=r(11).Buffer,i=r(607).Transform,f=r(104).StringDecoder;function c(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(9)(c,i),c.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)},c.prototype.setAutoPadding=function(){},c.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},c.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},c.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},c.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)}},c.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},c.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},c.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new f(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=c},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(23),i=r(70),f=r(133);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return Object(n.a)(r)?(e.pop(),Object(f.a)(e,r)):Object(i.a)(e)}},function(e,t,r){"use strict";function n(e){return"function"==typeof e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));const n=/^0x[a-fA-F0-9]+$/;function i(e,t=-1,r=!1){return!("string"!=typeof e||"0x"!==e&&!n.test(e))&&(-1===t?e.length%2==0||r:e.length===2+Math.ceil(t/4))}},function(e,t,r){"use strict";function n(e){return"string"==typeof e||e instanceof String}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e){return void 0===e}r.d(t,"a",(function(){return n}))},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){e.exports=!1},function(e,t,r){var n=r(260),i=r(201);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n=r(61),i=Math.max,f=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):f(e,t)}},function(e,t,r){var n=r(15),i=r(261),f=r(201),c=r(200)("IE_PROTO"),a=function(){},o=function(){var e,t=r(198)("iframe"),n=f.length;for(t.style.display="none",r(202).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),o=e.F;n--;)delete o.prototype[f[n]];return o()};e.exports=Object.create||function(e,t){var r;return null!==e?(a.prototype=n(e),r=new a,a.prototype=null,r[c]=e):r=o(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(260),i=r(201).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){var n=r(48),i=r(35),f=r(200)("IE_PROTO"),c=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,f)?e[f]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},function(e,t,r){var n=r(21)("unscopables"),i=Array.prototype;null==i[n]&&r(49)(i,n,{}),e.exports=function(e){i[n][e]=!0}},function(e,t,r){var n=r(16);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,f=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 c=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(){void 0!==f&&e.removeListener("error",f),r([].slice.call(arguments))}var f;"error"!==t&&(f=function(r){e.removeListener(t,i),n(r)},e.once("error",f)),e.once(t,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,f,c,a;if(s(r),void 0===(f=e._events)?(f=e._events=Object.create(null),e._eventsCount=0):(void 0!==f.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),f=e._events),c=f[t]),void 0===c)c=f[t]=r,++e._eventsCount;else if("function"==typeof c?c=f[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),(i=d(e))>0&&c.length>i&&!c.warned){c.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=c.length,a=o,console&&console.warn&&console.warn(a)}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):m(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 m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||c(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||c(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},a.prototype.getMaxListeners=function(){return d(this)},a.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 c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var a=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw a.context=c,a}var o=i[e];if(void 0===o)return!1;if("function"==typeof o)f(o,this,t);else{var s=o.length,d=m(o,s);for(r=0;r<s;++r)f(d[r],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,f,c;if(s(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,f=r.length-1;f>=0;f--)if(r[f]===t||r[f].listener===t){c=r[f].listener,i=f;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,c||t)}return this},a.prototype.off=a.prototype.removeListener,a.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,f=Object.keys(r);for(n=0;n<f.length;++n)"removeListener"!==(i=f[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},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},a.prototype.listenerCount=b,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";var n=r(11).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 f(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=o,this.end=s,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=d,this.end=u,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(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 o(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 s(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 d(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 u(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=f,f.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||""},f.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},f.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=c(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=c(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)},f.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(165),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var f=Object.create(r(145));f.inherits=r(9);var c=r(307),a=r(236);f.inherits(u,c);for(var o=i(a.prototype),s=0;s<o.length;s++){var d=o[s];u.prototype[d]||(u.prototype[d]=a.prototype[d])}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),a.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(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.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)}}),u.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return f}));var n=r(36);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return f(e)}function f(e){return 0===e.length?n.a:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return h}));var n=r(0),i=1,f=function(){return Promise.resolve()}(),c={};function a(e){return e in c&&(delete c[e],!0)}var o=function(e){var t=i++;return c[t]=!0,f.then((function(){return a(t)&&e()})),t},s=function(e){a(e)},d=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return n.a(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=o(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(s(r),t.scheduled=void 0)},t}(r(73).a),u=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.a(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(r(71).a))(d),h=u},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,r){var n=r(31).f,i=r(48),f=r(21)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,f)&&n(e,f,{configurable:!0,value:t})}},function(e,t,r){var n=r(3),i=r(76),f=r(14),c=r(204),a="["+c+"]",o=RegExp("^"+a+a+"*"),s=RegExp(a+a+"*$"),d=function(e,t,r){var i={},a=f((function(){return!!c[e]()||"​"!="​"[e]()})),o=i[e]=a?t(u):c[e];r&&(i[r]=o),n(n.P+n.F*a,"String",i)},u=d.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(o,"")),2&t&&(e=e.replace(s,"")),e};e.exports=d},function(e,t){e.exports={}},function(e,t,r){"use strict";var n=r(13),i=r(31),f=r(30),c=r(21)("species");e.exports=function(e){var t=n[e];f&&t&&!t[c]&&i.f(t,c,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var n=r(42);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},function(e,t,r){"use strict";(function(t,n){var i=r(11).Buffer,f=t.crypto||t.msCrypto;f&&f.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 c=0;c<e;c+=65536)f.getRandomValues(r.slice(c,c+65536));else f.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(32),r(26))},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 f(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,c,a;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,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"))a="The ".concat(e," ").concat(n," ").concat(f(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(f(t,"type"))}return a+=". 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=s;var i=r(299),f=r(303);r(9)(s,i);for(var c=n(f.prototype),a=0;a<c.length;a++){var o=c[a];s.prototype[o]||(s.prototype[o]=f.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),f.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",d)))}function d(){this._writableState.ended||t.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.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(26))},function(e,t,r){var n=r(11).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,f=e.length,c=this._len,a=0;a<f;){for(var o=c%i,s=Math.min(f-a,i-o),d=0;d<s;d++)r[o+d]=e[a+d];a+=s,(c+=s)%i==0&&this._update(r)}return this._len+=f,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 f=this._hash();return e?f.toString(e):f},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},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 f(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,c,a;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,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"))a="The ".concat(e," ").concat(n," ").concat(f(t,"type"));else{var o=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(f(t,"type"))}return a+=". 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=s;var i=r(330),f=r(334);r(9)(s,i);for(var c=n(f.prototype),a=0;a<c.length;a++){var o=c[a];s.prototype[o]||(s.prototype[o]=f.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),f.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",d)))}function d(){this._writableState.ended||t.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.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(26))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(0),i=r(2);function f(){return function(e){return e.lift(new c(e))}}var c=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new a(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return n.a(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var r=this.connection,n=e._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},t}(i.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(0),i=r(12),f=r(148),c=r(10),a=r(175),o=r(54),s=r(188),d=function(e){function t(t,r,n){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return n.a(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new u(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,f=n.length;if(this.closed)throw new o.a;if(this.isStopped||this.hasError?t=c.a.EMPTY:(this.observers.push(e),t=new s.a(this,e)),i&&e.add(e=new a.a(e,i)),r)for(var d=0;d<f&&!e.closed;d++)e.next(n[d]);else for(d=0;d<f&&!e.closed;d++)e.next(n[d].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||f.a).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,f=0;f<i&&!(e-n[f].time<r);)f++;return i>t&&(f=Math.max(f,i-t)),f>0&&n.splice(0,f),n},t}(i.a),u=function(){return function(e,t){this.time=e,this.value=t}}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(7);function i(e,t){return t?new n.a((function(r){return t.schedule(f,0,{error:e,subscriber:r})})):new n.a((function(t){return t.error(e)}))}function f(e){var t=e.error;e.subscriber.error(t)}},function(e,t,r){"use strict";r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return u}));var n=r(0),i=r(23),f=r(18),c=r(38),a=r(33),o=r(70),s={};function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return Object(i.a)(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&Object(f.a)(e[0])&&(e=e[0]),Object(o.a)(e,n).lift(new u(r))}var u=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new h(e,this.resultSelector))},e}(),h=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return n.a(t,e),t.prototype._next=function(e){this.values.push(s),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(Object(a.a)(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],f=this.toRespond?i===s?--this.toRespond:this.toRespond:0;n[r]=t,0===f&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(c.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(68),i=r(36);function f(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),Object(n.b)(i.a,e)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(7),i=r(29),f=r(27);function c(e){return new n.a((function(t){var r;try{r=e()}catch(e){return void t.error(e)}return(r?Object(i.a)(r):Object(f.b)()).subscribe(t)}))}},function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return d}));var n=r(0),i=r(70),f=r(18),c=r(2),a=r(46),o=r(4);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),Object(i.a)(e,void 0).lift(new d(r))}var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.resultSelector))},e}(),u=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return n.a(t,e),t.prototype._next=function(e){var t=this.iterators;Object(f.a)(e)?t.push(new l(e)):"function"==typeof e[a.a]?t.push(new h(e[a.a]())):t.push(new p(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var r=0;r<t;r++){var n=e[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe());else this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){if("function"==typeof(c=e[n]).hasValue&&!c.hasValue())return}var i=!1,f=[];for(n=0;n<t;n++){var c,a=(c=e[n]).next();if(c.hasCompleted()&&(i=!0),a.done)return void r.complete();f.push(a.value)}this.resultSelector?this._tryresultSelector(f):r.next(f),i&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(c.a),h=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),l=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[a.a]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),p=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return n.a(t,e),t.prototype[a.a]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return Object(o.c)(this.observable,new o.a(this))},t}(o.b)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/rpc-core",version:"4.17.1"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/types",version:"4.17.1"}},function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function i(e){for(;e;){var t=e,r=t.closed,i=t.destination,f=t.isStopped;if(r||f)return!1;e=i&&i instanceof n.a?i:null}return!0}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(7),i=r(10);function f(e,t){return new n.a((function(r){var n=new i.a,f=0;return n.add(t.schedule((function(){f!==e.length?(r.next(e[f++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(37);const i=function(e,t=0){return Object(n.a)(e>0,"Expected non-zero, positive number as a range size"),new Array(e).fill(0).map((e,r)=>r+t)}(256).map(e=>e.toString(16).padStart(2,"0"));function f(e,t=-1,r=!0){const n=r?"0x":"";if(null==e||!e.length)return n;const c=Math.ceil(t/8);return n+(c>0&&e.length>c?function(e,t){return`${f(e.subarray(0,t),-1,!1)}…${f(e.subarray(e.length-t),-1,!1)}`}(e,Math.ceil(c/2)):function(e){const t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=i[e[r]];return t.join("")}(e))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(34),i=r(83),f={closed:!0,next:function(e){},error:function(e){if(n.a.useDeprecatedSynchronousErrorHandling)throw e;Object(i.a)(e)},complete:function(){}}},,,function(e,t,r){var n=r(75);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(75),i=r(21)("toStringTag"),f="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,c;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:f?n(t):"Object"==(c=n(t))&&"function"==typeof t.callee?"Arguments":c}},function(e,t,r){var n=r(15),i=r(60),f=r(21)("species");e.exports=function(e,t){var r,c=n(e).constructor;return void 0===c||null==(r=n(c)[f])?t:i(r)}},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 f=r(575);if("function"!=typeof f.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return f.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n=r(65),i=r(44);function f(){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=f,f.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},f.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},f.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 f=8;f<this.padLength;f++)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,f=8;f<this.padLength;f++)n[i++]=0;return n}},function(e,t,r){"use strict";var n=r(9),i=r(229),f=r(232),c=r(233),a=r(87);function o(e){a.call(this,"digest"),this._hash=e}n(o,a),o.prototype._update=function(e){this._hash.update(e)},o.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new f:new o(c(e))}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(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]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(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=e.isBuffer}).call(this,r(19).Buffer)},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),f=0;f<n;++f)i[f]=e[f]^r[f];return i}}).call(this,r(19).Buffer)},function(e,t,r){"use strict";const n=r(9),i=r(246).Reporter,f=r(244).Buffer;function c(e,t){i.call(this,t),f.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=f.byteLength(e);else{if(!f.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(c,i),t.DecoderBuffer=c,c.isDecoderBuffer=function(e){if(e instanceof c)return!0;return"object"==typeof e&&f.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},c.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},c.prototype.restore=function(e){const t=new c(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},c.prototype.isEmpty=function(){return this.offset===this.length},c.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},c.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new c(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},c.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=a,a.isEncoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function(e,t){return e||(e=f.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):f.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return c}));var n=r(0),i=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return n.a(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(r(73).a),f=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.a(t,e),t}(r(71).a))(i),c=f},function(e,t,r){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=s(e),c=n[0],a=n[1],o=new f(function(e,t,r){return 3*(t+r)/4-r}(0,c,a)),d=0,u=a>0?c-4:c;for(r=0;r<u;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)],o[d++]=t>>16&255,o[d++]=t>>8&255,o[d++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,o[d++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,o[d++]=t>>8&255,o[d++]=255&t);return o},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,f=[],c=0,a=r-i;c<a;c+=16383)f.push(d(e,c,c+16383>a?a:c+16383));1===i?(t=e[r-1],f.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],f.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return f.join("")};for(var n=[],i=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=c.length;a<o;++a)n[a]=c[a],i[c.charCodeAt(a)]=a;function s(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 d(e,t,r){for(var i,f,c=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),c.push(n[(f=i)>>18&63]+n[f>>12&63]+n[f>>6&63]+n[63&f]);return c.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/api",version:"4.17.1"}},function(e,t,r){var n=r(28),i=r(13),f=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return f[e]||(f[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(95)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(50),i=r(25),f=r(97);e.exports=function(e){return function(t,r,c){var a,o=n(t),s=i(o.length),d=f(c,s);if(e&&r!=r){for(;s>d;)if((a=o[d++])!=a)return!0}else for(;s>d;d++)if((e||d in o)&&o[d]===r)return e||d||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(75);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(21)("iterator"),i=!1;try{var f=[7][n]();f.return=function(){i=!0},Array.from(f,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var f=[7],c=f[n]();c.next=function(){return{done:r=!0}},f[n]=function(){return c},e(f)}catch(e){}return r}},function(e,t,r){"use strict";var n=r(15);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,r){"use strict";var n=r(140),i=RegExp.prototype.exec;e.exports=function(e,t){var r=e.exec;if("function"==typeof r){var f=r.call(e,t);if("object"!=typeof f)throw new TypeError("RegExp exec method returned something other than an Object or null");return f}if("RegExp"!==n(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,r){"use strict";r(278);var n=r(42),i=r(49),f=r(14),c=r(76),a=r(21),o=r(219),s=a("species"),d=!f((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),u=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();e.exports=function(e,t,r){var h=a(e),l=!f((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),p=l?!f((function(){var t=!1,r=/a/;return r.exec=function(){return t=!0,null},"split"===e&&(r.constructor={},r.constructor[s]=function(){return r}),r[h](""),!t})):void 0;if(!l||!p||"replace"===e&&!d||"split"===e&&!u){var b=/./[h],m=r(c,h,""[e],(function(e,t,r,n,i){return t.exec===o?l&&!i?{done:!0,value:b.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}})),y=m[0],g=m[1];n(String.prototype,e,y),i(RegExp.prototype,h,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},function(e,t,r){var n=r(59),i=r(273),f=r(214),c=r(15),a=r(25),o=r(216),s={},d={};(t=e.exports=function(e,t,r,u,h){var l,p,b,m,y=h?function(){return e}:o(e),g=n(r,u,t?2:1),v=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(f(y)){for(l=a(e.length);l>v;v++)if((m=t?g(c(p=e[v])[0],p[1]):g(e[v]))===s||m===d)return m}else for(b=y.call(e);!(p=b.next()).done;)if((m=i(b,g,p.value,t))===s||m===d)return m}).BREAK=s,t.RETURN=d},function(e,t,r){var n=r(13).navigator;e.exports=n&&n.userAgent||""},function(e,t,r){"use strict";var n=r(13),i=r(3),f=r(42),c=r(115),a=r(86),o=r(160),s=r(114),d=r(16),u=r(14),h=r(156),l=r(110),p=r(205);e.exports=function(e,t,r,b,m,y){var g=n[e],v=g,w=m?"set":"add",M=v&&v.prototype,O={},x=function(e){var t=M[e];f(M,e,"delete"==e||"has"==e?function(e){return!(y&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!d(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,r){return t.call(this,0===e?0:e,r),this})};if("function"==typeof v&&(y||M.forEach&&!u((function(){(new v).entries().next()})))){var S=new v,k=S[w](y?{}:-0,1)!=S,j=u((function(){S.has(1)})),P=h((function(e){new v(e)})),A=!y&&u((function(){for(var e=new v,t=5;t--;)e[w](t,t);return!e.has(-0)}));P||((v=t((function(t,r){s(t,v,e);var n=p(new g,t,v);return null!=r&&o(r,m,n[w],n),n}))).prototype=M,M.constructor=v),(j||A)&&(x("delete"),x("has"),m&&x("get")),(A||k)&&x(w),y&&M.clear&&delete M.clear}else v=b.getConstructor(t,e,m,w),c(v.prototype,r),a.NEED=!0;return l(v,e),O[e]=v,i(i.G+i.W+i.F*(v!=g),O),y||b.setStrong(v,e,m),v}},function(e,t,r){for(var n,i=r(13),f=r(49),c=r(94),a=c("typed_array"),o=c("view"),s=!(!i.ArrayBuffer||!i.DataView),d=s,u=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(n=i[h[u++]])?(f(n.prototype,a,!0),f(n.prototype,o,!0)):d=!1;e.exports={ABV:s,CONSTR:d,TYPED:a,VIEW:o}},function(e,t,r){"use strict";var n=r(79),i=r(51),f=i.getNAF,c=i.getJSF,a=i.assert;function o(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 s(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=f(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var c,o,s=[];for(c=0;c<n.length;c+=r.step){o=0;for(var d=c+r.step-1;d>=c;d--)o=(o<<1)+n[d];s.push(o)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(c=0;c<s.length;c++)(o=s[c])===l?h=h.mixedAdd(r.points[c]):o===-l&&(h=h.mixedAdd(r.points[c].neg()));u=u.add(h)}return u.toP()},o.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,c=f(t,r,this._bitLength),o=this.jpoint(null,null,null),s=c.length-1;s>=0;s--){for(var d=0;s>=0&&0===c[s];s--)d++;if(s>=0&&d++,o=o.dblp(d),s<0)break;var u=c[s];a(0!==u),o="affine"===e.type?u>0?o.mixedAdd(i[u-1>>1]):o.mixedAdd(i[-u-1>>1].neg()):u>0?o.add(i[u-1>>1]):o.add(i[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},o.prototype._wnafMulAdd=function(e,t,r,n,i){var a,o,s,d=this._wnafT1,u=this._wnafT2,h=this._wnafT3,l=0;for(a=0;a<n;a++){var p=(s=t[a])._getNAFPoints(e);d[a]=p.wnd,u[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,m=a;if(1===d[b]&&1===d[m]){var y=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(y[1]=t[b].add(t[m]),y[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(y[1]=t[b].toJ().mixedAdd(t[m]),y[2]=t[b].add(t[m].neg())):(y[1]=t[b].toJ().mixedAdd(t[m]),y[2]=t[b].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=c(r[b],r[m]);for(l=Math.max(v[0].length,l),h[b]=new Array(l),h[m]=new Array(l),o=0;o<l;o++){var w=0|v[0][o],M=0|v[1][o];h[b][o]=g[3*(w+1)+(M+1)],h[m][o]=0,u[b]=y}}else h[b]=f(r[b],d[b],this._bitLength),h[m]=f(r[m],d[m],this._bitLength),l=Math.max(h[b].length,l),l=Math.max(h[m].length,l)}var O=this.jpoint(null,null,null),x=this._wnafT4;for(a=l;a>=0;a--){for(var S=0;a>=0;){var k=!0;for(o=0;o<n;o++)x[o]=0|h[o][a],0!==x[o]&&(k=!1);if(!k)break;S++,a--}if(a>=0&&S++,O=O.dblp(S),a<0)break;for(o=0;o<n;o++){var j=x[o];0!==j&&(j>0?s=u[o][j-1>>1]:j<0&&(s=u[o][-j-1>>1].neg()),O="affine"===s.type?O.mixedAdd(s):O.add(s))}}for(a=0;a<n;a++)u[a]=null;return i?O:O.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.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]?a(e[e.length-1]%2==0):7===e[0]&&a(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")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.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))},s.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},s.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},s.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)},s.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 f=0;f<e;f++)n=n.dbl();r.push(n)}return{step:e,points:r}},s.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}},s.prototype._getBeta=function(){return null},s.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(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 f,c,a=arguments.length;switch(a){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(f=new Array(a-1),c=0;c<f.length;)f[c++]=arguments[c];return t.nextTick((function(){e.apply(null,f)}))}}}:e.exports=t}).call(this,r(26))},function(e,t,r){var n=r(11).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function f(e){for(;0<e.length;e++)e[0]=0}function c(e,t,r,n,i){for(var f,c,a,o,s=r[0],d=r[1],u=r[2],h=r[3],l=e[0]^t[0],p=e[1]^t[1],b=e[2]^t[2],m=e[3]^t[3],y=4,g=1;g<i;g++)f=s[l>>>24]^d[p>>>16&255]^u[b>>>8&255]^h[255&m]^t[y++],c=s[p>>>24]^d[b>>>16&255]^u[m>>>8&255]^h[255&l]^t[y++],a=s[b>>>24]^d[m>>>16&255]^u[l>>>8&255]^h[255&p]^t[y++],o=s[m>>>24]^d[l>>>16&255]^u[p>>>8&255]^h[255&b]^t[y++],l=f,p=c,b=a,m=o;return f=(n[l>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^t[y++],c=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&l])^t[y++],a=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[l>>>8&255]<<8|n[255&p])^t[y++],o=(n[m>>>24]<<24|n[l>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^t[y++],[f>>>=0,c>>>=0,a>>>=0,o>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],f=[[],[],[],[]],c=0,a=0,o=0;o<256;++o){var s=a^a<<1^a<<2^a<<3^a<<4;s=s>>>8^255&s^99,r[c]=s,n[s]=c;var d=e[c],u=e[d],h=e[u],l=257*e[s]^16843008*s;i[0][c]=l<<24|l>>>8,i[1][c]=l<<16|l>>>16,i[2][c]=l<<8|l>>>24,i[3][c]=l,l=16843009*h^65537*u^257*d^16843008*c,f[0][s]=l<<24|l>>>8,f[1][s]=l<<16|l>>>16,f[2][s]=l<<8|l>>>24,f[3][s]=l,0===c?c=a=1:(c=d^e[e[e[h^d]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:f}}();function s(e){this._key=i(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],f=0;f<t;f++)i[f]=e[f];for(f=t;f<n;f++){var c=i[f-1];f%t==0?(c=c<<8|c>>>24,c=o.SBOX[c>>>24]<<24|o.SBOX[c>>>16&255]<<16|o.SBOX[c>>>8&255]<<8|o.SBOX[255&c],c^=a[f/t|0]<<24):t>6&&f%t==4&&(c=o.SBOX[c>>>24]<<24|o.SBOX[c>>>16&255]<<16|o.SBOX[c>>>8&255]<<8|o.SBOX[255&c]),i[f]=i[f-t]^c}for(var s=[],d=0;d<n;d++){var u=n-d,h=i[u-(d%4?0:4)];s[d]=d<4||u<=4?h:o.INV_SUB_MIX[0][o.SBOX[h>>>24]]^o.INV_SUB_MIX[1][o.SBOX[h>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[h>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return c(e=i(e),this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=c(e,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),f=n.allocUnsafe(16);return f.writeUInt32BE(r[0],0),f.writeUInt32BE(r[3],4),f.writeUInt32BE(r[2],8),f.writeUInt32BE(r[1],12),f},s.prototype.scrub=function(){f(this._keySchedule),f(this._invKeySchedule),f(this._key)},e.exports.AES=s},function(e,t,r){var n=r(11).Buffer,i=r(229);e.exports=function(e,t,r,f){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var c=r/8,a=n.alloc(c),o=n.alloc(f||0),s=n.alloc(0);c>0||f>0;){var d=new i;d.update(s),d.update(e),t&&d.update(t),s=d.digest();var u=0;if(c>0){var h=a.length-c;u=Math.min(c,s.length),s.copy(a,h,0,u),c-=u}if(u<s.length&&f>0){var l=o.length-f,p=Math.min(f,s.length-u);s.copy(o,l,u,u+p),f-=p}}return s.fill(0),{key:a,iv:o}}},function(e,t,r){"use strict";var n=r(80),i=r(52),f=i.getNAF,c=i.getJSF,a=i.assert;function o(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 s(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=f(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var c=[],o=0;o<n.length;o+=r.step){var s=0;for(t=o+r.step-1;t>=o;t--)s=(s<<1)+n[t];c.push(s)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<c.length;o++){(s=c[o])===h?u=u.mixedAdd(r.points[o]):s===-h&&(u=u.mixedAdd(r.points[o].neg()))}d=d.add(u)}return d.toP()},o.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,c=f(t,r,this._bitLength),o=this.jpoint(null,null,null),s=c.length-1;s>=0;s--){for(t=0;s>=0&&0===c[s];s--)t++;if(s>=0&&t++,o=o.dblp(t),s<0)break;var d=c[s];a(0!==d),o="affine"===e.type?d>0?o.mixedAdd(i[d-1>>1]):o.mixedAdd(i[-d-1>>1].neg()):d>0?o.add(i[d-1>>1]):o.add(i[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},o.prototype._wnafMulAdd=function(e,t,r,n,i){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,d=0,u=0;u<n;u++){var h=(k=t[u])._getNAFPoints(e);a[u]=h.wnd,o[u]=h.points}for(u=n-1;u>=1;u-=2){var l=u-1,p=u;if(1===a[l]&&1===a[p]){var b=[t[l],null,null,t[p]];0===t[l].y.cmp(t[p].y)?(b[1]=t[l].add(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg())):0===t[l].y.cmp(t[p].y.redNeg())?(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].add(t[p].neg())):(b[1]=t[l].toJ().mixedAdd(t[p]),b[2]=t[l].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=c(r[l],r[p]);d=Math.max(y[0].length,d),s[l]=new Array(d),s[p]=new Array(d);for(var g=0;g<d;g++){var v=0|y[0][g],w=0|y[1][g];s[l][g]=m[3*(v+1)+(w+1)],s[p][g]=0,o[l]=b}}else s[l]=f(r[l],a[l],this._bitLength),s[p]=f(r[p],a[p],this._bitLength),d=Math.max(s[l].length,d),d=Math.max(s[p].length,d)}var M=this.jpoint(null,null,null),O=this._wnafT4;for(u=d;u>=0;u--){for(var x=0;u>=0;){var S=!0;for(g=0;g<n;g++)O[g]=0|s[g][u],0!==O[g]&&(S=!1);if(!S)break;x++,u--}if(u>=0&&x++,M=M.dblp(x),u<0)break;for(g=0;g<n;g++){var k,j=O[g];0!==j&&(j>0?k=o[g][j-1>>1]:j<0&&(k=o[g][-j-1>>1].neg()),M="affine"===k.type?M.mixedAdd(k):M.add(k))}}for(u=0;u<n;u++)o[u]=null;return i?M:M.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.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]?a(e[e.length-1]%2==0):7===e[0]&&a(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")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.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))},s.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},s.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},s.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)},s.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 f=0;f<e;f++)n=n.dbl();r.push(n)}return{step:e,points:r}},s.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}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){var n=r(663),i=r(671),f=r(672),c=r(238),a=r(315),o=r(11).Buffer;function s(e){var t;"object"!=typeof e||o.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=o.from(e));var r,s,d=f(e,t),u=d.tag,h=d.data;switch(u){case"CERTIFICATE":s=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(s||(s=n.PublicKey.decode(h,"der")),r=s.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(s.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return s.subjectPrivateKey=s.subjectPublicKey,{type:"ec",data:s};case"1.2.840.10040.4.1":return s.algorithm.params.pub_key=n.DSAparam.decode(s.subjectPublicKey.data,"der"),{type:"dsa",data:s.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":h=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),f=i[e.algorithm.decrypt.cipher.algo.join(".")],s=e.algorithm.decrypt.cipher.iv,d=e.subjectPrivateKey,u=parseInt(f.split("-")[1],10)/8,h=a.pbkdf2Sync(t,r,n,u,"sha1"),l=c.createDecipheriv(f,h,s),p=[];return p.push(l.update(d)),p.push(l.final()),o.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),t);case"PRIVATE KEY":switch(r=(s=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(s.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:s.algorithm.curve,privateKey:n.ECPrivateKey.decode(s.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return s.algorithm.params.priv_key=n.DSAparam.decode(s.subjectPrivateKey,"der"),{type:"dsa",params:s.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+u)}}e.exports=s,s.signature=n.signature},function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return h}));var n=r(0),i=r(2),f=r(10),c=r(7),a=r(12);function o(e,t,r,n){return function(i){return i.lift(new s(e,t,r,n))}}var s=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),d=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;return c.keySelector=r,c.elementSelector=n,c.durationSelector=i,c.subjectSelector=f,c.groups=null,c.attemptedToUnsubscribe=!1,c.count=0,c}return n.a(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},t.prototype._group=function(e,t){var r=this.groups;r||(r=this.groups=new Map);var n,i=r.get(t);if(this.elementSelector)try{n=this.elementSelector(e)}catch(e){this.error(e)}else n=e;if(!i){i=this.subjectSelector?this.subjectSelector():new a.a,r.set(t,i);var f=new h(t,i,this);if(this.destination.next(f),this.durationSelector){var c=void 0;try{c=this.durationSelector(new h(t,i))}catch(e){return void this.error(e)}this.add(c.subscribe(new u(t,i,this)))}}i.closed||i.next(n)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach((function(t,r){t.error(e)})),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach((function(e,t){e.complete()})),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(i.a),u=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return n.a(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(i.a),h=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return n.a(t,e),t.prototype._subscribe=function(e){var t=new f.a,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new l(r)),t.add(n.subscribe(e)),t},t}(c.a),l=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return n.a(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(f.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/wasm-crypto",version:"4.0.2"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/types-known",version:"4.17.1"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d}));var n=r(0),i=r(12),f=r(7),c=r(2),a=r(10),o=r(122),s=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return n.a(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new a.a).add(this.source.subscribe(new u(this.getSubject(),this))),e.closed&&(this._connection=null,e=a.a.EMPTY)),e},t.prototype.refCount=function(){return Object(o.a)()(this)},t}(f.a),d=function(){var e=s.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return n.a(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(i.b);c.a},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0),i=r(12),f=r(54),c=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return n.a(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new f.a;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(i.a)},function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return o}));var n=r(0),i=r(2),f=r(41);function c(e,t){return void 0===t&&(t=0),function(r){return r.lift(new a(e,t))}}var a=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new o(e,this.scheduler,this.delay))},e}(),o=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return n.a(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new s(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(f.a.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(f.a.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(f.a.createComplete()),this.unsubscribe()},t}(i.a),s=function(){return function(e,t){this.notification=e,this.destination=t}}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(126);function i(){return Object(n.a)(1)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(7),i=r(23),f=r(126),c=r(70);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Number.POSITIVE_INFINITY,a=null,o=e[e.length-1];return Object(i.a)(o)?(a=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof o&&(r=e.pop()),null===a&&1===e.length&&e[0]instanceof n.a?e[0]:Object(f.a)(r)(Object(c.a)(e,a))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),i=r(18),f=r(70),c=r(38),a=r(33);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!Object(i.a)(e[0]))return e[0];e=e[0]}return Object(f.a)(e,void 0).lift(new s)}var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new d(e))},e}(),d=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return n.a(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=e[r],i=Object(a.a)(this,n,void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(c.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(7),i=r(17),f=r(74),c=r(23);function a(e,t,r){void 0===e&&(e=0);var a=-1;return Object(f.a)(t)?a=Number(t)<1?1:Number(t):Object(c.a)(t)&&(r=t),Object(c.a)(r)||(r=i.a),new n.a((function(t){var n=Object(f.a)(e)?e:+e-r.now();return r.schedule(o,n,{index:0,period:a,subscriber:t})}))}function o(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/api-derive",version:"4.17.1"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(7),i=r(10),f=r(53);var c=r(133),a=r(46);var o=r(191),s=r(190);function d(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[f.a]}(e))return function(e,t){return new n.a((function(r){var n=new i.a;return n.add(t.schedule((function(){var i=e[f.a]();n.add(i.subscribe({next:function(e){n.add(t.schedule((function(){return r.next(e)})))},error:function(e){n.add(t.schedule((function(){return r.error(e)})))},complete:function(){n.add(t.schedule((function(){return r.complete()})))}}))}))),n}))}(e,t);if(Object(o.a)(e))return function(e,t){return new n.a((function(r){var n=new i.a;return n.add(t.schedule((function(){return e.then((function(e){n.add(t.schedule((function(){r.next(e),n.add(t.schedule((function(){return r.complete()})))})))}),(function(e){n.add(t.schedule((function(){return r.error(e)})))}))}))),n}))}(e,t);if(Object(s.a)(e))return Object(c.a)(e,t);if(function(e){return e&&"function"==typeof e[a.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.a((function(r){var n,f=new i.a;return f.add((function(){n&&"function"==typeof n.return&&n.return()})),f.add(t.schedule((function(){n=e[a.a](),f.add(t.schedule((function(){if(!r.closed){var e,t;try{var i=n.next();e=i.value,t=i.done}catch(e){return void r.error(e)}t?r.complete():(r.next(e),this.schedule())}})))}))),f}))}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}},function(e,t,r){"use strict";(function(e){function n(t){return e.isBuffer(t)}r.d(t,"a",(function(){return n}))}).call(this,r(19).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(37),i=r(90),f=r(193);function c(e,t=-1){if(!e)return new Uint8Array;Object(n.a)(Object(i.a)(e),()=>`Expected hex value to convert, found '${e}'`);const r=Object(f.a)(e),c=r.length/2,a=Math.ceil(-1===t?c:t/8),o=new Uint8Array(a),s=Math.max(0,a-c);for(let e=0;e<a;e++)o[e+s]=parseInt(r.substr(2*e,2),16);return o}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));const n=new(r(364).a);function i(e){return e?n.encode(e.toString()):new Uint8Array}},function(e,t,r){"use strict";function n(e){return crypto.getRandomValues(e)}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function f(){}function c(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,r,n,f){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new c(r,n||e,f),o=i?i+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new f:delete e._events[t]}function s(){this._events=new f,this._eventsCount=0}Object.create&&(f.prototype=Object.create(null),(new f).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,f=r.length,c=new Array(f);n<f;n++)c[n]=r[n].fn;return c},s.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,n,f,c){var a=i?i+e:e;if(!this._events[a])return!1;var o,s,d=this._events[a],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,n),!0;case 5:return d.fn.call(d.context,t,r,n,f),!0;case 6:return d.fn.call(d.context,t,r,n,f,c),!0}for(s=1,o=new Array(u-1);s<u;s++)o[s-1]=arguments[s];d.fn.apply(d.context,o)}else{var h,l=d.length;for(s=0;s<l;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,r);break;case 4:d[s].fn.call(d[s].context,t,r,n);break;default:if(!o)for(h=1,o=new Array(u-1);h<u;h++)o[h-1]=arguments[h];d[s].fn.apply(d[s].context,o)}}return!0},s.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,r,n){var f=i?i+e:e;if(!this._events[f])return this;if(!t)return o(this,f),this;var c=this._events[f];if(c.fn)c.fn!==t||n&&!c.once||r&&c.context!==r||o(this,f);else{for(var a=0,s=[],d=c.length;a<d;a++)(c[a].fn!==t||n&&!c[a].once||r&&c[a].context!==r)&&s.push(c[a]);s.length?this._events[f]=1===s.length?s[0]:s:o(this,f)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new f,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0),i=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return n.a(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(r(10).a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},function(e,t,r){"use strict";function n(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";function n(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(90);const i=/^[a-fA-F0-9]+$/;function f(e){if(!e)return"";if(function(e){return!(!e||!Object(n.a)(e,-1,!0)||"0x"!==e.substr(0,2))}(e))return e.substr(2);if(i.test(e))return e;throw new Error(`Invalid hex ${e} passed to hexStripPrefix`)}},function(e,t,r){"use strict";function n(e){return function(e,t){return e instanceof t}(e,Uint8Array)}r.d(t,"a",(function(){return n}))},function(e,t){e.exports={bytes:" ",sizeCompressed:152679,sizeUncompressed:299511}},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(45),i=r(89),f=r(91),c=r(37);const a="Either remove and explicitly install matching versions or dedupe using your package manager.\nThe following conflicting packages were found:";function o(e){return e.reduce((e,{version:t})=>Math.max(e,t.length),0)}function s(e){if(Object(i.a)(e))try{return e()||""}catch(e){return""}return e||""}function d({name:e,version:t},r,i=[]){Object(c.a)(e.startsWith("@polkadot"),()=>"Invalid package descriptor "+e);const d=function(e){const t=n.a;return t.__polkadotjs||(t.__polkadotjs={}),t.__polkadotjs[e]||(t.__polkadotjs[e]=[]),t.__polkadotjs[e]}(e);if(d.push({path:s(r),version:t}),1!==d.length)console.warn(`${e} has multiple versions, ensure that there is only one installed.\n${a}\n${function(e){const t=e.map(e=>Object(f.a)(e)?{version:e}:e),r=o(t);return t.map(({path:e,version:t})=>`\t${t.padEnd(r)}\t${!e||e.length<5?"<unknown>":e}`).join("\n")}(d)}`);else{const r=i.filter(e=>e&&e.version!==t);r.length&&console.warn(`${e} requires direct dependencies exactly matching version ${t}.\n${a}\n${function(e){const t=o(e);return e.map(({name:e,version:r})=>`\t${r.padEnd(t)}\t${e}`).join("\n")}(r)}`)}}},,function(e,t,r){var n=r(16),i=r(13).document,f=n(i)&&n(i.createElement);e.exports=function(e){return f?i.createElement(e):{}}},function(e,t,r){t.f=r(21)},function(e,t,r){var n=r(152)("keys"),i=r(94);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(13).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(16),i=r(15),f=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(59)(Function.call,r(62).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return f(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:f}},function(e,t){e.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},function(e,t,r){var n=r(16),i=r(203).set;e.exports=function(e,t,r){var f,c=t.constructor;return c!==r&&"function"==typeof c&&(f=c.prototype)!==r.prototype&&n(f)&&i&&i(e,f),e}},function(e,t,r){"use strict";var n=r(61),i=r(76);e.exports=function(e){var t=String(i(this)),r="",f=n(e);if(f<0||f==1/0)throw RangeError("Count can't be negative");for(;f>0;(f>>>=1)&&(t+=t))1&f&&(r+=t);return r}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var r=Math.expm1;e.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:r},function(e,t,r){var n=r(61),i=r(76);e.exports=function(e){return function(t,r){var f,c,a=String(i(t)),o=n(r),s=a.length;return o<0||o>=s?e?"":void 0:(f=a.charCodeAt(o))<55296||f>56319||o+1===s||(c=a.charCodeAt(o+1))<56320||c>57343?e?a.charAt(o):f:e?a.slice(o,o+2):c-56320+(f-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(95),i=r(3),f=r(42),c=r(49),a=r(112),o=r(272),s=r(110),d=r(100),u=r(21)("iterator"),h=!([].keys&&"next"in[].keys()),l=function(){return this};e.exports=function(e,t,r,p,b,m,y){o(r,t,p);var g,v,w,M=function(e){if(!h&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},O=t+" Iterator",x="values"==b,S=!1,k=e.prototype,j=k[u]||k["@@iterator"]||b&&k[b],P=j||M(b),A=b?x?M("entries"):P:void 0,E="Array"==t&&k.entries||j;if(E&&(w=d(E.call(new e)))!==Object.prototype&&w.next&&(s(w,O,!0),n||"function"==typeof w[u]||c(w,u,l)),x&&j&&"values"!==j.name&&(S=!0,P=function(){return j.call(this)}),n&&!y||!h&&!S&&k[u]||c(k,u,P),a[t]=P,a[O]=l,b)if(g={values:x?P:M("values"),keys:m?P:M("keys"),entries:A},y)for(v in g)v in k||f(k,v,g[v]);else i(i.P+i.F*(h||S),t,g);return g}},function(e,t,r){var n=r(212),i=r(76);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},function(e,t,r){var n=r(16),i=r(75),f=r(21)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[f])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(21)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,r){var n=r(112),i=r(21)("iterator"),f=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||f[i]===e)}},function(e,t,r){"use strict";var n=r(31),i=r(93);e.exports=function(e,t,r){t in e?n.f(e,t,i(0,r)):e[t]=r}},function(e,t,r){var n=r(140),i=r(21)("iterator"),f=r(112);e.exports=r(28).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||f[n(e)]}},function(e,t,r){"use strict";var n=r(35),i=r(97),f=r(25);e.exports=function(e){for(var t=n(this),r=f(t.length),c=arguments.length,a=i(c>1?arguments[1]:void 0,r),o=c>2?arguments[2]:void 0,s=void 0===o?r:i(o,r);s>a;)t[a++]=e;return t}},function(e,t,r){"use strict";var n=r(101),i=r(277),f=r(112),c=r(50);e.exports=r(210)(Array,"Array",(function(e,t){this._t=c(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),f.Arguments=f.Array,n("keys"),n("values"),n("entries")},function(e,t,r){"use strict";var n,i,f=r(157),c=RegExp.prototype.exec,a=String.prototype.replace,o=c,s=(n=/a/,i=/b*/g,c.call(n,"a"),c.call(i,"a"),0!==n.lastIndex||0!==i.lastIndex),d=void 0!==/()??/.exec("")[1];(s||d)&&(o=function(e){var t,r,n,i,o=this;return d&&(r=new RegExp("^"+o.source+"$(?!\\s)",f.call(o))),s&&(t=o.lastIndex),n=c.call(o,e),s&&n&&(o.lastIndex=o.global?n.index+n[0].length:t),d&&n&&n.length>1&&a.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n}),e.exports=o},function(e,t,r){"use strict";var n=r(209)(!0);e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},function(e,t,r){var n,i,f,c=r(59),a=r(266),o=r(202),s=r(198),d=r(13),u=d.process,h=d.setImmediate,l=d.clearImmediate,p=d.MessageChannel,b=d.Dispatch,m=0,y={},g=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},v=function(e){g.call(e.data)};h&&l||(h=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return y[++m]=function(){a("function"==typeof e?e:Function(e),t)},n(m),m},l=function(e){delete y[e]},"process"==r(75)(u)?n=function(e){u.nextTick(c(g,e,1))}:b&&b.now?n=function(e){b.now(c(g,e,1))}:p?(f=(i=new p).port2,i.port1.onmessage=v,n=c(f.postMessage,f,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(n=function(e){d.postMessage(e+"","*")},d.addEventListener("message",v,!1)):n="onreadystatechange"in s("script")?function(e){o.appendChild(s("script")).onreadystatechange=function(){o.removeChild(this),g.call(e)}}:function(e){setTimeout(c(g,e,1),0)}),e.exports={set:h,clear:l}},function(e,t,r){"use strict";var n=r(13),i=r(30),f=r(95),c=r(163),a=r(49),o=r(115),s=r(14),d=r(114),u=r(61),h=r(25),l=r(285),p=r(99).f,b=r(31).f,m=r(217),y=r(110),g=n.ArrayBuffer,v=n.DataView,w=n.Math,M=n.RangeError,O=n.Infinity,x=g,S=w.abs,k=w.pow,j=w.floor,P=w.log,A=w.LN2,E=i?"_b":"buffer",I=i?"_l":"byteLength",T=i?"_o":"byteOffset";function R(e,t,r){var n,i,f,c=new Array(r),a=8*r-t-1,o=(1<<a)-1,s=o>>1,d=23===t?k(2,-24)-k(2,-77):0,u=0,h=e<0||0===e&&1/e<0?1:0;for((e=S(e))!=e||e===O?(i=e!=e?1:0,n=o):(n=j(P(e)/A),e*(f=k(2,-n))<1&&(n--,f*=2),(e+=n+s>=1?d/f:d*k(2,1-s))*f>=2&&(n++,f/=2),n+s>=o?(i=0,n=o):n+s>=1?(i=(e*f-1)*k(2,t),n+=s):(i=e*k(2,s-1)*k(2,t),n=0));t>=8;c[u++]=255&i,i/=256,t-=8);for(n=n<<t|i,a+=t;a>0;c[u++]=255&n,n/=256,a-=8);return c[--u]|=128*h,c}function N(e,t,r){var n,i=8*r-t-1,f=(1<<i)-1,c=f>>1,a=i-7,o=r-1,s=e[o--],d=127&s;for(s>>=7;a>0;d=256*d+e[o],o--,a-=8);for(n=d&(1<<-a)-1,d>>=-a,a+=t;a>0;n=256*n+e[o],o--,a-=8);if(0===d)d=1-c;else{if(d===f)return n?NaN:s?-O:O;n+=k(2,t),d-=c}return(s?-1:1)*n*k(2,d-t)}function _(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function C(e){return[255&e]}function B(e){return[255&e,e>>8&255]}function H(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function D(e){return R(e,52,8)}function L(e){return R(e,23,4)}function z(e,t,r){b(e.prototype,t,{get:function(){return this[r]}})}function V(e,t,r,n){var i=l(+r);if(i+t>e[I])throw M("Wrong index!");var f=e[E]._b,c=i+e[T],a=f.slice(c,c+t);return n?a:a.reverse()}function q(e,t,r,n,i,f){var c=l(+r);if(c+t>e[I])throw M("Wrong index!");for(var a=e[E]._b,o=c+e[T],s=n(+i),d=0;d<t;d++)a[o+d]=s[f?d:t-d-1]}if(c.ABV){if(!s((function(){g(1)}))||!s((function(){new g(-1)}))||s((function(){return new g,new g(1.5),new g(NaN),"ArrayBuffer"!=g.name}))){for(var U,F=(g=function(e){return d(this,g),new x(l(e))}).prototype=x.prototype,W=p(x),K=0;W.length>K;)(U=W[K++])in g||a(g,U,x[U]);f||(F.constructor=g)}var X=new v(new g(2)),Z=v.prototype.setInt8;X.setInt8(0,2147483648),X.setInt8(1,2147483649),!X.getInt8(0)&&X.getInt8(1)||o(v.prototype,{setInt8:function(e,t){Z.call(this,e,t<<24>>24)},setUint8:function(e,t){Z.call(this,e,t<<24>>24)}},!0)}else g=function(e){d(this,g,"ArrayBuffer");var t=l(e);this._b=m.call(new Array(t),0),this[I]=t},v=function(e,t,r){d(this,v,"DataView"),d(e,g,"DataView");var n=e[I],i=u(t);if(i<0||i>n)throw M("Wrong offset!");if(i+(r=void 0===r?n-i:h(r))>n)throw M("Wrong length!");this[E]=e,this[T]=i,this[I]=r},i&&(z(g,"byteLength","_l"),z(v,"buffer","_b"),z(v,"byteLength","_l"),z(v,"byteOffset","_o")),o(v.prototype,{getInt8:function(e){return V(this,1,e)[0]<<24>>24},getUint8:function(e){return V(this,1,e)[0]},getInt16:function(e){var t=V(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=V(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return _(V(this,4,e,arguments[1]))},getUint32:function(e){return _(V(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return N(V(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return N(V(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){q(this,1,e,C,t)},setUint8:function(e,t){q(this,1,e,C,t)},setInt16:function(e,t){q(this,2,e,B,t,arguments[2])},setUint16:function(e,t){q(this,2,e,B,t,arguments[2])},setInt32:function(e,t){q(this,4,e,H,t,arguments[2])},setUint32:function(e,t){q(this,4,e,H,t,arguments[2])},setFloat32:function(e,t){q(this,4,e,L,t,arguments[2])},setFloat64:function(e,t){q(this,8,e,D,t,arguments[2])}});y(g,"ArrayBuffer"),y(v,"DataView"),a(v.prototype,c.VIEW,!0),t.ArrayBuffer=g,t.DataView=v},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){e.exports=!r(290)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function f(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),f=i>>8,c=255&i;f?r.push(f,c):r.push(c)}return r},n.zero2=i,n.toHex=f,n.encode=function(e,t){return"hex"===t?f(e):e}},function(e,t,r){"use strict";var n,i=t,f=r(66),c=r(293),a=r(51).assert;function o(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("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:f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:f.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"]}),s("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:f.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["9"]}),s("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:f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(585)}catch(e){n=void 0}s("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:f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(116),t.createHash=t.Hash=r(144),t.createHmac=t.Hmac=r(312);var n=r(618),i=Object.keys(n),f=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return f};var c=r(315);t.pbkdf2=c.pbkdf2,t.pbkdf2Sync=c.pbkdf2Sync;var a=r(620);t.Cipher=a.Cipher,t.createCipher=a.createCipher,t.Cipheriv=a.Cipheriv,t.createCipheriv=a.createCipheriv,t.Decipher=a.Decipher,t.createDecipher=a.createDecipher,t.Decipheriv=a.Decipheriv,t.createDecipheriv=a.createDecipheriv,t.getCiphers=a.getCiphers,t.listCiphers=a.listCiphers;var o=r(635);t.DiffieHellmanGroup=o.DiffieHellmanGroup,t.createDiffieHellmanGroup=o.createDiffieHellmanGroup,t.getDiffieHellman=o.getDiffieHellman,t.createDiffieHellman=o.createDiffieHellman,t.DiffieHellman=o.DiffieHellman;var s=r(641);t.createSign=s.createSign,t.Sign=s.Sign,t.createVerify=s.createVerify,t.Verify=s.Verify,t.createECDH=r(674);var d=r(677);t.publicEncrypt=d.publicEncrypt,t.privateEncrypt=d.privateEncrypt,t.publicDecrypt=d.publicDecrypt,t.privateDecrypt=d.privateDecrypt;var u=r(681);t.randomFill=u.randomFill,t.randomFillSync=u.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";var n=r(9),i=r(298),f=r(11).Buffer,c=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(e,t){return e<<t|e>>>32-t}function s(e,t,r,n,i,f,c){return o(e+(t&r|~t&n)+i+f|0,c)+t|0}function d(e,t,r,n,i,f,c){return o(e+(t&n|r&~n)+i+f|0,c)+t|0}function u(e,t,r,n,i,f,c){return o(e+(t^r^n)+i+f|0,c)+t|0}function h(e,t,r,n,i,f,c){return o(e+(r^(t|~n))+i+f|0,c)+t|0}n(a,i),a.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,f=this._d;r=s(r,n,i,f,e[0],3614090360,7),f=s(f,r,n,i,e[1],3905402710,12),i=s(i,f,r,n,e[2],606105819,17),n=s(n,i,f,r,e[3],3250441966,22),r=s(r,n,i,f,e[4],4118548399,7),f=s(f,r,n,i,e[5],1200080426,12),i=s(i,f,r,n,e[6],2821735955,17),n=s(n,i,f,r,e[7],4249261313,22),r=s(r,n,i,f,e[8],1770035416,7),f=s(f,r,n,i,e[9],2336552879,12),i=s(i,f,r,n,e[10],4294925233,17),n=s(n,i,f,r,e[11],2304563134,22),r=s(r,n,i,f,e[12],1804603682,7),f=s(f,r,n,i,e[13],4254626195,12),i=s(i,f,r,n,e[14],2792965006,17),r=d(r,n=s(n,i,f,r,e[15],1236535329,22),i,f,e[1],4129170786,5),f=d(f,r,n,i,e[6],3225465664,9),i=d(i,f,r,n,e[11],643717713,14),n=d(n,i,f,r,e[0],3921069994,20),r=d(r,n,i,f,e[5],3593408605,5),f=d(f,r,n,i,e[10],38016083,9),i=d(i,f,r,n,e[15],3634488961,14),n=d(n,i,f,r,e[4],3889429448,20),r=d(r,n,i,f,e[9],568446438,5),f=d(f,r,n,i,e[14],3275163606,9),i=d(i,f,r,n,e[3],4107603335,14),n=d(n,i,f,r,e[8],1163531501,20),r=d(r,n,i,f,e[13],2850285829,5),f=d(f,r,n,i,e[2],4243563512,9),i=d(i,f,r,n,e[7],1735328473,14),r=u(r,n=d(n,i,f,r,e[12],2368359562,20),i,f,e[5],4294588738,4),f=u(f,r,n,i,e[8],2272392833,11),i=u(i,f,r,n,e[11],1839030562,16),n=u(n,i,f,r,e[14],4259657740,23),r=u(r,n,i,f,e[1],2763975236,4),f=u(f,r,n,i,e[4],1272893353,11),i=u(i,f,r,n,e[7],4139469664,16),n=u(n,i,f,r,e[10],3200236656,23),r=u(r,n,i,f,e[13],681279174,4),f=u(f,r,n,i,e[0],3936430074,11),i=u(i,f,r,n,e[3],3572445317,16),n=u(n,i,f,r,e[6],76029189,23),r=u(r,n,i,f,e[9],3654602809,4),f=u(f,r,n,i,e[12],3873151461,11),i=u(i,f,r,n,e[15],530742520,16),r=h(r,n=u(n,i,f,r,e[2],3299628645,23),i,f,e[0],4096336452,6),f=h(f,r,n,i,e[7],1126891415,10),i=h(i,f,r,n,e[14],2878612391,15),n=h(n,i,f,r,e[5],4237533241,21),r=h(r,n,i,f,e[12],1700485571,6),f=h(f,r,n,i,e[3],2399980690,10),i=h(i,f,r,n,e[10],4293915773,15),n=h(n,i,f,r,e[1],2240044497,21),r=h(r,n,i,f,e[8],1873313359,6),f=h(f,r,n,i,e[15],4264355552,10),i=h(i,f,r,n,e[6],2734768916,15),n=h(n,i,f,r,e[13],1309151649,21),r=h(r,n,i,f,e[4],4149444226,6),f=h(f,r,n,i,e[11],3174756917,10),i=h(i,f,r,n,e[2],718787259,15),n=h(n,i,f,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+f|0},a.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=f.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=a},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(32))},function(e,t,r){"use strict";var n=r(117).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,f){if("function"==typeof r)return e(t,null,r);r||(r={}),f=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)}}}(f||i);var c=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,o=function(){t.writable||d()},s=t._writableState&&t._writableState.finished,d=function(){a=!1,s=!0,c||f.call(t)},u=t._readableState&&t._readableState.endEmitted,h=function(){c=!1,u=!0,a||f.call(t)},l=function(e){f.call(t,e)},p=function(){var e;return c&&!u?(t._readableState&&t._readableState.ended||(e=new n),f.call(t,e)):a&&!s?(t._writableState&&t._writableState.ended||(e=new n),f.call(t,e)):void 0},b=function(){t.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",o),t.on("close",o)):(t.on("complete",d),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",h),t.on("finish",d),!1!==r.error&&t.on("error",l),t.on("close",p),function(){t.removeListener("complete",d),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",d),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",l),t.removeListener("close",p)}}},function(e,t,r){"use strict";var n=r(19).Buffer,i=r(9),f=r(298),c=new Array(16),a=[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],o=[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],s=[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],d=[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],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function l(){f.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,f,c,a){return p(e+(t^r^n)+f+c|0,a)+i|0}function m(e,t,r,n,i,f,c,a){return p(e+(t&r|~t&n)+f+c|0,a)+i|0}function y(e,t,r,n,i,f,c,a){return p(e+((t|~r)^n)+f+c|0,a)+i|0}function g(e,t,r,n,i,f,c,a){return p(e+(t&n|r&~n)+f+c|0,a)+i|0}function v(e,t,r,n,i,f,c,a){return p(e+(t^(r|~n))+f+c|0,a)+i|0}i(l,f),l.prototype._update=function(){for(var e=c,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,f=0|this._d,l=0|this._e,w=0|this._a,M=0|this._b,O=0|this._c,x=0|this._d,S=0|this._e,k=0;k<80;k+=1){var j,P;k<16?(j=b(r,n,i,f,l,e[a[k]],u[0],s[k]),P=v(w,M,O,x,S,e[o[k]],h[0],d[k])):k<32?(j=m(r,n,i,f,l,e[a[k]],u[1],s[k]),P=g(w,M,O,x,S,e[o[k]],h[1],d[k])):k<48?(j=y(r,n,i,f,l,e[a[k]],u[2],s[k]),P=y(w,M,O,x,S,e[o[k]],h[2],d[k])):k<64?(j=g(r,n,i,f,l,e[a[k]],u[3],s[k]),P=m(w,M,O,x,S,e[o[k]],h[3],d[k])):(j=v(r,n,i,f,l,e[a[k]],u[4],s[k]),P=b(w,M,O,x,S,e[o[k]],h[4],d[k])),r=l,l=f,f=p(i,10),i=n,n=j,w=S,S=x,x=p(O,10),O=M,M=P}var A=this._b+i+x|0;this._b=this._c+f+S|0,this._c=this._d+l+w|0,this._d=this._e+r+M|0,this._e=this._a+n+O|0,this._a=A},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(603),t.sha1=r(604),t.sha224=r(605),t.sha256=r(305),t.sha384=r(606),t.sha512=r(306)},function(e,t,r){(t=e.exports=r(307)).Stream=t,t.Readable=t,t.Writable=r(236),t.Duplex=r(105),t.Transform=r(311),t.PassThrough=r(612)},function(e,t,r){var n=r(19),i=n.Buffer;function f(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(f(n,t),t.Buffer=c),f(i,c),c.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},c.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},c.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},c.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 f=r(165);function c(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=g;var a,o=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:f.nextTick;g.WritableState=y;var s=Object.create(r(145));s.inherits=r(9);var d={deprecate:r(230)},u=r(308),h=r(235).Buffer,l=i.Uint8Array||function(){};var p,b=r(309);function m(){}function y(e,t){a=a||r(105),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=e.writableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:d,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!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?(f.nextTick(i,n),f.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var c=O(r);c||r.corked||r.bufferProcessing||!r.bufferedRequest||M(e,r),n?o(w,e,r,c,i):w(e,r,c,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 c(this)}function g(e){if(a=a||r(105),!(p.call(g,this)||this instanceof a))return new g(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function v(e,t,r,n,i,f,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,f,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function M(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),f=t.corkedRequestsFree;f.entry=r;for(var a=0,o=!0;r;)i[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;i.allBuffers=o,v(e,t,!0,t.length,i,"",f.finish),t.pendingcb++,t.lastBufferedRequest=null,f.next?(t.corkedRequestsFree=f.next,f.next=null):t.corkedRequestsFree=new c(t),t.bufferedRequestCount=0}else{for(;r;){var s=r.chunk,d=r.encoding,u=r.callback;if(v(e,t,!1,t.objectMode?1:s.length,s,d,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=O(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,f.nextTick(x,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}s.inherits(g,u),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:d.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(g,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===g&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,c=!1,a=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof l);return a&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),f.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,c=!1;return null===r?c=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(c=new TypeError("Invalid non-string/buffer chunk")),c&&(e.emit("error",c),f.nextTick(n,c),i=!1),i}(this,i,e,r))&&(i.pendingcb++,c=function(e,t,r,n,i,f){if(!r){var c=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==c&&(r=!0,i="buffer",n=c)}var a=t.objectMode?1:n.length;t.length+=a;var o=t.length<t.highWaterMark;o||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:f,next:null},s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,a,n,i,f);return o}(this,i,a,e,t,r)),c},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||M(this,e))},g.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(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?f.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=b.destroy,g.prototype._undestroy=b.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(26),r(310).setImmediate,r(32))},function(e,t,r){"use strict";var n=r(44);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var f=e.length-(e.length-t)%this.blockSize;t<f;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,r){var n=r(625),i=r(633),f=r(324);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(f)}},function(e,t,r){var n={ECB:r(626),CBC:r(627),CFB:r(628),CFB8:r(629),CFB1:r(630),OFB:r(631),CTR:r(322),GCM:r(322)},i=r(324);for(var f in i)i[f].module=n[i[f].mode];e.exports=i},function(e,t,r){"use strict";var n=r(120).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,f){if("function"==typeof r)return e(t,null,r);r||(r={}),f=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)}}}(f||i);var c=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,o=function(){t.writable||d()},s=t._writableState&&t._writableState.finished,d=function(){a=!1,s=!0,c||f.call(t)},u=t._readableState&&t._readableState.endEmitted,h=function(){c=!1,u=!0,a||f.call(t)},l=function(e){f.call(t,e)},p=function(){var e;return c&&!u?(t._readableState&&t._readableState.ended||(e=new n),f.call(t,e)):a&&!s?(t._writableState&&t._writableState.ended||(e=new n),f.call(t,e)):void 0},b=function(){t.req.on("finish",d)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",o),t.on("close",o)):(t.on("complete",d),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",h),t.on("finish",d),!1!==r.error&&t.on("error",l),t.on("close",p),function(){t.removeListener("complete",d),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",d),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",l),t.removeListener("close",p)}}},function(e,t,r){(function(t){var n=r(20),i=r(116);function f(e){var t,r=e.modulus.byteLength();do{t=new n(i(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function c(e,r){var i=function(e){var t=f(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),c=r.modulus.byteLength(),a=new n(e).mul(i.blinder).umod(r.modulus),o=a.toRed(n.mont(r.prime1)),s=a.toRed(n.mont(r.prime2)),d=r.coefficient,u=r.prime1,h=r.prime2,l=o.redPow(r.exponent1).fromRed(),p=s.redPow(r.exponent2).fromRed(),b=l.isub(p).imul(d).umod(u).imul(h);return p.iadd(b).imul(i.unblinder).umod(r.modulus).toArrayLike(t,"be",c)}c.getr=f,e.exports=c}).call(this,r(19).Buffer)},function(e,t,r){"use strict";var n=t;n.version=r(651).version,n.utils=r(52),n.rand=r(142),n.curve=r(336),n.curves=r(243),n.ec=r(657),n.eddsa=r(660)},function(e,t,r){"use strict";var n,i=t,f=r(66),c=r(336),a=r(52).assert;function o(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("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:f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:f.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"]}),s("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:f.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["9"]}),s("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:f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(656)}catch(e){n=void 0}s("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:f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";(function(t){var n,i=r(19),f=i.Buffer,c={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(c[n]=i[n]);var a=c.Buffer={};for(n in f)f.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=f[n]);if(c.Buffer.prototype=f.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return f(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=f(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!c.kStringMaxLength)try{c.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}c.constants||(c.constants={MAX_LENGTH:c.kMaxLength},c.kStringMaxLength&&(c.constants.MAX_STRING_LENGTH=c.kStringMaxLength)),e.exports=c}).call(this,r(26))},function(e,t,r){"use strict";const n=r(246).Reporter,i=r(147).EncoderBuffer,f=r(147).DecoderBuffer,c=r(44),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function s(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=s;const d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];s.prototype.clone=function(){const e=this._baseState,t={};d.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},s.prototype._wrap=function(){const e=this._baseState;o.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},s.prototype._init=function(e){const t=this._baseState;c(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),c.equal(t.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(c(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(c(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){s.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){s.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return c(null===t.tag),t.tag=e,this._useArgs(r),this}})),s.prototype.use=function(e){c(e);const t=this._baseState;return c(null===t.use),t.use=e,this},s.prototype.optional=function(){return this._baseState.optional=!0,this},s.prototype.def=function(e){const t=this._baseState;return c(null===t.default),t.default=e,t.optional=!0,this},s.prototype.explicit=function(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.explicit=e,this},s.prototype.implicit=function(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.implicit=e,this},s.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},s.prototype.key=function(e){const t=this._baseState;return c(null===t.key),t.key=e,this},s.prototype.any=function(){return this._baseState.any=!0,this},s.prototype.choice=function(e){const t=this._baseState;return c(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},s.prototype.contains=function(e){const t=this._baseState;return c(null===t.use),t.contains=e,this},s.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,c=!0,a=null;if(null!==r.key&&(a=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(c=this._peekTag(e,n,r.any),e.isError(c))return c}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),c=!0}catch(e){c=!1}e.restore(n)}}if(r.obj&&c&&(n=e.enterObject()),c){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new f(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&c&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==c?null!==a&&e.exitKey(a):e.leaveKey(a,r.key,i),i},s.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),c(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},s.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(f){const c=e.save(),a=r.choice[f];try{const r=a._decode(e,t);if(e.isError(r))return!1;n={type:f,value:r},i=!0}catch(t){return e.restore(c),!1}return!0}),this),i?n:e.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},s.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},s.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let f=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let c=null,a=!1;if(i.any)f=this._createEncoderBuffer(e);else if(i.choice)f=this._encodeChoice(e,t);else if(i.contains)c=this._getUse(i.contains,r)._encode(e,t),a=!0;else if(i.children)c=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),c=this._createEncoderBuffer(c);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,c=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?f=this._getUse(i.use,r)._encode(e,t):(c=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(f=this._encodeComposite(e,a,r,c))}return null!==i.explicit&&(f=this._encodeComposite(i.explicit,!1,"context",f)),f},s.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||c(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},s.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},s.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,r){"use strict";const n=r(9);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function f(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof f},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof f;if(t=n?e:new f(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(f,Error),f.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,f),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(679).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t,r){"use strict";var n=r(11).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var f=e.charAt(i),c=f.charCodeAt(0);if(255!==t[c])throw new TypeError(f+" is ambiguous");t[c]=i}var a=e.length,o=e.charAt(0),s=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);var r=0;if(" "!==e[r]){for(var i=0,f=0;e[r]===o;)i++,r++;for(var c=(e.length-r)*s+1>>>0,d=new Uint8Array(c);e[r];){var u=t[e.charCodeAt(r)];if(255===u)return;for(var h=0,l=c-1;(0!==u||h<f)&&-1!==l;l--,h++)u+=a*d[l]>>>0,d[l]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");f=h,r++}if(" "!==e[r]){for(var p=c-f;p!==c&&0===d[p];)p++;var b=n.allocUnsafe(i+(c-p));b.fill(0,0,i);for(var m=i;p!==c;)b[m++]=d[p++];return b}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,f=0,c=t.length;f!==c&&0===t[f];)f++,r++;for(var s=(c-f)*d+1>>>0,u=new Uint8Array(s);f!==c;){for(var h=t[f],l=0,p=s-1;(0!==h||l<i)&&-1!==p;p--,l++)h+=256*u[p]>>>0,u[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,f++}for(var b=s-i;b!==s&&0===u[b];)b++;for(var m=o.repeat(r);b<s;++b)m+=e.charAt(u[b]);return m},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},function(e,t,r){(function(n,i){var f;
/**
 * [js-sha3]{@link https://github.com/emn178/js-sha3}
 *
 * @version 0.8.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2015-2018
 * @license MIT
 */!function(){"use strict";var c="input is invalid type",a="object"==typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?o=i:s&&(o=self);var d=!o.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,u=r(593),h=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[4,1024,262144,67108864],b=[0,8,16,24],m=[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],y=[224,256,384,512],g=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var M=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},O=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},x=function(e,t,r){return function(t,n,i,f){return A["cshake"+e].update(t,n,i,f)[r]()}},S=function(e,t,r){return function(t,n,i,f){return A["kmac"+e].update(t,n,i,f)[r]()}},k=function(e,t,r,n){for(var i=0;i<v.length;++i){var f=v[i];e[f]=t(r,n,f)}return e},j=function(e,t){var r=M(e,t,"hex");return r.create=function(){return new B(e,t,e)},r.update=function(e){return r.create().update(e)},k(r,M,e,t)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:j},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:j},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=O(e,t,"hex");return r.create=function(r){return new B(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},k(r,O,e,t)}},{name:"cshake",padding:p,bits:g,createMethod:function(e,t){var r=w[e],n=x(e,0,"hex");return n.create=function(n,i,f){return i||f?new B(e,t,n).bytepad([i,f],r):A["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},k(n,x,e,t)}},{name:"kmac",padding:p,bits:g,createMethod:function(e,t){var r=w[e],n=S(e,0,"hex");return n.create=function(n,i,f){return new H(e,t,i).bytepad(["KMAC",f],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},k(n,S,e,t)}}],A={},E=[],I=0;I<P.length;++I)for(var T=P[I],R=T.bits,N=0;N<R.length;++N){var _=T.name+"_"+R[N];if(E.push(_),A[_]=T.createMethod(R[N],T.padding),"sha3"!==T.name){var C=T.name+R[N];E.push(C),A[C]=A[_]}}function B(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function H(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(c);if(null===e)throw new Error(c);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(c);t=!0}for(var n,i,f=this.blocks,a=this.byteCount,o=e.length,s=this.blockCount,d=0,u=this.s;d<o;){if(this.reset)for(this.reset=!1,f[0]=this.block,n=1;n<s+1;++n)f[n]=0;if(t)for(n=this.start;d<o&&n<a;++d)f[n>>2]|=e[d]<<b[3&n++];else for(n=this.start;d<o&&n<a;++d)(i=e.charCodeAt(d))<128?f[n>>2]|=i<<b[3&n++]:i<2048?(f[n>>2]|=(192|i>>6)<<b[3&n++],f[n>>2]|=(128|63&i)<<b[3&n++]):i<55296||i>=57344?(f[n>>2]|=(224|i>>12)<<b[3&n++],f[n>>2]|=(128|i>>6&63)<<b[3&n++],f[n>>2]|=(128|63&i)<<b[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++d)),f[n>>2]|=(240|i>>18)<<b[3&n++],f[n>>2]|=(128|i>>12&63)<<b[3&n++],f[n>>2]|=(128|i>>6&63)<<b[3&n++],f[n>>2]|=(128|63&i)<<b[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=f[s],n=0;n<s;++n)u[n]^=f[n];D(u),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(c);if(null===e)throw new Error(c);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(c);t=!0}var n=0,i=e.length;if(t)n=i;else for(var f=0;f<e.length;++f){var a=e.charCodeAt(f);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++f)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,f=[];return f.length=i,this.update(f),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];D(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,f=0,c=0,a="";c<n;){for(f=0;f<t&&c<n;++f,++c)e=r[f],a+=l[e>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];c%t==0&&(D(r),f=0)}return i&&(e=r[f],a+=l[e>>4&15]+l[15&e],i>1&&(a+=l[e>>12&15]+l[e>>8&15]),i>2&&(a+=l[e>>20&15]+l[e>>16&15])),a},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,f=0,c=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var o=new Uint32Array(e);c<n;){for(f=0;f<t&&c<n;++f,++c)o[c]=r[f];c%t==0&&D(r)}return i&&(o[f]=r[f],e=e.slice(0,a)),e},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,f=this.extraBytes,c=0,a=0,o=[];a<i;){for(c=0;c<r&&a<i;++c,++a)e=a<<2,t=n[c],o[e]=255&t,o[e+1]=t>>8&255,o[e+2]=t>>16&255,o[e+3]=t>>24&255;a%r==0&&D(n)}return f&&(e=a<<2,t=n[c],o[e]=255&t,f>1&&(o[e+1]=t>>8&255),f>2&&(o[e+2]=t>>16&255)),o},H.prototype=new B,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var D=function(e){var t,r,n,i,f,c,a,o,s,d,u,h,l,p,b,y,g,v,w,M,O,x,S,k,j,P,A,E,I,T,R,N,_,C,B,H,D,L,z,V,q,U,F,W,K,X,Z,G,Y,J,Q,$,ee,te,re,ne,ie,fe,ce,ae,oe,se,de;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],f=e[1]^e[11]^e[21]^e[31]^e[41],c=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(c<<1|a>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|c>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(o<<1|s>>>31),r=f^(s<<1|o>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=c^(d<<1|u>>>31),r=a^(u<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(i<<1|f>>>31),r=u^(f<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],b=e[1],X=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,E=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,oe=e[30]<<9|e[31]>>>23,U=e[40]<<18|e[41]>>>14,F=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,B=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,G=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,se=e[42]<<2|e[43]>>>30,de=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,H=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,_=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,j=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,L=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,M=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,A=e[19]<<20|e[18]>>>12,fe=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=p^~y&v,e[1]=b^~g&w,e[10]=k^~P&E,e[11]=j^~A&I,e[20]=C^~H&L,e[21]=B^~D&z,e[30]=W^~X&G,e[31]=K^~Z&Y,e[40]=te^~ne&fe,e[41]=re^~ie&ce,e[2]=y^~v&M,e[3]=g^~w&O,e[12]=P^~E&T,e[13]=A^~I&R,e[22]=H^~L&V,e[23]=D^~z&q,e[32]=X^~G&J,e[33]=Z^~Y&Q,e[42]=ne^~fe&ae,e[43]=ie^~ce&oe,e[4]=v^~M&x,e[5]=w^~O&S,e[14]=E^~T&N,e[15]=I^~R&_,e[24]=L^~V&U,e[25]=z^~q&F,e[34]=G^~J&$,e[35]=Y^~Q&ee,e[44]=fe^~ae&se,e[45]=ce^~oe&de,e[6]=M^~x&p,e[7]=O^~S&b,e[16]=T^~N&k,e[17]=R^~_&j,e[26]=V^~U&C,e[27]=q^~F&B,e[36]=J^~$&W,e[37]=Q^~ee&K,e[46]=ae^~se&te,e[47]=oe^~de&re,e[8]=x^~p&y,e[9]=S^~b&g,e[18]=N^~k&P,e[19]=_^~j&A,e[28]=U^~C&H,e[29]=F^~B&D,e[38]=$^~W&X,e[39]=ee^~K&Z,e[48]=se^~te&ne,e[49]=de^~re&ie,e[0]^=m[n],e[1]^=m[n+1]};if(d)e.exports=A;else{for(I=0;I<E.length;++I)o[E[I]]=A[E[I]];u&&(void 0===(f=function(){return A}.call(t,r,t,e))||(e.exports=f))}}()}).call(this,r(26),r(32))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return n}));const n="undefined"!=typeof globalThis?globalThis:void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0}).call(this,r(32))},function(e,t,r){e.exports={h32:r(690),h64:r(693)}},,,,,,function(e,t,r){e.exports=!r(30)&&!r(14)((function(){return 7!=Object.defineProperty(r(198)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(13),i=r(28),f=r(95),c=r(199),a=r(31).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=f?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:c.f(e)})}},function(e,t,r){var n=r(48),i=r(50),f=r(153)(!1),c=r(200)("IE_PROTO");e.exports=function(e,t){var r,a=i(e),o=0,s=[];for(r in a)r!=c&&n(a,r)&&s.push(r);for(;t.length>o;)n(a,r=t[o++])&&(~f(s,r)||s.push(r));return s}},function(e,t,r){var n=r(31),i=r(15),f=r(96);e.exports=r(30)?Object.defineProperties:function(e,t){i(e);for(var r,c=f(t),a=c.length,o=0;a>o;)n.f(e,r=c[o++],t[r]);return e}},function(e,t,r){var n=r(50),i=r(99).f,f={}.toString,c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return c&&"[object Window]"==f.call(e)?function(e){try{return i(e)}catch(e){return c.slice()}}(e):i(n(e))}},function(e,t,r){"use strict";var n=r(30),i=r(96),f=r(154),c=r(139),a=r(35),o=r(138),s=Object.assign;e.exports=!s||r(14)((function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=s({},e)[r]||Object.keys(s({},t)).join("")!=n}))?function(e,t){for(var r=a(e),s=arguments.length,d=1,u=f.f,h=c.f;s>d;)for(var l,p=o(arguments[d++]),b=u?i(p).concat(u(p)):i(p),m=b.length,y=0;m>y;)l=b[y++],n&&!h.call(p,l)||(r[l]=p[l]);return r}:s},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,r){"use strict";var n=r(60),i=r(16),f=r(266),c=[].slice,a={},o=function(e,t,r){if(!(t in a)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";a[t]=Function("F,a","return new F("+n.join(",")+")")}return a[t](e,r)};e.exports=Function.bind||function(e){var t=n(this),r=c.call(arguments,1),a=function(){var n=r.concat(c.call(arguments));return this instanceof a?o(t,n.length,n):f(t,n,e)};return i(t.prototype)&&(a.prototype=t.prototype),a}},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var n=r(13).parseInt,i=r(111).trim,f=r(204),c=/^[-+]?0[xX]/;e.exports=8!==n(f+"08")||22!==n(f+"0x16")?function(e,t){var r=i(String(e),3);return n(r,t>>>0||(c.test(r)?16:10))}:n},function(e,t,r){var n=r(13).parseFloat,i=r(111).trim;e.exports=1/n(r(204)+"-0")!=-1/0?function(e){var t=i(String(e),3),r=n(t);return 0===r&&"-"==t.charAt(0)?-0:r}:n},function(e,t,r){var n=r(75);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=n(e))throw TypeError(t);return+e}},function(e,t,r){var n=r(16),i=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&i(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,r){"use strict";var n=r(98),i=r(93),f=r(110),c={};r(49)(c,r(21)("iterator"),(function(){return this})),e.exports=function(e,t,r){e.prototype=n(c,{next:i(1,r)}),f(e,t+" Iterator")}},function(e,t,r){var n=r(15);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var f=e.return;throw void 0!==f&&n(f.call(e)),t}}},function(e,t,r){var n=r(475);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){var n=r(60),i=r(35),f=r(138),c=r(25);e.exports=function(e,t,r,a,o){n(t);var s=i(e),d=f(s),u=c(s.length),h=o?u-1:0,l=o?-1:1;if(r<2)for(;;){if(h in d){a=d[h],h+=l;break}if(h+=l,o?h<0:u<=h)throw TypeError("Reduce of empty array with no initial value")}for(;o?h>=0:u>h;h+=l)h in d&&(a=t(a,d[h],h,s));return a}},function(e,t,r){"use strict";var n=r(35),i=r(97),f=r(25);e.exports=[].copyWithin||function(e,t){var r=n(this),c=f(r.length),a=i(e,c),o=i(t,c),s=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===s?c:i(s,c))-o,c-a),u=1;for(o<a&&a<o+d&&(u=-1,o+=d-1,a+=d-1);d-- >0;)o in r?r[a]=r[o]:delete r[a],a+=u,o+=u;return r}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n=r(219);r(3)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},function(e,t,r){r(30)&&"g"!=/./g.flags&&r(31).f(RegExp.prototype,"flags",{configurable:!0,get:r(157)})},function(e,t,r){"use strict";var n,i,f,c,a=r(95),o=r(13),s=r(59),d=r(140),u=r(3),h=r(16),l=r(60),p=r(114),b=r(160),m=r(141),y=r(221).set,g=r(495)(),v=r(281),w=r(496),M=r(161),O=r(282),x=o.TypeError,S=o.process,k=S&&S.versions,j=k&&k.v8||"",P=o.Promise,A="process"==d(S),E=function(){},I=i=v.f,T=!!function(){try{var e=P.resolve(1),t=(e.constructor={})[r(21)("species")]=function(e){e(E,E)};return(A||"function"==typeof PromiseRejectionEvent)&&e.then(E)instanceof t&&0!==j.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(e){}}(),R=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},N=function(e,t){if(!e._n){e._n=!0;var r=e._c;g((function(){for(var n=e._v,i=1==e._s,f=0,c=function(t){var r,f,c,a=i?t.ok:t.fail,o=t.resolve,s=t.reject,d=t.domain;try{a?(i||(2==e._h&&B(e),e._h=1),!0===a?r=n:(d&&d.enter(),r=a(n),d&&(d.exit(),c=!0)),r===t.promise?s(x("Promise-chain cycle")):(f=R(r))?f.call(r,o,s):o(r)):s(n)}catch(e){d&&!c&&d.exit(),s(e)}};r.length>f;)c(r[f++]);e._c=[],e._n=!1,t&&!e._h&&_(e)}))}},_=function(e){y.call(o,(function(){var t,r,n,i=e._v,f=C(e);if(f&&(t=w((function(){A?S.emit("unhandledRejection",i,e):(r=o.onunhandledrejection)?r({promise:e,reason:i}):(n=o.console)&&n.error&&n.error("Unhandled promise rejection",i)})),e._h=A||C(e)?2:1),e._a=void 0,f&&t.e)throw t.v}))},C=function(e){return 1!==e._h&&0===(e._a||e._c).length},B=function(e){y.call(o,(function(){var t;A?S.emit("rejectionHandled",e):(t=o.onrejectionhandled)&&t({promise:e,reason:e._v})}))},H=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),N(t,!0))},D=function(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw x("Promise can't be resolved itself");(t=R(e))?g((function(){var n={_w:r,_d:!1};try{t.call(e,s(D,n,1),s(H,n,1))}catch(e){H.call(n,e)}})):(r._v=e,r._s=1,N(r,!1))}catch(e){H.call({_w:r,_d:!1},e)}}};T||(P=function(e){p(this,P,"Promise","_h"),l(e),n.call(this);try{e(s(D,this,1),s(H,this,1))}catch(e){H.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(115)(P.prototype,{then:function(e,t){var r=I(m(this,P));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=A?S.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&N(this,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),f=function(){var e=new n;this.promise=e,this.resolve=s(D,e,1),this.reject=s(H,e,1)},v.f=I=function(e){return e===P||e===c?new f(e):i(e)}),u(u.G+u.W+u.F*!T,{Promise:P}),r(110)(P,"Promise"),r(113)("Promise"),c=r(28).Promise,u(u.S+u.F*!T,"Promise",{reject:function(e){var t=I(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(a||!T),"Promise",{resolve:function(e){return O(a&&this===c?P:this,e)}}),u(u.S+u.F*!(T&&r(156)((function(e){P.all(e).catch(E)}))),"Promise",{all:function(e){var t=this,r=I(t),n=r.resolve,i=r.reject,f=w((function(){var r=[],f=0,c=1;b(e,!1,(function(e){var a=f++,o=!1;r.push(void 0),c++,t.resolve(e).then((function(e){o||(o=!0,r[a]=e,--c||n(r))}),i)})),--c||n(r)}));return f.e&&i(f.v),r.promise},race:function(e){var t=this,r=I(t),n=r.reject,i=w((function(){b(e,!1,(function(e){t.resolve(e).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}})},function(e,t,r){"use strict";var n=r(60);function i(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)}e.exports.f=function(e){return new i(e)}},function(e,t,r){var n=r(15),i=r(16),f=r(281);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=f.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){"use strict";var n=r(31).f,i=r(98),f=r(115),c=r(59),a=r(114),o=r(160),s=r(210),d=r(277),u=r(113),h=r(30),l=r(86).fastKey,p=r(102),b=h?"_s":"size",m=function(e,t){var r,n=l(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r};e.exports={getConstructor:function(e,t,r,s){var d=e((function(e,n){a(e,d,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[b]=0,null!=n&&o(n,r,e[s],e)}));return f(d.prototype,{clear:function(){for(var e=p(this,t),r=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];e._f=e._l=void 0,e[b]=0},delete:function(e){var r=p(this,t),n=m(r,e);if(n){var i=n.n,f=n.p;delete r._i[n.i],n.r=!0,f&&(f.n=i),i&&(i.p=f),r._f==n&&(r._f=i),r._l==n&&(r._l=f),r[b]--}return!!n},forEach:function(e){p(this,t);for(var r,n=c(e,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(e){return!!m(p(this,t),e)}}),h&&n(d.prototype,"size",{get:function(){return p(this,t)[b]}}),d},def:function(e,t,r){var n,i,f=m(e,t);return f?f.v=r:(e._l=f={i:i=l(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=f),n&&(n.n=f),e[b]++,"F"!==i&&(e._i[i]=f)),e},getEntry:m,setStrong:function(e,t,r){s(e,t,(function(e,r){this._t=p(e,t),this._k=r,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?d(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,d(1))}),r?"entries":"values",!r,!0),u(t)}}},function(e,t,r){"use strict";var n=r(115),i=r(86).getWeak,f=r(15),c=r(16),a=r(114),o=r(160),s=r(64),d=r(48),u=r(102),h=s(5),l=s(6),p=0,b=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},y=function(e,t){return h(e.a,(function(e){return e[0]===t}))};m.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var r=y(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=l(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,f){var s=e((function(e,n){a(e,s,t,"_i"),e._t=t,e._i=p++,e._l=void 0,null!=n&&o(n,r,e[f],e)}));return n(s.prototype,{delete:function(e){if(!c(e))return!1;var r=i(e);return!0===r?b(u(this,t)).delete(e):r&&d(r,this._i)&&delete r[this._i]},has:function(e){if(!c(e))return!1;var r=i(e);return!0===r?b(u(this,t)).has(e):r&&d(r,this._i)}}),s},def:function(e,t,r){var n=i(f(t),!0);return!0===n?b(e).set(t,r):n[e._i]=r,e},ufstore:b}},function(e,t,r){var n=r(61),i=r(25);e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=i(t);if(t!==r)throw RangeError("Wrong length!");return r}},function(e,t,r){var n=r(99),i=r(154),f=r(15),c=r(13).Reflect;e.exports=c&&c.ownKeys||function(e){var t=n.f(f(e)),r=i.f;return r?t.concat(r(e)):t}},function(e,t,r){var n=r(25),i=r(206),f=r(76);e.exports=function(e,t,r,c){var a=String(f(e)),o=a.length,s=void 0===r?" ":String(r),d=n(t);if(d<=o||""==s)return a;var u=d-o,h=i.call(s,Math.ceil(u/s.length));return h.length>u&&(h=h.slice(0,u)),c?h+a:a+h}},function(e,t,r){var n=r(30),i=r(96),f=r(50),c=r(139).f;e.exports=function(e){return function(t){for(var r,a=f(t),o=i(a),s=o.length,d=0,u=[];s>d;)r=o[d++],n&&!c.call(a,r)||u.push(e?[r,a[r]]:a[r]);return u}}},function(e,t){var r=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=r)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(t){function r(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let r;if(e instanceof Uint8Array)r=e;else if(e instanceof t)r=new Uint8Array(e);else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");r=new Uint8Array(t.from(e,"utf8"))}return r},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,t,n){let i="\n"+e+" = ";for(let f=0;f<t.length;f+=2){if(32===n)i+=r(t[f]).toUpperCase(),i+=" ",i+=r(t[f+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=r(t[f+1]).toUpperCase(),i+=r(t[f]).toUpperCase()}f%6==4?i+="\n"+new Array(e.length+4).join(" "):f<t.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const f=(new Date).getTime();console.log("Generated random input in "+(f-n)+"ms"),n=f;for(let f=0;f<r;f++){const r=e(i),f=(new Date).getTime(),c=f-n;n=f,console.log("Hashed in "+c+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(c/1e3)*100)/100+" MB PER SECOND")}}}}).call(this,r(19).Buffer)},function(e,t,r){"use strict";var n=t;n.base=r(164),n.short=r(576),n.mont=r(577),n.edwards=r(578)},function(e,t,r){"use strict";var n=r(65).rotr32;function i(e,t,r){return e&t^~e&r}function f(e,t,r){return e&t^e&r^t&r}function c(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?c(t,r,n):2===e?f(t,r,n):void 0},t.ch32=i,t.maj32=f,t.p32=c,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(65),i=r(143),f=r(294),c=r(44),a=n.sum32,o=n.sum32_4,s=n.sum32_5,d=f.ch32,u=f.maj32,h=f.s0_256,l=f.s1_256,p=f.g0_256,b=f.g1_256,m=i.BlockHash,y=[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 g(){if(!(this instanceof g))return new g;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(g,m),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.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]=o(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],f=this.h[1],m=this.h[2],y=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],M=this.h[7];for(c(this.k.length===r.length),n=0;n<r.length;n++){var O=s(M,l(g),d(g,v,w),this.k[n],r[n]),x=a(h(i),u(i,f,m));M=w,w=v,v=g,g=a(y,O),y=m,m=f,f=i,i=a(O,x)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],f),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],g),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],M)},g.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(65),i=r(143),f=r(44),c=n.rotr64_hi,a=n.rotr64_lo,o=n.shr64_hi,s=n.shr64_lo,d=n.sum64,u=n.sum64_hi,h=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,y=i.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,i){var f=e&r^~e&i;return f<0&&(f+=4294967296),f}function M(e,t,r,n,i,f){var c=t&n^~t&f;return c<0&&(c+=4294967296),c}function O(e,t,r,n,i){var f=e&r^e&i^r&i;return f<0&&(f+=4294967296),f}function x(e,t,r,n,i,f){var c=t&n^t&f^n&f;return c<0&&(c+=4294967296),c}function S(e,t){var r=c(e,t,28)^c(t,e,2)^c(t,e,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=c(e,t,14)^c(e,t,18)^c(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=c(e,t,1)^c(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=a(e,t,1)^a(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=c(e,t,19)^c(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,19)^a(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.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=I(r[n-4],r[n-3]),f=T(r[n-4],r[n-3]),c=r[n-14],a=r[n-13],o=A(r[n-30],r[n-29]),s=E(r[n-30],r[n-29]),d=r[n-32],u=r[n-31];r[n]=l(i,f,c,a,o,s,d,u),r[n+1]=p(i,f,c,a,o,s,d,u)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],c=this.h[2],a=this.h[3],o=this.h[4],s=this.h[5],l=this.h[6],p=this.h[7],y=this.h[8],g=this.h[9],v=this.h[10],A=this.h[11],E=this.h[12],I=this.h[13],T=this.h[14],R=this.h[15];f(this.k.length===r.length);for(var N=0;N<r.length;N+=2){var _=T,C=R,B=j(y,g),H=P(y,g),D=w(y,g,v,A,E),L=M(y,g,v,A,E,I),z=this.k[N],V=this.k[N+1],q=r[N],U=r[N+1],F=b(_,C,B,H,D,L,z,V,q,U),W=m(_,C,B,H,D,L,z,V,q,U);_=S(n,i),C=k(n,i),B=O(n,i,c,a,o),H=x(n,i,c,a,o,s);var K=u(_,C,B,H),X=h(_,C,B,H);T=E,R=I,E=v,I=A,v=y,A=g,y=u(l,p,F,W),g=h(p,p,F,W),l=o,p=s,o=c,s=a,c=n,a=i,n=u(F,W,K,X),i=h(F,W,K,X)}d(this.h,0,n,i),d(this.h,2,c,a),d(this.h,4,o,s),d(this.h,6,l,p),d(this.h,8,y,g),d(this.h,10,v,A),d(this.h,12,E,I),d(this.h,14,T,R)},v.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(66),i=r(226),f=r(44);function c(e){if(!(this instanceof c))return new c(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");f(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=c,c.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},c.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},c.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())},c.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),f(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},c.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 f=[];f.length<e;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,e);return this._update(r),this._reseed++,i.encode(c,t)}},function(e,t,r){"use strict";var n=r(11).Buffer,i=r(595).Transform;function f(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(9)(f,i),f.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},f.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},f.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 f=this._blockOffset;f<this._blockSize;)r[f++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var c=0,a=8*e.length;a>0;++c)this._length[c]+=a,(a=this._length[c]/4294967296|0)>0&&(this._length[c]-=4294967296*a);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.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},f.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=f},function(e,t,r){"use strict";(function(t,n){var i;e.exports=k,k.ReadableState=S;r(103).EventEmitter;var f=function(e,t){return e.listeners(t).length},c=r(300),a=r(19).Buffer,o=t.Uint8Array||function(){};var s,d=r(596);s=d&&d.debuglog?d.debuglog("stream"):function(){};var u,h,l,p=r(597),b=r(301),m=r(302).getHighWaterMark,y=r(117).codes,g=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,M=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(9)(k,c);var O=b.errorOrDestroy,x=["error","close","destroy","pause","resume"];function S(e,t,n){i=i||r(118),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(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&&(u||(u=r(104).StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function k(e){if(i=i||r(118),!(this instanceof k))return new k(e);var t=this instanceof i;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function j(e,t,r,n,i){s("readableAddChunk",t);var f,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(s("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?E(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,c);else if(i||(f=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(c,t)),f)O(e,f);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)c.endEmitted?O(e,new M):P(e,c,t,!0);else if(c.ended)O(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?P(e,c,t,!1):T(e,c)):P(e,c,t,!1)}else n||(c.reading=!1,T(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function P(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&&E(e)),T(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=b.destroy,k.prototype._undestroy=b.undestroy,k.prototype._destroy=function(e,t){t(e)},k.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=a.from(e,t),t=""),r=!0),j(this,e,t,!1,r)},k.prototype.unshift=function(e){return j(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){u||(u=r(104).StringDecoder);var t=new u(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 A(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 E(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;s("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,B(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(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 _(e){s("readable nexttick read 0"),e.read(0)}function C(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function H(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;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(L,t,e))}function L(e,t){if(s("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 z(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){s("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 s("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return s("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&s("length less than watermark",i=!0),t.ended||t.reading?s("reading or ended",i=!1):i&&(s("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(n=e>0?H(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},k.prototype._read=function(e){O(this,new w("_read()"))},k.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,s("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?o:m;function a(t,n){s("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,s("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",l),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",m),r.removeListener("data",h),u=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function o(){s("onend"),e.end()}i.endEmitted?n.nextTick(c):r.once("end",c),e.on("unpipe",a);var d=function(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&f(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",d);var u=!1;function h(t){s("ondata");var n=e.write(t);s("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==z(i.pipes,e))&&!u&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function l(t){s("onerror",t),m(),e.removeListener("error",l),0===f(e,"error")&&O(e,t)}function p(){e.removeListener("finish",b),m()}function b(){s("onfinish"),e.removeListener("close",p),m()}function m(){s("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||(s("pipe resume"),r.resume()),e},k.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 f=0;f<i;f++)n[f].emit("unpipe",this,{hasUnpiped:!1});return this}var c=z(t.pipes,e);return-1===c||(t.pipes.splice(c,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=c.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,s("on readable",i.length,i.reading),i.length?E(this):i.reading||n.nextTick(_,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(N,this),r},k.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(N,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(C,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(s("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){(s("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 f=0;f<x.length;f++)e.on(x[f],this.emit.bind(this,x[f]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(599)),h(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=H,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===l&&(l=r(600)),l(k,e,t)})}).call(this,r(32),r(26))},function(e,t,r){e.exports=r(103).EventEmitter},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,f){var c=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(f?f(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){!f&&e?c._writableState?c._writableState.errorEmitted?t.nextTick(n,c):(c._writableState.errorEmitted=!0,t.nextTick(r,c,e)):t.nextTick(r,c,e):f?(t.nextTick(n,c),f(e)):t.nextTick(n,c)})),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(26))},function(e,t,r){"use strict";var n=r(117).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var f=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=f){if(!isFinite(f)||Math.floor(f)!==f||f<0)throw new n(i?r:"highWaterMark",f);return Math.floor(f)}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 f;e.exports=k,k.WritableState=S;var c={deprecate:r(230)},a=r(300),o=r(19).Buffer,s=t.Uint8Array||function(){};var d,u=r(301),h=r(302).getHighWaterMark,l=r(117).codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_METHOD_NOT_IMPLEMENTED,m=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,w=l.ERR_STREAM_WRITE_AFTER_END,M=l.ERR_UNKNOWN_ENCODING,O=u.errorOrDestroy;function x(){}function S(e,t,c){f=f||r(118),e=e||{},"boolean"!=typeof c&&(c=t instanceof f),this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",c),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,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,f=r.writecb;if("function"!=typeof f)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,f){--t.pendingcb,r?(n.nextTick(f,i),n.nextTick(T,e,t),e._writableState.errorEmitted=!0,O(e,i)):(f(i),e._writableState.errorEmitted=!0,O(e,i),T(e,t))}(e,r,i,t,f);else{var c=E(r)||e.destroyed;c||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),i?n.nextTick(P,e,r,c,f):P(e,r,c,f)}}(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 k(e){var t=this instanceof(f=f||r(118));if(!t&&!d.call(k,this))return new k(e);this._writableState=new S(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)),a.call(this)}function j(e,t,r,n,i,f,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,f,t.onwrite),t.sync=!1}function P(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,f=new Array(n),c=t.corkedRequestsFree;c.entry=r;for(var a=0,o=!0;r;)f[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;f.allBuffers=o,j(e,t,!0,t.length,f,"",c.finish),t.pendingcb++,t.lastBufferedRequest=null,c.next?(t.corkedRequestsFree=c.next,c.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var s=r.chunk,d=r.encoding,u=r.callback;if(j(e,t,!1,t.objectMode?1:s.length,s,d,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&O(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)}))}function T(e,t){var r=E(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(I,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(9)(k,a),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===k&&(e&&e._writableState instanceof S)}})):d=function(e){return e instanceof this},k.prototype.pipe=function(){O(this,new y)},k.prototype.write=function(e,t,r){var i,f=this._writableState,c=!1,a=!f.objectMode&&(i=e,o.isBuffer(i)||i instanceof s);return a&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=x),f.ending?function(e,t){var r=new w;O(e,r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,i){var f;return null===r?f=new v:"string"==typeof r||t.objectMode||(f=new p("chunk",["string","Buffer"],r)),!f||(O(e,f),n.nextTick(i,f),!1)}(this,f,e,r))&&(f.pendingcb++,c=function(e,t,r,n,i,f){if(!r){var c=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==c&&(r=!0,i="buffer",n=c)}var a=t.objectMode?1:n.length;t.length+=a;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:f,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,a,n,i,f);return s}(this,f,a,e,t,r)),c},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},k.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 M(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new b("_write()"))},k.prototype._writev=null,k.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,T(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this,r(32),r(26))},function(e,t,r){"use strict";e.exports=d;var n=r(117).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,f=n.ERR_MULTIPLE_CALLBACK,c=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,o=r(118);function s(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new f);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 d(e){if(!(this instanceof d))return new d(e);o.call(this,e),this._transformState={afterTransform:s.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",u)}function u(){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 a;if(e._transformState.transforming)throw new c;return e.push(null)}r(9)(d,o),d.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},d.prototype._transform=function(e,t,r){r(new i("_transform()"))},d.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)}},d.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))},d.prototype._destroy=function(e,t){o.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){var n=r(9),i=r(119),f=r(11).Buffer,c=[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],a=new Array(64);function o(){this.init(),this._w=a,i.call(this,64,56)}function s(e,t,r){return r^e&(t^r)}function d(e,t,r){return e&t|r&(e|t)}function u(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(o,i),o.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},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,f=0|this._c,a=0|this._d,o=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+l(r[y-15])+r[y-16];for(var g=0;g<64;++g){var v=m+h(o)+s(o,p,b)+c[g]+r[g]|0,w=u(n)+d(n,i,f)|0;m=b,b=p,p=o,o=a+v|0,a=f,f=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=f+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},o.prototype._hash=function(){var e=f.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=o},function(e,t,r){var n=r(9),i=r(119),f=r(11).Buffer,c=[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],a=new Array(160);function o(){this.init(),this._w=a,i.call(this,128,112)}function s(e,t,r){return r^e&(t^r)}function d(e,t,r){return e&t|r&(e|t)}function u(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 m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0<t>>>0?1:0}n(o,i),o.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},o.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,f=0|this._dh,a=0|this._eh,o=0|this._fh,g=0|this._gh,v=0|this._hh,w=0|this._al,M=0|this._bl,O=0|this._cl,x=0|this._dl,S=0|this._el,k=0|this._fl,j=0|this._gl,P=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var E=t[A-30],I=t[A-30+1],T=l(E,I),R=p(I,E),N=b(E=t[A-4],I=t[A-4+1]),_=m(I,E),C=t[A-14],B=t[A-14+1],H=t[A-32],D=t[A-32+1],L=R+B|0,z=T+C+y(L,R)|0;z=(z=z+N+y(L=L+_|0,_)|0)+H+y(L=L+D|0,D)|0,t[A]=z,t[A+1]=L}for(var V=0;V<160;V+=2){z=t[V],L=t[V+1];var q=d(r,n,i),U=d(w,M,O),F=u(r,w),W=u(w,r),K=h(a,S),X=h(S,a),Z=c[V],G=c[V+1],Y=s(a,o,g),J=s(S,k,j),Q=P+X|0,$=v+K+y(Q,P)|0;$=($=($=$+Y+y(Q=Q+J|0,J)|0)+Z+y(Q=Q+G|0,G)|0)+z+y(Q=Q+L|0,L)|0;var ee=W+U|0,te=F+q+y(ee,W)|0;v=g,P=j,g=o,j=k,o=a,k=S,a=f+$+y(S=x+Q|0,x)|0,f=i,x=O,i=n,O=M,n=r,M=w,r=$+te+y(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+O|0,this._dl=this._dl+x|0,this._el=this._el+S|0,this._fl=this._fl+k|0,this._gl=this._gl+j|0,this._hl=this._hl+P|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,M)|0,this._ch=this._ch+i+y(this._cl,O)|0,this._dh=this._dh+f+y(this._dl,x)|0,this._eh=this._eh+a+y(this._el,S)|0,this._fh=this._fh+o+y(this._fl,k)|0,this._gh=this._gh+g+y(this._gl,j)|0,this._hh=this._hh+v+y(this._hl,P)|0},o.prototype._hash=function(){var e=f.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=o},function(e,t,r){"use strict";(function(t,n){var i=r(165);e.exports=v;var f,c=r(291);v.ReadableState=g;r(103).EventEmitter;var a=function(e,t){return e.listeners(t).length},o=r(308),s=r(235).Buffer,d=t.Uint8Array||function(){};var u=Object.create(r(145));u.inherits=r(9);var h=r(608),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(609),m=r(309);u.inherits(v,o);var y=["error","close","destroy","pause","resume"];function g(e,t){e=e||{};var n=t instanceof(f=f||r(105));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,c=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:a,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(104).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(f=f||r(105),!(this instanceof v))return new v(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function w(e,t,r,n,i){var f,c=e._readableState;null===t?(c.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,x(e)}(e,c)):(i||(f=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof d||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(c,t)),f?e.emit("error",f):c.objectMode||t&&t.length>0?("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n?c.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):M(e,c,t,!0):c.ended?e.emit("error",new Error("stream.push() after EOF")):(c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?M(e,c,t,!1):k(e,c)):M(e,c,t,!1))):n||(c.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(c)}function M(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&&x(e)),k(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.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),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(104).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function O(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 x(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){l("emit readable"),e.emit("readable"),E(e)}function k(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(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 P(e){l("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),E(e),t.flowing&&!t.reading&&e.read(0)}function E(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function I(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 f=r.data,c=e>f.length?f.length:e;if(c===f.length?i+=f:i+=f.slice(0,e),0===(e-=c)){c===f.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=f.slice(c));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=s.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var f=n.data,c=e>f.length?f.length:e;if(f.copy(r,r.length-e,0,c),0===(e-=c)){c===f.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=f.slice(c));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function T(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(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.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?T(this):x(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&T(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=O(r,t))),null===(n=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,l("pipe count=%d opts=%j",f.pipesCount,t);var o=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?d:v;function s(t,n){l("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,l("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",s),r.removeListener("end",d),r.removeListener("end",v),r.removeListener("data",b),h=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function d(){l("onend"),e.end()}f.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",s);var u=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,E(e))}}(r);e.on("drain",u);var h=!1;var p=!1;function b(t){l("ondata"),p=!1,!1!==e.write(t)||p||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==N(f.pipes,e))&&!h&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){l("onerror",t),v(),e.removeListener("error",m),0===a(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",g),v()}function g(){l("onfinish"),e.removeListener("close",y),v()}function v(){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]?c(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",g),e.emit("pipe",r),f.flowing||(l("pipe resume"),r.resume()),e},v.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 f=0;f<i;f++)n[f].emit("unpipe",this,r);return this}var c=N(t.pipes,e);return-1===c||(t.pipes.splice(c,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(e,t){var r=o.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&&x(this):i.nextTick(P,this))}return r},v.prototype.addListener=v.prototype.on,v.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(A,e,t))}(this,e)),this},v.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},v.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 f=0;f<y.length;f++)e.on(y[f],this.emit.bind(this,y[f]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=I}).call(this,r(32),r(26))},function(e,t,r){e.exports=r(103).EventEmitter},function(e,t,r){"use strict";var n=r(165);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,f=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return f||c?(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){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function f(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new f(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new f(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},f.prototype.unref=f.prototype.ref=function(){},f.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(611),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(32))},function(e,t,r){"use strict";e.exports=c;var n=r(105),i=Object.create(r(145));function f(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 c(e){if(!(this instanceof c))return new c(e);n.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){o(e,t,r)})):o(this,null,null)}function o(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(9),i.inherits(c,n),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},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.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},c.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){"use strict";var n=r(9),i=r(617),f=r(87),c=r(11).Buffer,a=r(313),o=r(232),s=r(233),d=c.alloc(128);function u(e,t){f.call(this,"digest"),"string"==typeof t&&(t=c.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new o:s(e)).update(t).digest():t.length<r&&(t=c.concat([t,d],r));for(var n=this._ipad=c.allocUnsafe(r),i=this._opad=c.allocUnsafe(r),a=0;a<r;a++)n[a]=54^t[a],i[a]=92^t[a];this._hash="rmd160"===e?new o:s(e),this._hash.update(n)}n(u,f),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new o:s(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new u("rmd160",t):"md5"===e?new i(a,t):new u(e,t)}},function(e,t,r){var n=r(229);e.exports=function(e){return(new n).update(e).digest()}},function(e){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(e,t,r){t.pbkdf2=r(619),t.pbkdf2Sync=r(318)},function(e,t){var r=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>r||t!=t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t){var r;if(t.browser)r="utf-8";else if(t.version){r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,r(26))},function(e,t,r){var n=r(313),i=r(232),f=r(233),c=r(11).Buffer,a=r(316),o=r(317),s=r(319),d=c.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,r){var a=function(e){function t(t){return f(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:t}(e),o="sha512"===e||"sha384"===e?128:64;t.length>o?t=a(t):t.length<o&&(t=c.concat([t,d],o));for(var s=c.allocUnsafe(o+u[e]),h=c.allocUnsafe(o+u[e]),l=0;l<o;l++)s[l]=54^t[l],h[l]=92^t[l];var p=c.allocUnsafe(o+r+4);s.copy(p,0,0,o),this.ipad1=p,this.ipad2=s,this.opad=h,this.alg=e,this.blocksize=o,this.hash=a,this.size=u[e]}h.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){a(r,n);var f=new h(i=i||"sha1",e=s(e,o,"Password"),(t=s(t,o,"Salt")).length),d=c.allocUnsafe(n),l=c.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var p=0,b=u[i],m=Math.ceil(n/b),y=1;y<=m;y++){l.writeUInt32BE(y,t.length);for(var g=f.run(l,f.ipad1),v=g,w=1;w<r;w++){v=f.run(v,f.ipad2);for(var M=0;M<b;M++)g[M]^=v[M]}g.copy(d,p),p+=b}return d}},function(e,t,r){var n=r(11).Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,f=0,c=6;c>=0;c-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>>a+c&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>>a+c&1}for(c=6;c>=0;c-=2){for(a=1;a<=25;a+=8)f<<=1,f|=t>>>a+c&1;for(a=1;a<=25;a+=8)f<<=1,f|=e>>>a+c&1}r[n+0]=i>>>0,r[n+1]=f>>>0},t.rip=function(e,t,r,n){for(var i=0,f=0,c=0;c<4;c++)for(var a=24;a>=0;a-=8)i<<=1,i|=t>>>a+c&1,i<<=1,i|=e>>>a+c&1;for(c=4;c<8;c++)for(a=24;a>=0;a-=8)f<<=1,f|=t>>>a+c&1,f<<=1,f|=e>>>a+c&1;r[n+0]=i>>>0,r[n+1]=f>>>0},t.pc1=function(e,t,r,n){for(var i=0,f=0,c=7;c>=5;c--){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>a+c&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+c&1}for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+c&1;for(c=1;c<=3;c++){for(a=0;a<=24;a+=8)f<<=1,f|=t>>a+c&1;for(a=0;a<=24;a+=8)f<<=1,f|=e>>a+c&1}for(a=0;a<=24;a+=8)f<<=1,f|=e>>a+c&1;r[n+0]=i>>>0,r[n+1]=f>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var f=0,c=0,a=n.length>>>1,o=0;o<a;o++)f<<=1,f|=e>>>n[o]&1;for(o=a;o<n.length;o++)c<<=1,c|=t>>>n[o]&1;r[i+0]=f>>>0,r[i+1]=c>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var f=23;f>=15;f-=4)n<<=6,n|=e>>>f&63;for(f=11;f>=3;f-=4)i|=e>>>f&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var f=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<f.length;r++)t<<=1,t|=e>>>f[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],f=0;f<t;f+=r)i.push(n.slice(f,f+r));return i.join(" ")}},function(e,t,r){"use strict";var n=r(44),i=r(9),f=r(320),c=r(237);function a(){this.tmp=new Array(2),this.keys=null}function o(e){c.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}i(o,c),e.exports=o,o.create=function(e){return new o(e)};var s=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];o.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=f.readUInt32BE(t,0),i=f.readUInt32BE(t,4);f.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var c=0;c<e.keys.length;c+=2){var a=s[c>>>1];r=f.r28shl(r,a),i=f.r28shl(i,a),f.pc2(r,i,e.keys,c)}},o.prototype._update=function(e,t,r,n){var i=this._desState,c=f.readUInt32BE(e,t),a=f.readUInt32BE(e,t+4);f.ip(c,a,i.tmp,0),c=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,c,a,i.tmp,0):this._decrypt(i,c,a,i.tmp,0),c=i.tmp[0],a=i.tmp[1],f.writeUInt32BE(r,c,n),f.writeUInt32BE(r,a,n+4)},o.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},o.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},o.prototype._encrypt=function(e,t,r,n,i){for(var c=t,a=r,o=0;o<e.keys.length;o+=2){var s=e.keys[o],d=e.keys[o+1];f.expand(a,e.tmp,0),s^=e.tmp[0],d^=e.tmp[1];var u=f.substitute(s,d),h=a;a=(c^f.permute(u))>>>0,c=h}f.rip(a,c,n,i)},o.prototype._decrypt=function(e,t,r,n,i){for(var c=r,a=t,o=e.keys.length-2;o>=0;o-=2){var s=e.keys[o],d=e.keys[o+1];f.expand(c,e.tmp,0),s^=e.tmp[0],d^=e.tmp[1];var u=f.substitute(s,d),h=c;c=(a^f.permute(u))>>>0,a=h}f.rip(c,a,n,i)}},function(e,t,r){var n=r(146),i=r(11).Buffer,f=r(323);function c(e){var t=e._cipher.encryptBlockRaw(e._prev);return f(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),f=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var o=c(e),s=f+16*a;e._cache.writeUInt32BE(o[0],s+0),e._cache.writeUInt32BE(o[1],s+4),e._cache.writeUInt32BE(o[2],s+8),e._cache.writeUInt32BE(o[3],s+12)}var d=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,d)}},function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},function(e){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(e,t,r){var n=r(166),i=r(11).Buffer,f=r(87),c=r(9),a=r(632),o=r(146),s=r(323);function d(e,t,r,c){f.call(this);var o=i.alloc(4,0);this._cipher=new n.AES(t);var d=this._cipher.encryptBlock(o);this._ghash=new a(d),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new a(r),f=t.length,c=f%16;n.update(t),c&&(c=16-c,n.update(i.alloc(c,0))),n.update(i.alloc(8,0));var o=8*f,d=i.alloc(8);d.writeUIntBE(o,0,8),n.update(d),e._finID=n.state;var u=i.from(e._finID);return s(u),u}(this,r,d),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=c,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}c(d,f),d.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},d.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=o(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},d.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},d.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},d.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=d},function(e,t,r){var n=r(166),i=r(11).Buffer,f=r(87);function c(e,t,r,c){f.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=c,this._mode=e}r(9)(c,f),c.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},c.prototype._final=function(){this._cipher.scrub()},e.exports=c},function(e,t,r){var n=r(116);e.exports=g,g.simpleSieve=m,g.fermatTest=y;var i=r(328),f=new i(24),c=new(r(329)),a=new i(1),o=new i(2),s=new i(5),d=(new i(16),new i(8),new i(10)),u=new i(3),h=(new i(7),new i(11)),l=new i(4),p=(new i(12),null);function b(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function m(e){for(var t=b(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function y(e){var t=i.mont(e);return 0===o.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function g(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(o),t.cmp(o)){if(!t.cmp(s))for(;r.mod(d).cmp(u);)r.iadd(l)}else for(;r.mod(f).cmp(h);)r.iadd(l);if(m(p=r.shrn(1))&&m(r)&&y(p)&&y(r)&&c.test(p)&&c.test(r))return r}}},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(636).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t,r){var n=r(637),i=r(142);function f(e){this.rand=e||new i.Rand}e.exports=f,f.create=function(e){return new f(e)},f.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},f.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},f.prototype.test=function(e,t,r){var i=e.bitLength(),f=n.mont(e),c=new n(1).toRed(f);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),o=0;!a.testn(o);o++);for(var s=e.shrn(o),d=a.toRed(f);t>0;t--){var u=this._randrange(new n(2),a);r&&r(u);var h=u.toRed(f).redPow(s);if(0!==h.cmp(c)&&0!==h.cmp(d)){for(var l=1;l<o;l++){if(0===(h=h.redSqr()).cmp(c))return!1;if(0===h.cmp(d))break}if(l===o)return!1}}return!0},f.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),f=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var c=e.subn(1),a=0;!c.testn(a);a++);for(var o=e.shrn(a),s=c.toRed(i);t>0;t--){var d=this._randrange(new n(2),c),u=e.gcd(d);if(0!==u.cmpn(1))return u;var h=d.toRed(i).redPow(o);if(0!==h.cmp(f)&&0!==h.cmp(s)){for(var l=1;l<a;l++){if(0===(h=h.redSqr()).cmp(f))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(s))break}if(l===a)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,r){"use strict";(function(t,n){var i;e.exports=k,k.ReadableState=S;r(103).EventEmitter;var f=function(e,t){return e.listeners(t).length},c=r(331),a=r(19).Buffer,o=t.Uint8Array||function(){};var s,d=r(643);s=d&&d.debuglog?d.debuglog("stream"):function(){};var u,h,l,p=r(644),b=r(332),m=r(333).getHighWaterMark,y=r(120).codes,g=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,M=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(9)(k,c);var O=b.errorOrDestroy,x=["error","close","destroy","pause","resume"];function S(e,t,n){i=i||r(121),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(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&&(u||(u=r(104).StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function k(e){if(i=i||r(121),!(this instanceof k))return new k(e);var t=this instanceof i;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function j(e,t,r,n,i){s("readableAddChunk",t);var f,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(s("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?E(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,c);else if(i||(f=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(c,t)),f)O(e,f);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)c.endEmitted?O(e,new M):P(e,c,t,!0);else if(c.ended)O(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?P(e,c,t,!1):T(e,c)):P(e,c,t,!1)}else n||(c.reading=!1,T(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function P(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&&E(e)),T(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=b.destroy,k.prototype._undestroy=b.undestroy,k.prototype._destroy=function(e,t){t(e)},k.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=a.from(e,t),t=""),r=!0),j(this,e,t,!1,r)},k.prototype.unshift=function(e){return j(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){u||(u=r(104).StringDecoder);var t=new u(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 A(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 E(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;s("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,B(e)}function T(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(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 _(e){s("readable nexttick read 0"),e.read(0)}function C(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function H(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;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(L,t,e))}function L(e,t){if(s("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 z(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){s("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 s("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return s("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&s("length less than watermark",i=!0),t.ended||t.reading?s("reading or ended",i=!1):i&&(s("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(n=e>0?H(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},k.prototype._read=function(e){O(this,new w("_read()"))},k.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,s("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?o:m;function a(t,n){s("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,s("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",l),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",m),r.removeListener("data",h),u=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function o(){s("onend"),e.end()}i.endEmitted?n.nextTick(c):r.once("end",c),e.on("unpipe",a);var d=function(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&f(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",d);var u=!1;function h(t){s("ondata");var n=e.write(t);s("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==z(i.pipes,e))&&!u&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function l(t){s("onerror",t),m(),e.removeListener("error",l),0===f(e,"error")&&O(e,t)}function p(){e.removeListener("finish",b),m()}function b(){s("onfinish"),e.removeListener("close",p),m()}function m(){s("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||(s("pipe resume"),r.resume()),e},k.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 f=0;f<i;f++)n[f].emit("unpipe",this,{hasUnpiped:!1});return this}var c=z(t.pipes,e);return-1===c||(t.pipes.splice(c,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=c.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,s("on readable",i.length,i.reading),i.length?E(this):i.reading||n.nextTick(_,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(N,this),r},k.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(N,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(C,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(s("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){(s("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 f=0;f<x.length;f++)e.on(x[f],this.emit.bind(this,x[f]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(646)),h(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=H,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===l&&(l=r(647)),l(k,e,t)})}).call(this,r(32),r(26))},function(e,t,r){e.exports=r(103).EventEmitter},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,f){var c=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(f?f(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){!f&&e?c._writableState?c._writableState.errorEmitted?t.nextTick(n,c):(c._writableState.errorEmitted=!0,t.nextTick(r,c,e)):t.nextTick(r,c,e):f?(t.nextTick(n,c),f(e)):t.nextTick(n,c)})),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(26))},function(e,t,r){"use strict";var n=r(120).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var f=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=f){if(!isFinite(f)||Math.floor(f)!==f||f<0)throw new n(i?r:"highWaterMark",f);return Math.floor(f)}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 f;e.exports=k,k.WritableState=S;var c={deprecate:r(230)},a=r(331),o=r(19).Buffer,s=t.Uint8Array||function(){};var d,u=r(332),h=r(333).getHighWaterMark,l=r(120).codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_METHOD_NOT_IMPLEMENTED,m=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,w=l.ERR_STREAM_WRITE_AFTER_END,M=l.ERR_UNKNOWN_ENCODING,O=u.errorOrDestroy;function x(){}function S(e,t,c){f=f||r(121),e=e||{},"boolean"!=typeof c&&(c=t instanceof f),this.objectMode=!!e.objectMode,c&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",c),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,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,f=r.writecb;if("function"!=typeof f)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,f){--t.pendingcb,r?(n.nextTick(f,i),n.nextTick(T,e,t),e._writableState.errorEmitted=!0,O(e,i)):(f(i),e._writableState.errorEmitted=!0,O(e,i),T(e,t))}(e,r,i,t,f);else{var c=E(r)||e.destroyed;c||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),i?n.nextTick(P,e,r,c,f):P(e,r,c,f)}}(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 k(e){var t=this instanceof(f=f||r(121));if(!t&&!d.call(k,this))return new k(e);this._writableState=new S(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)),a.call(this)}function j(e,t,r,n,i,f,c){t.writelen=n,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,f,t.onwrite),t.sync=!1}function P(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,f=new Array(n),c=t.corkedRequestsFree;c.entry=r;for(var a=0,o=!0;r;)f[a]=r,r.isBuf||(o=!1),r=r.next,a+=1;f.allBuffers=o,j(e,t,!0,t.length,f,"",c.finish),t.pendingcb++,t.lastBufferedRequest=null,c.next?(t.corkedRequestsFree=c.next,c.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var s=r.chunk,d=r.encoding,u=r.callback;if(j(e,t,!1,t.objectMode?1:s.length,s,d,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&O(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)}))}function T(e,t){var r=E(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(I,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(9)(k,a),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===k&&(e&&e._writableState instanceof S)}})):d=function(e){return e instanceof this},k.prototype.pipe=function(){O(this,new y)},k.prototype.write=function(e,t,r){var i,f=this._writableState,c=!1,a=!f.objectMode&&(i=e,o.isBuffer(i)||i instanceof s);return a&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=x),f.ending?function(e,t){var r=new w;O(e,r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,i){var f;return null===r?f=new v:"string"==typeof r||t.objectMode||(f=new p("chunk",["string","Buffer"],r)),!f||(O(e,f),n.nextTick(i,f),!1)}(this,f,e,r))&&(f.pendingcb++,c=function(e,t,r,n,i,f){if(!r){var c=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==c&&(r=!0,i="buffer",n=c)}var a=t.objectMode?1:n.length;t.length+=a;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:f,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,a,n,i,f);return s}(this,f,a,e,t,r)),c},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},k.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 M(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new b("_write()"))},k.prototype._writev=null,k.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,T(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this,r(32),r(26))},function(e,t,r){"use strict";e.exports=d;var n=r(120).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,f=n.ERR_MULTIPLE_CALLBACK,c=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,o=r(121);function s(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new f);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 d(e){if(!(this instanceof d))return new d(e);o.call(this,e),this._transformState={afterTransform:s.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",u)}function u(){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 a;if(e._transformState.transforming)throw new c;return e.push(null)}r(9)(d,o),d.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},d.prototype._transform=function(e,t,r){r(new i("_transform()"))},d.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)}},d.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))},d.prototype._destroy=function(e,t){o.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";var n=t;n.base=r(168),n.short=r(653),n.mont=r(654),n.edwards=r(655)},function(e,t,r){"use strict";const n=t;n.bignum=r(338),n.define=r(665).define,n.base=r(668),n.constants=r(669),n.decoders=r(341),n.encoders=r(339)},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(664).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t,r){"use strict";const n=t;n.der=r(340),n.pem=r(666)},function(e,t,r){"use strict";const n=r(9),i=r(244).Buffer,f=r(245),c=r(247);function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new o,this.tree._init(e.body)}function o(e){f.call(this,"der",e)}function s(e){return e<10?"0"+e:e}e.exports=a,a.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(o,f),o.prototype._encodeComposite=function(e,t,r,n){const f=function(e,t,r,n){let i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(c.tagByName.hasOwnProperty(e))i=c.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=c.tagClassByName[r||"universal"]<<6,i}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=f,e[1]=n.length,this._createEncoderBuffer([e,n])}let a=1;for(let e=n.length;e>=256;e>>=8)a++;const o=i.alloc(2+a);o[0]=f,o[1]=128|a;for(let e=1+a,t=n.length;t>0;e--,t>>=8)o[e]=255&t;return this._createEncoderBuffer([o,n])},o.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},o.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let r=e[t];for(n++;r>=128;r>>=7)n++}const f=i.alloc(n);let c=f.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(f[c--]=127&r;(r>>=7)>0;)f[c--]=128|127&r}return this._createEncoderBuffer(f)},o.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[s(n.getUTCFullYear()),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[s(n.getUTCFullYear()%100),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},o.prototype._encodeNull=function(){return this._createEncoderBuffer("")},o.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},o.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},o.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},o.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const f=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),f.length!==n.defaultBuffer.length)return!1;for(i=0;i<f.length;i++)if(f[i]!==n.defaultBuffer[i])return!1;return!0}},function(e,t,r){"use strict";const n=t;n.der=r(342),n.pem=r(667)},function(e,t,r){"use strict";const n=r(9),i=r(338),f=r(147).DecoderBuffer,c=r(245),a=r(247);function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){c.call(this,"der",e)}function d(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function u(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t<i;t++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=o,o.prototype.decode=function(e,t){return f.isDecoderBuffer(e)||(e=new f(e,t)),this.tree._decode(e,t)},n(s,c),s.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=d(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},s.prototype._decodeTag=function(e,t,r){const n=d(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=u(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');const f=e.save(),c=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(c)?c:(i=e.offset-f.offset,e.restore(f),e.skip(i,'Failed to match body of: "'+t+'"'))},s.prototype._skipUntilEnd=function(e,t){for(;;){const r=d(e,t);if(e.isError(r))return r;const n=u(e,r.primitive,t);if(e.isError(n))return n;let i;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},s.prototype._decodeList=function(e,t,r,n){const i=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const f=r.decode(e,"der",n);if(e.isError(f)&&t)break;i.push(f)}return i},s.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},s.prototype._decodeObjid=function(e,t,r){let n;const i=[];let f=0,c=0;for(;!e.isEmpty();)c=e.readUInt8(),f<<=7,f|=127&c,0==(128&c)&&(i.push(f),f=0);128&c&&i.push(f);const a=i[0]/40|0,o=i[0]%40;if(n=r?i:[a,o].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},s.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,f,c,a,o;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),f=0|r.slice(6,8),c=0|r.slice(8,10),a=0|r.slice(10,12),o=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),f=0|r.slice(4,6),c=0|r.slice(6,8),a=0|r.slice(8,10),o=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,f,c,a,o,0)},s.prototype._decodeNull=function(){return null},s.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},s.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(e,t,r){var n=r(144),i=r(11).Buffer;function f(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,c=i.alloc(0),a=0;c.length<t;)r=f(a++),c=i.concat([c,n("sha1").update(e).update(r).digest()]);return c.slice(0,t)}},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},function(e,t,r){var n=r(248),i=r(11).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},function(e,t,r){(function(t,n){const i=r(228);function f(e,t,r,n,i,f,c){let d;for(s(e,t+64*(2*n-1),i,0,64),d=0;d<2*n;d++)o(e,64*d,i,0,64),a(i,f,c),s(i,0,e,r+64*d,64);for(d=0;d<n;d++)s(e,r+2*d*64,e,t+64*d,64);for(d=0;d<n;d++)s(e,r+64*(2*d+1),e,t+64*(d+n),64)}function c(e,t){return e<<t|e>>>32-t}function a(e,t,r){let n;for(n=0;n<16;n++)t[n]=(255&e[4*n+0])<<0,t[n]|=(255&e[4*n+1])<<8,t[n]|=(255&e[4*n+2])<<16,t[n]|=(255&e[4*n+3])<<24;for(s(t,0,r,0,16),n=8;n>0;n-=2)r[4]^=c(r[0]+r[12],7),r[8]^=c(r[4]+r[0],9),r[12]^=c(r[8]+r[4],13),r[0]^=c(r[12]+r[8],18),r[9]^=c(r[5]+r[1],7),r[13]^=c(r[9]+r[5],9),r[1]^=c(r[13]+r[9],13),r[5]^=c(r[1]+r[13],18),r[14]^=c(r[10]+r[6],7),r[2]^=c(r[14]+r[10],9),r[6]^=c(r[2]+r[14],13),r[10]^=c(r[6]+r[2],18),r[3]^=c(r[15]+r[11],7),r[7]^=c(r[3]+r[15],9),r[11]^=c(r[7]+r[3],13),r[15]^=c(r[11]+r[7],18),r[1]^=c(r[0]+r[3],7),r[2]^=c(r[1]+r[0],9),r[3]^=c(r[2]+r[1],13),r[0]^=c(r[3]+r[2],18),r[6]^=c(r[5]+r[4],7),r[7]^=c(r[6]+r[5],9),r[4]^=c(r[7]+r[6],13),r[5]^=c(r[4]+r[7],18),r[11]^=c(r[10]+r[9],7),r[8]^=c(r[11]+r[10],9),r[9]^=c(r[8]+r[11],13),r[10]^=c(r[9]+r[8],18),r[12]^=c(r[15]+r[14],7),r[13]^=c(r[12]+r[15],9),r[14]^=c(r[13]+r[12],13),r[15]^=c(r[14]+r[13],18);for(n=0;n<16;++n)t[n]=r[n]+t[n];for(n=0;n<16;n++){let r=4*n;e[r+0]=t[n]>>0&255,e[r+1]=t[n]>>8&255,e[r+2]=t[n]>>16&255,e[r+3]=t[n]>>24&255}}function o(e,t,r,n,i){for(let f=0;f<i;f++)r[n+f]^=e[t+f]}function s(e,r,n,i,f){if(t.isBuffer(e)&&t.isBuffer(n))e.copy(n,i,r,r+f);else for(;f--;)n[i++]=e[r++]}e.exports={checkAndInit:function(e,r,n,f,c,a,o){if(0===n||0!=(n&n-1))throw Error("N must be > 0 and a power of 2");if(n>2147483647/128/f)throw Error("Parameter N is too large");if(f>2147483647/128/c)throw Error("Parameter r is too large");let s,d=t.alloc(256*f),u=t.alloc(128*f*n),h=new Int32Array(16),l=new Int32Array(16),p=t.alloc(64),b=i.pbkdf2Sync(e,r,1,128*c*f,"sha256");if(o){let e=c*n*2,t=0;s=function(){++t,t%1e3==0&&o({current:t,total:e,percent:t/e*100})}}return{XY:d,V:u,B32:h,x:l,_X:p,B:b,tickCallback:s}},smix:async function(e,t,r,i,c,a,s,d,u,h,l){l=l||5e3;let p,b=128*r;for(e.copy(a,0,t,t+b),p=0;p<i;p++)a.copy(c,p*b,0,0+b),p%l==0&&await new Promise(e=>n(e)),f(a,0,b,r,s,d,u),h&&h();for(p=0;p<i;p++){let e=0+64*(2*r-1);o(c,(a.readUInt32LE(e)&i-1)*b,a,0,b),p%l==0&&await new Promise(e=>n(e)),f(a,0,b,r,s,d,u),h&&h()}a.copy(e,t,0,0+b)},smixSync:function(e,t,r,n,i,c,a,s,d,u){let h,l=128*r;for(e.copy(c,0,t,t+l),h=0;h<n;h++)c.copy(i,h*l,0,0+l),f(c,0,l,r,a,s,d),u&&u();for(h=0;h<n;h++){let e=0+64*(2*r-1);o(i,(c.readUInt32LE(e)&n-1)*l,c,0,l),f(c,0,l,r,a,s,d),u&&u()}c.copy(e,t,0,0+l)}}}).call(this,r(19).Buffer,r(310).setImmediate)},function(e,t,r){(function(t){function r(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){var r;if(e instanceof Uint8Array)r=e;else if(e instanceof t)r=new Uint8Array(e);else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");r=new Uint8Array(t.from(e,"utf8"))}return r},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,t,n){for(var i="\n"+e+" = ",f=0;f<t.length;f+=2){if(32===n)i+=r(t[f]).toUpperCase(),i+=" ",i+=r(t[f+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=r(t[f+1]).toUpperCase(),i+=r(t[f]).toUpperCase()}f%6==4?i+="\n"+new Array(e.length+4).join(" "):f<t.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){for(var n=(new Date).getTime(),i=new Uint8Array(t),f=0;f<t;f++)i[f]=f%256;var c=(new Date).getTime();for(console.log("Generated random input in "+(c-n)+"ms"),n=c,f=0;f<r;f++){var a=e(i),o=(new Date).getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+a.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}}}).call(this,r(19).Buffer)},function(e,t){function r(e){if(!e)return new Uint8Array;for(var t=[],r=e.startsWith("0x")?2:0,n=e.length;r<n;r+=2)t.push(parseInt(e.substr(r,2),16));return new Uint8Array(t)}e.exports={stringToSeed:function(e){if(e.match(/^0x[0-9a-fA-F]{64}$/))return r(e);var t=new Uint8Array(32);t.fill(32);for(var n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},stringToBytes:function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},hexToBytes:r,bytesToHex:function(e){if(!e)return"";for(var t="",r=0;r<e.length;r++){var n=(255&e[r]).toString(16);t+=n=1===n.length?"0"+n:n}return t.toLowerCase()},toLEHex:function(e,t){let r=("00".repeat(t)+e.toString(16)).slice(2*-t);for(var n="",i=0;i<r.length;i+=2)n=r.substr(i,2)+n;return n},leHexToNumber:function(e){for(var t="",r=e.startsWith("0x")?2:0;r<e.length;r+=2)t=e.substr(r,2)+t;return Number.parseInt(t,16)},toLE:function(e,t){let r=!1;e<0&&(e=-e-1,r=!0);let n=new Uint8Array(t);for(var i=0;i<t;++i)n[i]=e%256,r&&(n[i]=255&~n[i]),e/=256;return n},leToNumber:function(e){let t=0,r=1;return e.forEach(e=>{t+=e*r,r*=256}),t},leToSigned:function(e){let t=e.slice(),r=1,n=0;128==(128&t[t.length-1])&&(t=t.map(e=>255&~e),n=1,r=-1);let i=1;return t.forEach(e=>{n+=e*i,i*=256}),n*r},injectChunkUtils:function(){String.prototype.chunks=function(e){for(var t=[],r=this.length/e,n=0;n<r;++n)t.push(this.substr(n*e,e));return t},String.prototype.mapChunks=function(e,t){for(var r=[],n=this.length/e.reduce((e,t)=>e+t,0),i=0,f=0;f<n;++f)r.push(t(e.map(e=>{let t=this.substr(i,e);return i+=e,t})));return r},Uint8Array.prototype.mapChunks=function(e,t){for(var r=[],n=this.length/e.reduce((e,t)=>e+t,0),i=0,f=0;f<n;++f)r.push(t(e.map(e=>(i+=e,this.slice(i-e,i)))));return r}},siPrefix:function(e){switch(e){case-24:return"y";case-21:return"z";case-18:return"a";case-15:return"f";case-12:return"p";case-9:return"n";case-6:return"µ";case-3:return"m";case 0:return"";case 3:return"k";case 6:return"M";case 9:return"G";case 12:return"T";case 15:return"P";case 18:return"E";case 21:return"Z";case 24:return"Y"}}}},function(e,t,r){t.UINT32=r(691),t.UINT64=r(692)},function(e,t,r){"use strict";function n(e){return"object"==typeof e}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(698),i=r.n(n);function f(e){return i.a.isBN(e)}},function(e,t,r){"use strict";function n(e){return e.toString().padStart(2,"0")}function i(e){return`${e.getFullYear().toString()}-${n(e.getMonth()+1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}:${n(e.getSeconds())}`}r.d(t,"a",(function(){return i}))},function(e,t,r){"use strict";const n=(e,t)=>{if("string"!=typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);if(0===(e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join("-"):e.trim()).length)return"";if(1===e.length)return t.pascalCase?e.toUpperCase():e.toLowerCase();return e!==e.toLowerCase()&&(e=(e=>{let t=!1,r=!1,n=!1;for(let i=0;i<e.length;i++){const f=e[i];t&&/[a-zA-Z]/.test(f)&&f.toUpperCase()===f?(e=e.slice(0,i)+"-"+e.slice(i),t=!1,n=r,r=!0,i++):r&&n&&/[a-zA-Z]/.test(f)&&f.toLowerCase()===f?(e=e.slice(0,i-1)+"-"+e.slice(i-1),n=r,r=!1,t=!0):(t=f.toLowerCase()===f&&f.toUpperCase()!==f,n=r,r=f.toUpperCase()===f&&f.toLowerCase()!==f)}return e})(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(e,t)=>t.toUpperCase()).replace(/\d+(\w|$)/g,e=>e.toUpperCase()),r=e,t.pascalCase?r.charAt(0).toUpperCase()+r.slice(1):r;var r};e.exports=n,e.exports.default=n},function(e,t,r){const n=r(570),i=r(571);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/wasm-crypto-asmjs",version:"4.0.2"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/wasm-crypto-wasm",version:"4.0.2"}},function(e,t,r){"use strict";var n=t;n.version=r(573).version,n.utils=r(51),n.rand=r(142),n.curve=r(293),n.curves=r(227),n.ec=r(586),n.eddsa=r(589)},function(e,t,r){const n=r(594);n.async=r(682),e.exports=n},function(e,t,r){"use strict";(function(e){function n(t){return e.isBuffer(t)}r.d(t,"a",(function(){return n}))}).call(this,r(19).Buffer)},function(e,t,r){(function(t){const n=r(684),{blake2b:i}=r(685),{toLE:f,leToNumber:c,stringToBytes:a}=r(349),{AccountIndex:o,AccountId:s}=r(688);let d=42;const u=[0,1,42,43,68,69],h=a("SS58PRE");e.exports={ss58Decode:function(e,t){let r;try{r=n.decode(e)}catch(e){return null}let f=r[0];if(-1===u.indexOf(f))return null;if(r.length<3)return null;let a,d=r.length<=3?1:r.length<=5?2:r.length<=9?4:r.length<=17?8:32,l=r.length-1-d,p=r.slice(1,1+d);r.slice(1+r.length),32===d&&(a=p);let b=d<32?new o(c(p)):new s(p);if(r[0]%1&&!a&&!t)return null;let m=i(new Uint8Array([...h,...r[0]%1?a||t(b):r.slice(0,1+d)]));for(var y=0;y<l;++y)if(m[y]!==r[1+d+y])return null;return b},ss58Encode:function(e,r=d,c=null,a=null,l){let p;if(-1===u.indexOf(r))throw new Error("Unknown ss58 address type",r);if("number"==typeof e||e instanceof o){let t=e<256?1:e<65536?2:e<1?4:8;if(-1===[1,2,4,8].indexOf(a=a||t))throw new Error("Invalid length");if(a=Math.max(t,a),c&&"number"!=typeof c)throw new Error("Invalid checksum length");switch(a){case 1:c=1;break;case 2:c=[1,2].indexOf(c)+1||1;break;case 4:c=[1,2,3,4].indexOf(c)+1||1;break;case 8:c=[1,2,3,4,5,6,7,8].indexOf(c)+1||1}p=f(e,a)}else{if(!(e instanceof s||e instanceof Uint8Array)||32!==e.length)throw new Error("Unknown item to encode as ss58. Passing back.",e);c=2,p=e,l=e}let b=i(new Uint8Array([...h,...1&r?l:new Uint8Array([r,...p])])),m=new Uint8Array([r,...p,...b.slice(0,c)]);return n.encode(t.from(m))},setNetworkDefault:function(e){d=e}}}).call(this,r(19).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/metadata",version:"4.17.1"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={name:"@polkadot/rpc-provider",version:"4.17.1"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(45);const i=void 0===n.a.TextEncoder?class{encode(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}}:n.a.TextEncoder},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(45);const i=void 0===n.a.TextDecoder?class{constructor(e){}decode(e){return e.reduce((e,t)=>e+String.fromCharCode(t),"")}}:n.a.TextDecoder},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(251);const i=void 0===n.a.TextEncoder?class{encode(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}}:n.a.TextEncoder},,,,,,,,,,,,,,,function(e,t,r){"use strict";r(382);var n,i=(n=r(554))&&n.__esModule?n:{default:n};i.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),i.default._babelPolyfill=!0},function(e,t,r){"use strict";r(383),r(526),r(528),r(531),r(533),r(535),r(537),r(539),r(541),r(543),r(545),r(547),r(549),r(553)},function(e,t,r){r(384),r(387),r(388),r(389),r(390),r(391),r(392),r(393),r(394),r(395),r(396),r(397),r(398),r(399),r(400),r(401),r(402),r(403),r(404),r(405),r(406),r(407),r(408),r(409),r(410),r(411),r(412),r(413),r(414),r(415),r(416),r(417),r(418),r(419),r(420),r(421),r(422),r(423),r(424),r(425),r(426),r(427),r(428),r(430),r(431),r(432),r(433),r(434),r(435),r(436),r(437),r(438),r(439),r(440),r(441),r(442),r(443),r(444),r(445),r(446),r(447),r(448),r(449),r(450),r(451),r(452),r(453),r(454),r(455),r(456),r(457),r(458),r(459),r(460),r(461),r(462),r(463),r(465),r(466),r(468),r(469),r(470),r(471),r(472),r(473),r(474),r(476),r(477),r(478),r(479),r(480),r(481),r(482),r(483),r(484),r(485),r(486),r(487),r(488),r(218),r(489),r(278),r(490),r(279),r(491),r(492),r(493),r(494),r(280),r(497),r(498),r(499),r(500),r(501),r(502),r(503),r(504),r(505),r(506),r(507),r(508),r(509),r(510),r(511),r(512),r(513),r(514),r(515),r(516),r(517),r(518),r(519),r(520),r(521),r(522),r(523),r(524),r(525),e.exports=r(28)},function(e,t,r){"use strict";var n=r(13),i=r(48),f=r(30),c=r(3),a=r(42),o=r(86).KEY,s=r(14),d=r(152),u=r(110),h=r(94),l=r(21),p=r(199),b=r(259),m=r(386),y=r(155),g=r(15),v=r(16),w=r(35),M=r(50),O=r(85),x=r(93),S=r(98),k=r(262),j=r(62),P=r(154),A=r(31),E=r(96),I=j.f,T=A.f,R=k.f,N=n.Symbol,_=n.JSON,C=_&&_.stringify,B=l("_hidden"),H=l("toPrimitive"),D={}.propertyIsEnumerable,L=d("symbol-registry"),z=d("symbols"),V=d("op-symbols"),q=Object.prototype,U="function"==typeof N&&!!P.f,F=n.QObject,W=!F||!F.prototype||!F.prototype.findChild,K=f&&s((function(){return 7!=S(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=I(q,t);n&&delete q[t],T(e,t,r),n&&e!==q&&T(q,t,n)}:T,X=function(e){var t=z[e]=S(N.prototype);return t._k=e,t},Z=U&&"symbol"==typeof N.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof N},G=function(e,t,r){return e===q&&G(V,t,r),g(e),t=O(t,!0),g(r),i(z,t)?(r.enumerable?(i(e,B)&&e[B][t]&&(e[B][t]=!1),r=S(r,{enumerable:x(0,!1)})):(i(e,B)||T(e,B,x(1,{})),e[B][t]=!0),K(e,t,r)):T(e,t,r)},Y=function(e,t){g(e);for(var r,n=m(t=M(t)),i=0,f=n.length;f>i;)G(e,r=n[i++],t[r]);return e},J=function(e){var t=D.call(this,e=O(e,!0));return!(this===q&&i(z,e)&&!i(V,e))&&(!(t||!i(this,e)||!i(z,e)||i(this,B)&&this[B][e])||t)},Q=function(e,t){if(e=M(e),t=O(t,!0),e!==q||!i(z,t)||i(V,t)){var r=I(e,t);return!r||!i(z,t)||i(e,B)&&e[B][t]||(r.enumerable=!0),r}},$=function(e){for(var t,r=R(M(e)),n=[],f=0;r.length>f;)i(z,t=r[f++])||t==B||t==o||n.push(t);return n},ee=function(e){for(var t,r=e===q,n=R(r?V:M(e)),f=[],c=0;n.length>c;)!i(z,t=n[c++])||r&&!i(q,t)||f.push(z[t]);return f};U||(a((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(r){this===q&&t.call(V,r),i(this,B)&&i(this[B],e)&&(this[B][e]=!1),K(this,e,x(1,r))};return f&&W&&K(q,e,{configurable:!0,set:t}),X(e)}).prototype,"toString",(function(){return this._k})),j.f=Q,A.f=G,r(99).f=k.f=$,r(139).f=J,P.f=ee,f&&!r(95)&&a(q,"propertyIsEnumerable",J,!0),p.f=function(e){return X(l(e))}),c(c.G+c.W+c.F*!U,{Symbol:N});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)l(te[re++]);for(var ne=E(l.store),ie=0;ne.length>ie;)b(ne[ie++]);c(c.S+c.F*!U,"Symbol",{for:function(e){return i(L,e+="")?L[e]:L[e]=N(e)},keyFor:function(e){if(!Z(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),c(c.S+c.F*!U,"Object",{create:function(e,t){return void 0===t?S(e):Y(S(e),t)},defineProperty:G,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:$,getOwnPropertySymbols:ee});var fe=s((function(){P.f(1)}));c(c.S+c.F*fe,"Object",{getOwnPropertySymbols:function(e){return P.f(w(e))}}),_&&c(c.S+c.F*(!U||s((function(){var e=N();return"[null]"!=C([e])||"{}"!=C({a:e})||"{}"!=C(Object(e))}))),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(v(t)||void 0!==e)&&!Z(e))return y(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Z(t))return t}),n[1]=t,C.apply(_,n)}}),N.prototype[H]||r(49)(N.prototype,H,N.prototype.valueOf),u(N,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(e,t,r){e.exports=r(152)("native-function-to-string",Function.toString)},function(e,t,r){var n=r(96),i=r(154),f=r(139);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var c,a=r(e),o=f.f,s=0;a.length>s;)o.call(e,c=a[s++])&&t.push(c);return t}},function(e,t,r){var n=r(3);n(n.S,"Object",{create:r(98)})},function(e,t,r){var n=r(3);n(n.S+n.F*!r(30),"Object",{defineProperty:r(31).f})},function(e,t,r){var n=r(3);n(n.S+n.F*!r(30),"Object",{defineProperties:r(261)})},function(e,t,r){var n=r(50),i=r(62).f;r(63)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(n(e),t)}}))},function(e,t,r){var n=r(35),i=r(100);r(63)("getPrototypeOf",(function(){return function(e){return i(n(e))}}))},function(e,t,r){var n=r(35),i=r(96);r(63)("keys",(function(){return function(e){return i(n(e))}}))},function(e,t,r){r(63)("getOwnPropertyNames",(function(){return r(262).f}))},function(e,t,r){var n=r(16),i=r(86).onFreeze;r(63)("freeze",(function(e){return function(t){return e&&n(t)?e(i(t)):t}}))},function(e,t,r){var n=r(16),i=r(86).onFreeze;r(63)("seal",(function(e){return function(t){return e&&n(t)?e(i(t)):t}}))},function(e,t,r){var n=r(16),i=r(86).onFreeze;r(63)("preventExtensions",(function(e){return function(t){return e&&n(t)?e(i(t)):t}}))},function(e,t,r){var n=r(16);r(63)("isFrozen",(function(e){return function(t){return!n(t)||!!e&&e(t)}}))},function(e,t,r){var n=r(16);r(63)("isSealed",(function(e){return function(t){return!n(t)||!!e&&e(t)}}))},function(e,t,r){var n=r(16);r(63)("isExtensible",(function(e){return function(t){return!!n(t)&&(!e||e(t))}}))},function(e,t,r){var n=r(3);n(n.S+n.F,"Object",{assign:r(263)})},function(e,t,r){var n=r(3);n(n.S,"Object",{is:r(264)})},function(e,t,r){var n=r(3);n(n.S,"Object",{setPrototypeOf:r(203).set})},function(e,t,r){"use strict";var n=r(140),i={};i[r(21)("toStringTag")]="z",i+""!="[object z]"&&r(42)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},function(e,t,r){var n=r(3);n(n.P,"Function",{bind:r(265)})},function(e,t,r){var n=r(31).f,i=Function.prototype,f=/^\s*function ([^ (]*)/;"name"in i||r(30)&&n(i,"name",{configurable:!0,get:function(){try{return(""+this).match(f)[1]}catch(e){return""}}})},function(e,t,r){"use strict";var n=r(16),i=r(100),f=r(21)("hasInstance"),c=Function.prototype;f in c||r(31).f(c,f,{value:function(e){if("function"!=typeof this||!n(e))return!1;if(!n(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,r){var n=r(3),i=r(267);n(n.G+n.F*(parseInt!=i),{parseInt:i})},function(e,t,r){var n=r(3),i=r(268);n(n.G+n.F*(parseFloat!=i),{parseFloat:i})},function(e,t,r){"use strict";var n=r(13),i=r(48),f=r(75),c=r(205),a=r(85),o=r(14),s=r(99).f,d=r(62).f,u=r(31).f,h=r(111).trim,l=n.Number,p=l,b=l.prototype,m="Number"==f(r(98)(b)),y="trim"in String.prototype,g=function(e){var t=a(e,!1);if("string"==typeof t&&t.length>2){var r,n,i,f=(t=y?t.trim():h(t,3)).charCodeAt(0);if(43===f||45===f){if(88===(r=t.charCodeAt(2))||120===r)return NaN}else if(48===f){switch(t.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+t}for(var c,o=t.slice(2),s=0,d=o.length;s<d;s++)if((c=o.charCodeAt(s))<48||c>i)return NaN;return parseInt(o,n)}}return+t};if(!l(" 0o1")||!l("0b1")||l("+0x1")){l=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof l&&(m?o((function(){b.valueOf.call(r)})):"Number"!=f(r))?c(new p(g(t)),r,l):g(t)};for(var v,w=r(30)?s(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;w.length>M;M++)i(p,v=w[M])&&!i(l,v)&&u(l,v,d(p,v));l.prototype=b,b.constructor=l,r(42)(n,"Number",l)}},function(e,t,r){"use strict";var n=r(3),i=r(61),f=r(269),c=r(206),a=1..toFixed,o=Math.floor,s=[0,0,0,0,0,0],d="Number.toFixed: incorrect invocation!",u=function(e,t){for(var r=-1,n=t;++r<6;)n+=e*s[r],s[r]=n%1e7,n=o(n/1e7)},h=function(e){for(var t=6,r=0;--t>=0;)r+=s[t],s[t]=o(r/e),r=r%e*1e7},l=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var r=String(s[e]);t=""===t?r:t+c.call("0",7-r.length)+r}return t},p=function(e,t,r){return 0===t?r:t%2==1?p(e,t-1,r*e):p(e*e,t/2,r)};n(n.P+n.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(14)((function(){a.call({})}))),"Number",{toFixed:function(e){var t,r,n,a,o=f(this,d),s=i(e),b="",m="0";if(s<0||s>20)throw RangeError(d);if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(b="-",o=-o),o>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(o*p(2,69,1))-69)<0?o*p(2,-t,1):o/p(2,t,1),r*=4503599627370496,(t=52-t)>0){for(u(0,r),n=s;n>=7;)u(1e7,0),n-=7;for(u(p(10,n,1),0),n=t-1;n>=23;)h(1<<23),n-=23;h(1<<n),u(1,1),h(2),m=l()}else u(0,r),u(1<<-t,0),m=l()+c.call("0",s);return m=s>0?b+((a=m.length)<=s?"0."+c.call("0",s-a)+m:m.slice(0,a-s)+"."+m.slice(a-s)):b+m}})},function(e,t,r){"use strict";var n=r(3),i=r(14),f=r(269),c=1..toPrecision;n(n.P+n.F*(i((function(){return"1"!==c.call(1,void 0)}))||!i((function(){c.call({})}))),"Number",{toPrecision:function(e){var t=f(this,"Number#toPrecision: incorrect invocation!");return void 0===e?c.call(t):c.call(t,e)}})},function(e,t,r){var n=r(3);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,r){var n=r(3),i=r(13).isFinite;n(n.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,r){var n=r(3);n(n.S,"Number",{isInteger:r(270)})},function(e,t,r){var n=r(3);n(n.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,r){var n=r(3),i=r(270),f=Math.abs;n(n.S,"Number",{isSafeInteger:function(e){return i(e)&&f(e)<=9007199254740991}})},function(e,t,r){var n=r(3);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,r){var n=r(3);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,r){var n=r(3),i=r(268);n(n.S+n.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,r){var n=r(3),i=r(267);n(n.S+n.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,r){var n=r(3),i=r(271),f=Math.sqrt,c=Math.acosh;n(n.S+n.F*!(c&&710==Math.floor(c(Number.MAX_VALUE))&&c(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+f(e-1)*f(e+1))}})},function(e,t,r){var n=r(3),i=Math.asinh;n(n.S+n.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,r){var n=r(3),i=Math.atanh;n(n.S+n.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,r){var n=r(3),i=r(207);n(n.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,r){var n=r(3);n(n.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,r){var n=r(3),i=Math.exp;n(n.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,r){var n=r(3),i=r(208);n(n.S+n.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,r){var n=r(3);n(n.S,"Math",{fround:r(429)})},function(e,t,r){var n=r(207),i=Math.pow,f=i(2,-52),c=i(2,-23),a=i(2,127)*(2-c),o=i(2,-126);e.exports=Math.fround||function(e){var t,r,i=Math.abs(e),s=n(e);return i<o?s*(i/o/c+1/f-1/f)*o*c:(r=(t=(1+c/f)*i)-(t-i))>a||r!=r?s*(1/0):s*r}},function(e,t,r){var n=r(3),i=Math.abs;n(n.S,"Math",{hypot:function(e,t){for(var r,n,f=0,c=0,a=arguments.length,o=0;c<a;)o<(r=i(arguments[c++]))?(f=f*(n=o/r)*n+1,o=r):f+=r>0?(n=r/o)*n:r;return o===1/0?1/0:o*Math.sqrt(f)}})},function(e,t,r){var n=r(3),i=Math.imul;n(n.S+n.F*r(14)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var r=+e,n=+t,i=65535&r,f=65535&n;return 0|i*f+((65535&r>>>16)*f+i*(65535&n>>>16)<<16>>>0)}})},function(e,t,r){var n=r(3);n(n.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,r){var n=r(3);n(n.S,"Math",{log1p:r(271)})},function(e,t,r){var n=r(3);n(n.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,r){var n=r(3);n(n.S,"Math",{sign:r(207)})},function(e,t,r){var n=r(3),i=r(208),f=Math.exp;n(n.S+n.F*r(14)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(f(e-1)-f(-e-1))*(Math.E/2)}})},function(e,t,r){var n=r(3),i=r(208),f=Math.exp;n(n.S,"Math",{tanh:function(e){var t=i(e=+e),r=i(-e);return t==1/0?1:r==1/0?-1:(t-r)/(f(e)+f(-e))}})},function(e,t,r){var n=r(3);n(n.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,r){var n=r(3),i=r(97),f=String.fromCharCode,c=String.fromCodePoint;n(n.S+n.F*(!!c&&1!=c.length),"String",{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,c=0;n>c;){if(t=+arguments[c++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?f(t):f(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}})},function(e,t,r){var n=r(3),i=r(50),f=r(25);n(n.S,"String",{raw:function(e){for(var t=i(e.raw),r=f(t.length),n=arguments.length,c=[],a=0;r>a;)c.push(String(t[a++])),a<n&&c.push(String(arguments[a]));return c.join("")}})},function(e,t,r){"use strict";r(111)("trim",(function(e){return function(){return e(this,3)}}))},function(e,t,r){"use strict";var n=r(209)(!0);r(210)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})}))},function(e,t,r){"use strict";var n=r(3),i=r(209)(!1);n(n.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,r){"use strict";var n=r(3),i=r(25),f=r(211),c="".endsWith;n(n.P+n.F*r(213)("endsWith"),"String",{endsWith:function(e){var t=f(this,e,"endsWith"),r=arguments.length>1?arguments[1]:void 0,n=i(t.length),a=void 0===r?n:Math.min(i(r),n),o=String(e);return c?c.call(t,o,a):t.slice(a-o.length,a)===o}})},function(e,t,r){"use strict";var n=r(3),i=r(211);n(n.P+n.F*r(213)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(3);n(n.P,"String",{repeat:r(206)})},function(e,t,r){"use strict";var n=r(3),i=r(25),f=r(211),c="".startsWith;n(n.P+n.F*r(213)("startsWith"),"String",{startsWith:function(e){var t=f(this,e,"startsWith"),r=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return c?c.call(t,n,r):t.slice(r,r+n.length)===n}})},function(e,t,r){"use strict";r(43)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},function(e,t,r){"use strict";r(43)("big",(function(e){return function(){return e(this,"big","","")}}))},function(e,t,r){"use strict";r(43)("blink",(function(e){return function(){return e(this,"blink","","")}}))},function(e,t,r){"use strict";r(43)("bold",(function(e){return function(){return e(this,"b","","")}}))},function(e,t,r){"use strict";r(43)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},function(e,t,r){"use strict";r(43)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},function(e,t,r){"use strict";r(43)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},function(e,t,r){"use strict";r(43)("italics",(function(e){return function(){return e(this,"i","","")}}))},function(e,t,r){"use strict";r(43)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},function(e,t,r){"use strict";r(43)("small",(function(e){return function(){return e(this,"small","","")}}))},function(e,t,r){"use strict";r(43)("strike",(function(e){return function(){return e(this,"strike","","")}}))},function(e,t,r){"use strict";r(43)("sub",(function(e){return function(){return e(this,"sub","","")}}))},function(e,t,r){"use strict";r(43)("sup",(function(e){return function(){return e(this,"sup","","")}}))},function(e,t,r){var n=r(3);n(n.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,r){"use strict";var n=r(3),i=r(35),f=r(85);n(n.P+n.F*r(14)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),r=f(t);return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},function(e,t,r){var n=r(3),i=r(464);n(n.P+n.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,r){"use strict";var n=r(14),i=Date.prototype.getTime,f=Date.prototype.toISOString,c=function(e){return e>9?e:"0"+e};e.exports=n((function(){return"0385-07-25T07:06:39.999Z"!=f.call(new Date(-50000000000001))}))||!n((function(){f.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+c(e.getUTCMonth()+1)+"-"+c(e.getUTCDate())+"T"+c(e.getUTCHours())+":"+c(e.getUTCMinutes())+":"+c(e.getUTCSeconds())+"."+(r>99?r:"0"+c(r))+"Z"}:f},function(e,t,r){var n=Date.prototype,i=n.toString,f=n.getTime;new Date(NaN)+""!="Invalid Date"&&r(42)(n,"toString",(function(){var e=f.call(this);return e==e?i.call(this):"Invalid Date"}))},function(e,t,r){var n=r(21)("toPrimitive"),i=Date.prototype;n in i||r(49)(i,n,r(467))},function(e,t,r){"use strict";var n=r(15),i=r(85);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(n(this),"number"!=e)}},function(e,t,r){var n=r(3);n(n.S,"Array",{isArray:r(155)})},function(e,t,r){"use strict";var n=r(59),i=r(3),f=r(35),c=r(273),a=r(214),o=r(25),s=r(215),d=r(216);i(i.S+i.F*!r(156)((function(e){Array.from(e)})),"Array",{from:function(e){var t,r,i,u,h=f(e),l="function"==typeof this?this:Array,p=arguments.length,b=p>1?arguments[1]:void 0,m=void 0!==b,y=0,g=d(h);if(m&&(b=n(b,p>2?arguments[2]:void 0,2)),null==g||l==Array&&a(g))for(r=new l(t=o(h.length));t>y;y++)s(r,y,m?b(h[y],y):h[y]);else for(u=g.call(h),r=new l;!(i=u.next()).done;y++)s(r,y,m?c(u,b,[i.value,y],!0):i.value);return r.length=y,r}})},function(e,t,r){"use strict";var n=r(3),i=r(215);n(n.S+n.F*r(14)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)i(r,e,arguments[e++]);return r.length=t,r}})},function(e,t,r){"use strict";var n=r(3),i=r(50),f=[].join;n(n.P+n.F*(r(138)!=Object||!r(56)(f)),"Array",{join:function(e){return f.call(i(this),void 0===e?",":e)}})},function(e,t,r){"use strict";var n=r(3),i=r(202),f=r(75),c=r(97),a=r(25),o=[].slice;n(n.P+n.F*r(14)((function(){i&&o.call(i)})),"Array",{slice:function(e,t){var r=a(this.length),n=f(this);if(t=void 0===t?r:t,"Array"==n)return o.call(this,e,t);for(var i=c(e,r),s=c(t,r),d=a(s-i),u=new Array(d),h=0;h<d;h++)u[h]="String"==n?this.charAt(i+h):this[i+h];return u}})},function(e,t,r){"use strict";var n=r(3),i=r(60),f=r(35),c=r(14),a=[].sort,o=[1,2,3];n(n.P+n.F*(c((function(){o.sort(void 0)}))||!c((function(){o.sort(null)}))||!r(56)(a)),"Array",{sort:function(e){return void 0===e?a.call(f(this)):a.call(f(this),i(e))}})},function(e,t,r){"use strict";var n=r(3),i=r(64)(0),f=r(56)([].forEach,!0);n(n.P+n.F*!f,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,r){var n=r(16),i=r(155),f=r(21)("species");e.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[f])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){"use strict";var n=r(3),i=r(64)(1);n(n.P+n.F*!r(56)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(3),i=r(64)(2);n(n.P+n.F*!r(56)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(3),i=r(64)(3);n(n.P+n.F*!r(56)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(3),i=r(64)(4);n(n.P+n.F*!r(56)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(3),i=r(275);n(n.P+n.F*!r(56)([].reduce,!0),"Array",{reduce:function(e){return i(this,e,arguments.length,arguments[1],!1)}})},function(e,t,r){"use strict";var n=r(3),i=r(275);n(n.P+n.F*!r(56)([].reduceRight,!0),"Array",{reduceRight:function(e){return i(this,e,arguments.length,arguments[1],!0)}})},function(e,t,r){"use strict";var n=r(3),i=r(153)(!1),f=[].indexOf,c=!!f&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(c||!r(56)(f)),"Array",{indexOf:function(e){return c?f.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,r){"use strict";var n=r(3),i=r(50),f=r(61),c=r(25),a=[].lastIndexOf,o=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(o||!r(56)(a)),"Array",{lastIndexOf:function(e){if(o)return a.apply(this,arguments)||0;var t=i(this),r=c(t.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,f(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}})},function(e,t,r){var n=r(3);n(n.P,"Array",{copyWithin:r(276)}),r(101)("copyWithin")},function(e,t,r){var n=r(3);n(n.P,"Array",{fill:r(217)}),r(101)("fill")},function(e,t,r){"use strict";var n=r(3),i=r(64)(5),f=!0;"find"in[]&&Array(1).find((function(){f=!1})),n(n.P+n.F*f,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(101)("find")},function(e,t,r){"use strict";var n=r(3),i=r(64)(6),f="findIndex",c=!0;f in[]&&Array(1)[f]((function(){c=!1})),n(n.P+n.F*c,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(101)(f)},function(e,t,r){r(113)("Array")},function(e,t,r){var n=r(13),i=r(205),f=r(31).f,c=r(99).f,a=r(212),o=r(157),s=n.RegExp,d=s,u=s.prototype,h=/a/g,l=/a/g,p=new s(h)!==h;if(r(30)&&(!p||r(14)((function(){return l[r(21)("match")]=!1,s(h)!=h||s(l)==l||"/a/i"!=s(h,"i")})))){s=function(e,t){var r=this instanceof s,n=a(e),f=void 0===t;return!r&&n&&e.constructor===s&&f?e:i(p?new d(n&&!f?e.source:e,t):d((n=e instanceof s)?e.source:e,n&&f?o.call(e):t),r?this:u,s)};for(var b=function(e){e in s||f(s,e,{configurable:!0,get:function(){return d[e]},set:function(t){d[e]=t}})},m=c(d),y=0;m.length>y;)b(m[y++]);u.constructor=s,s.prototype=u,r(42)(n,"RegExp",s)}r(113)("RegExp")},function(e,t,r){"use strict";r(279);var n=r(15),i=r(157),f=r(30),c=/./.toString,a=function(e){r(42)(RegExp.prototype,"toString",e,!0)};r(14)((function(){return"/a/b"!=c.call({source:"a",flags:"b"})}))?a((function(){var e=n(this);return"/".concat(e.source,"/","flags"in e?e.flags:!f&&e instanceof RegExp?i.call(e):void 0)})):"toString"!=c.name&&a((function(){return c.call(this)}))},function(e,t,r){"use strict";var n=r(15),i=r(25),f=r(220),c=r(158);r(159)("match",1,(function(e,t,r,a){return[function(r){var n=e(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))},function(e){var t=a(r,e,this);if(t.done)return t.value;var o=n(e),s=String(this);if(!o.global)return c(o,s);var d=o.unicode;o.lastIndex=0;for(var u,h=[],l=0;null!==(u=c(o,s));){var p=String(u[0]);h[l]=p,""===p&&(o.lastIndex=f(s,i(o.lastIndex),d)),l++}return 0===l?null:h}]}))},function(e,t,r){"use strict";var n=r(15),i=r(35),f=r(25),c=r(61),a=r(220),o=r(158),s=Math.max,d=Math.min,u=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,l=/\$([$&`']|\d\d?)/g;r(159)("replace",2,(function(e,t,r,p){return[function(n,i){var f=e(this),c=null==n?void 0:n[t];return void 0!==c?c.call(n,f,i):r.call(String(f),n,i)},function(e,t){var i=p(r,e,this,t);if(i.done)return i.value;var u=n(e),h=String(this),l="function"==typeof t;l||(t=String(t));var m=u.global;if(m){var y=u.unicode;u.lastIndex=0}for(var g=[];;){var v=o(u,h);if(null===v)break;if(g.push(v),!m)break;""===String(v[0])&&(u.lastIndex=a(h,f(u.lastIndex),y))}for(var w,M="",O=0,x=0;x<g.length;x++){v=g[x];for(var S=String(v[0]),k=s(d(c(v.index),h.length),0),j=[],P=1;P<v.length;P++)j.push(void 0===(w=v[P])?w:String(w));var A=v.groups;if(l){var E=[S].concat(j,k,h);void 0!==A&&E.push(A);var I=String(t.apply(void 0,E))}else I=b(S,h,k,j,A,t);k>=O&&(M+=h.slice(O,k)+I,O=k+S.length)}return M+h.slice(O)}];function b(e,t,n,f,c,a){var o=n+e.length,s=f.length,d=l;return void 0!==c&&(c=i(c),d=h),r.call(a,d,(function(r,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(o);case"<":a=c[i.slice(1,-1)];break;default:var d=+i;if(0===d)return r;if(d>s){var h=u(d/10);return 0===h?r:h<=s?void 0===f[h-1]?i.charAt(1):f[h-1]+i.charAt(1):r}a=f[d-1]}return void 0===a?"":a}))}}))},function(e,t,r){"use strict";var n=r(15),i=r(264),f=r(158);r(159)("search",1,(function(e,t,r,c){return[function(r){var n=e(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))},function(e){var t=c(r,e,this);if(t.done)return t.value;var a=n(e),o=String(this),s=a.lastIndex;i(s,0)||(a.lastIndex=0);var d=f(a,o);return i(a.lastIndex,s)||(a.lastIndex=s),null===d?-1:d.index}]}))},function(e,t,r){"use strict";var n=r(212),i=r(15),f=r(141),c=r(220),a=r(25),o=r(158),s=r(219),d=r(14),u=Math.min,h=[].push,l="length",p=!d((function(){RegExp(4294967295,"y")}));r(159)("split",2,(function(e,t,r,d){var b;return b="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[l]||2!="ab".split(/(?:ab)*/)[l]||4!=".".split(/(.?)(.?)/)[l]||".".split(/()()/)[l]>1||"".split(/.?/)[l]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!n(e))return r.call(i,e,t);for(var f,c,a,o=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,p=void 0===t?4294967295:t>>>0,b=new RegExp(e.source,d+"g");(f=s.call(b,i))&&!((c=b.lastIndex)>u&&(o.push(i.slice(u,f.index)),f[l]>1&&f.index<i[l]&&h.apply(o,f.slice(1)),a=f[0][l],u=c,o[l]>=p));)b.lastIndex===f.index&&b.lastIndex++;return u===i[l]?!a&&b.test("")||o.push(""):o.push(i.slice(u)),o[l]>p?o.slice(0,p):o}:"0".split(void 0,0)[l]?function(e,t){return void 0===e&&0===t?[]:r.call(this,e,t)}:r,[function(r,n){var i=e(this),f=null==r?void 0:r[t];return void 0!==f?f.call(r,i,n):b.call(String(i),r,n)},function(e,t){var n=d(b,e,this,t,b!==r);if(n.done)return n.value;var s=i(e),h=String(this),l=f(s,RegExp),m=s.unicode,y=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(p?"y":"g"),g=new l(p?s:"^(?:"+s.source+")",y),v=void 0===t?4294967295:t>>>0;if(0===v)return[];if(0===h.length)return null===o(g,h)?[h]:[];for(var w=0,M=0,O=[];M<h.length;){g.lastIndex=p?M:0;var x,S=o(g,p?h:h.slice(M));if(null===S||(x=u(a(g.lastIndex+(p?0:M)),h.length))===w)M=c(h,M,m);else{if(O.push(h.slice(w,M)),O.length===v)return O;for(var k=1;k<=S.length-1;k++)if(O.push(S[k]),O.length===v)return O;M=w=x}}return O.push(h.slice(w)),O}]}))},function(e,t,r){var n=r(13),i=r(221).set,f=n.MutationObserver||n.WebKitMutationObserver,c=n.process,a=n.Promise,o="process"==r(75)(c);e.exports=function(){var e,t,r,s=function(){var n,i;for(o&&(n=c.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(o)r=function(){c.nextTick(s)};else if(!f||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var d=a.resolve(void 0);r=function(){d.then(s)}}else r=function(){i.call(n,s)};else{var u=!0,h=document.createTextNode("");new f(s).observe(h,{characterData:!0}),r=function(){h.data=u=!u}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){"use strict";var n=r(283),i=r(102);e.exports=r(162)("Map",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=n.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return n.def(i(this,"Map"),0===e?0:e,t)}},n,!0)},function(e,t,r){"use strict";var n=r(283),i=r(102);e.exports=r(162)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return n.def(i(this,"Set"),e=0===e?0:e,e)}},n)},function(e,t,r){"use strict";var n,i=r(13),f=r(64)(0),c=r(42),a=r(86),o=r(263),s=r(284),d=r(16),u=r(102),h=r(102),l=!i.ActiveXObject&&"ActiveXObject"in i,p=a.getWeak,b=Object.isExtensible,m=s.ufstore,y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(e){if(d(e)){var t=p(e);return!0===t?m(u(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return s.def(u(this,"WeakMap"),e,t)}},v=e.exports=r(162)("WeakMap",y,g,s,!0,!0);h&&l&&(o((n=s.getConstructor(y,"WeakMap")).prototype,g),a.NEED=!0,f(["delete","has","get","set"],(function(e){var t=v.prototype,r=t[e];c(t,e,(function(t,i){if(d(t)&&!b(t)){this._f||(this._f=new n);var f=this._f[e](t,i);return"set"==e?this:f}return r.call(this,t,i)}))})))},function(e,t,r){"use strict";var n=r(284),i=r(102);r(162)("WeakSet",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return n.def(i(this,"WeakSet"),e,!0)}},n,!1,!0)},function(e,t,r){"use strict";var n=r(3),i=r(163),f=r(222),c=r(15),a=r(97),o=r(25),s=r(16),d=r(13).ArrayBuffer,u=r(141),h=f.ArrayBuffer,l=f.DataView,p=i.ABV&&d.isView,b=h.prototype.slice,m=i.VIEW;n(n.G+n.W+n.F*(d!==h),{ArrayBuffer:h}),n(n.S+n.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return p&&p(e)||s(e)&&m in e}}),n(n.P+n.U+n.F*r(14)((function(){return!new h(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(e,t){if(void 0!==b&&void 0===t)return b.call(c(this),e);for(var r=c(this).byteLength,n=a(e,r),i=a(void 0===t?r:t,r),f=new(u(this,h))(o(i-n)),s=new l(this),d=new l(f),p=0;n<i;)d.setUint8(p++,s.getUint8(n++));return f}}),r(113)("ArrayBuffer")},function(e,t,r){var n=r(3);n(n.G+n.W+n.F*!r(163).ABV,{DataView:r(222).DataView})},function(e,t,r){r(77)("Int8",1,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Uint8",1,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Uint8",1,(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0)},function(e,t,r){r(77)("Int16",2,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Uint16",2,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Int32",4,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Uint32",4,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Float32",4,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){r(77)("Float64",8,(function(e){return function(t,r,n){return e(this,t,r,n)}}))},function(e,t,r){var n=r(3),i=r(60),f=r(15),c=(r(13).Reflect||{}).apply,a=Function.apply;n(n.S+n.F*!r(14)((function(){c((function(){}))})),"Reflect",{apply:function(e,t,r){var n=i(e),o=f(r);return c?c(n,t,o):a.call(n,t,o)}})},function(e,t,r){var n=r(3),i=r(98),f=r(60),c=r(15),a=r(16),o=r(14),s=r(265),d=(r(13).Reflect||{}).construct,u=o((function(){function e(){}return!(d((function(){}),[],e)instanceof e)})),h=!o((function(){d((function(){}))}));n(n.S+n.F*(u||h),"Reflect",{construct:function(e,t){f(e),c(t);var r=arguments.length<3?e:f(arguments[2]);if(h&&!u)return d(e,t,r);if(e==r){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])}var n=[null];return n.push.apply(n,t),new(s.apply(e,n))}var o=r.prototype,l=i(a(o)?o:Object.prototype),p=Function.apply.call(e,l,t);return a(p)?p:l}})},function(e,t,r){var n=r(31),i=r(3),f=r(15),c=r(85);i(i.S+i.F*r(14)((function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(e,t,r){f(e),t=c(t,!0),f(r);try{return n.f(e,t,r),!0}catch(e){return!1}}})},function(e,t,r){var n=r(3),i=r(62).f,f=r(15);n(n.S,"Reflect",{deleteProperty:function(e,t){var r=i(f(e),t);return!(r&&!r.configurable)&&delete e[t]}})},function(e,t,r){"use strict";var n=r(3),i=r(15),f=function(e){this._t=i(e),this._i=0;var t,r=this._k=[];for(t in e)r.push(t)};r(272)(f,"Object",(function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}})),n(n.S,"Reflect",{enumerate:function(e){return new f(e)}})},function(e,t,r){var n=r(62),i=r(100),f=r(48),c=r(3),a=r(16),o=r(15);c(c.S,"Reflect",{get:function e(t,r){var c,s,d=arguments.length<3?t:arguments[2];return o(t)===d?t[r]:(c=n.f(t,r))?f(c,"value")?c.value:void 0!==c.get?c.get.call(d):void 0:a(s=i(t))?e(s,r,d):void 0}})},function(e,t,r){var n=r(62),i=r(3),f=r(15);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return n.f(f(e),t)}})},function(e,t,r){var n=r(3),i=r(100),f=r(15);n(n.S,"Reflect",{getPrototypeOf:function(e){return i(f(e))}})},function(e,t,r){var n=r(3);n(n.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,r){var n=r(3),i=r(15),f=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(e){return i(e),!f||f(e)}})},function(e,t,r){var n=r(3);n(n.S,"Reflect",{ownKeys:r(286)})},function(e,t,r){var n=r(3),i=r(15),f=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(e){i(e);try{return f&&f(e),!0}catch(e){return!1}}})},function(e,t,r){var n=r(31),i=r(62),f=r(100),c=r(48),a=r(3),o=r(93),s=r(15),d=r(16);a(a.S,"Reflect",{set:function e(t,r,a){var u,h,l=arguments.length<4?t:arguments[3],p=i.f(s(t),r);if(!p){if(d(h=f(t)))return e(h,r,a,l);p=o(0)}if(c(p,"value")){if(!1===p.writable||!d(l))return!1;if(u=i.f(l,r)){if(u.get||u.set||!1===u.writable)return!1;u.value=a,n.f(l,r,u)}else n.f(l,r,o(0,a));return!0}return void 0!==p.set&&(p.set.call(l,a),!0)}})},function(e,t,r){var n=r(3),i=r(203);i&&n(n.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,r){r(527),e.exports=r(28).Array.includes},function(e,t,r){"use strict";var n=r(3),i=r(153)(!0);n(n.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(101)("includes")},function(e,t,r){r(529),e.exports=r(28).Array.flatMap},function(e,t,r){"use strict";var n=r(3),i=r(530),f=r(35),c=r(25),a=r(60),o=r(274);n(n.P,"Array",{flatMap:function(e){var t,r,n=f(this);return a(e),t=c(n.length),r=o(n,0),i(r,n,n,t,0,1,e,arguments[1]),r}}),r(101)("flatMap")},function(e,t,r){"use strict";var n=r(155),i=r(16),f=r(25),c=r(59),a=r(21)("isConcatSpreadable");e.exports=function e(t,r,o,s,d,u,h,l){for(var p,b,m=d,y=0,g=!!h&&c(h,l,3);y<s;){if(y in o){if(p=g?g(o[y],y,r):o[y],b=!1,i(p)&&(b=void 0!==(b=p[a])?!!b:n(p)),b&&u>0)m=e(t,r,p,f(p.length),m,u-1)-1;else{if(m>=9007199254740991)throw TypeError();t[m]=p}m++}y++}return m}},function(e,t,r){r(532),e.exports=r(28).String.padStart},function(e,t,r){"use strict";var n=r(3),i=r(287),f=r(161),c=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(f);n(n.P+n.F*c,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,r){r(534),e.exports=r(28).String.padEnd},function(e,t,r){"use strict";var n=r(3),i=r(287),f=r(161),c=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(f);n(n.P+n.F*c,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,r){r(536),e.exports=r(28).String.trimLeft},function(e,t,r){"use strict";r(111)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},function(e,t,r){r(538),e.exports=r(28).String.trimRight},function(e,t,r){"use strict";r(111)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},function(e,t,r){r(540),e.exports=r(199).f("asyncIterator")},function(e,t,r){r(259)("asyncIterator")},function(e,t,r){r(542),e.exports=r(28).Object.getOwnPropertyDescriptors},function(e,t,r){var n=r(3),i=r(286),f=r(50),c=r(62),a=r(215);n(n.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,r,n=f(e),o=c.f,s=i(n),d={},u=0;s.length>u;)void 0!==(r=o(n,t=s[u++]))&&a(d,t,r);return d}})},function(e,t,r){r(544),e.exports=r(28).Object.values},function(e,t,r){var n=r(3),i=r(288)(!1);n(n.S,"Object",{values:function(e){return i(e)}})},function(e,t,r){r(546),e.exports=r(28).Object.entries},function(e,t,r){var n=r(3),i=r(288)(!0);n(n.S,"Object",{entries:function(e){return i(e)}})},function(e,t,r){"use strict";r(280),r(548),e.exports=r(28).Promise.finally},function(e,t,r){"use strict";var n=r(3),i=r(28),f=r(13),c=r(141),a=r(282);n(n.P+n.R,"Promise",{finally:function(e){var t=c(this,i.Promise||f.Promise),r="function"==typeof e;return this.then(r?function(r){return a(t,e()).then((function(){return r}))}:e,r?function(r){return a(t,e()).then((function(){throw r}))}:e)}})},function(e,t,r){r(550),r(551),r(552),e.exports=r(28)},function(e,t,r){var n=r(13),i=r(3),f=r(161),c=[].slice,a=/MSIE .\./.test(f),o=function(e){return function(t,r){var n=arguments.length>2,i=!!n&&c.call(arguments,2);return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,r)}};i(i.G+i.B+i.F*a,{setTimeout:o(n.setTimeout),setInterval:o(n.setInterval)})},function(e,t,r){var n=r(3),i=r(221);n(n.G+n.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,r){for(var n=r(218),i=r(96),f=r(42),c=r(13),a=r(49),o=r(112),s=r(21),d=s("iterator"),u=s("toStringTag"),h=o.Array,l={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(l),b=0;b<p.length;b++){var m,y=p[b],g=l[y],v=c[y],w=v&&v.prototype;if(w&&(w[d]||a(w,d,h),w[u]||a(w,u,y),o[y]=h,g))for(m in n)w[m]||f(w,m,n[m],!0)}},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",f=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function o(e,t,r,n){var i=t&&t.prototype instanceof u?t:u,f=Object.create(i.prototype),c=new x(n||[]);return f._invoke=function(e,t,r){var n="suspendedStart";return function(i,f){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw f;return k()}for(r.method=i,r.arg=f;;){var c=r.delegate;if(c){var a=w(c,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var o=s(e,t,r);if("normal"===o.type){if(n=r.done?"completed":"suspendedYield",o.arg===d)continue;return{value:o.arg,done:r.done}}"throw"===o.type&&(n="completed",r.method="throw",r.arg=o.arg)}}}(e,r,c),f}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=o;var d={};function u(){}function h(){}function l(){}var p={};p[i]=function(){return this};var b=Object.getPrototypeOf,m=b&&b(b(S([])));m&&m!==t&&r.call(m,i)&&(p=m);var y=l.prototype=u.prototype=Object.create(p);function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var n;this._invoke=function(i,f){function c(){return new t((function(n,c){!function n(i,f,c,a){var o=s(e[i],e,f);if("throw"!==o.type){var d=o.arg,u=d.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,c,a)}),(function(e){n("throw",e,c,a)})):t.resolve(u).then((function(e){d.value=e,c(d)}),(function(e){return n("throw",e,c,a)}))}a(o.arg)}(i,f,n,c)}))}return n=n?n.then(c,c):c()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=s(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,f=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return f.next=f}}return{next:k}}function k(){return{value:void 0,done:!0}}return h.prototype=y.constructor=l,l.constructor=h,h.displayName=a(l,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},g(v.prototype),v.prototype[f]=function(){return this},e.AsyncIterator=v,e.async=function(t,r,n,i,f){void 0===f&&(f=Promise);var c=new v(o(t,r,n,i),f);return e.isGeneratorFunction(r)?c:c.next().then((function(e){return e.done?e.value:c.next()}))},g(y),a(y,c,"Generator"),y[i]=function(){return this},y.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=S,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return c.type="throw",c.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var f=this.tryEntries[i],c=f.completion;if("root"===f.tryLoc)return n("end");if(f.tryLoc<=this.prev){var a=r.call(f,"catchLoc"),o=r.call(f,"finallyLoc");if(a&&o){if(this.prev<f.catchLoc)return n(f.catchLoc,!0);if(this.prev<f.finallyLoc)return n(f.finallyLoc)}else if(a){if(this.prev<f.catchLoc)return n(f.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<f.finallyLoc)return n(f.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var f=i;break}}f&&("break"===e||"continue"===e)&&f.tryLoc<=t&&t<=f.finallyLoc&&(f=null);var c=f?f.completion:{};return c.type=e,c.arg=t,f?(this.method="next",this.next=f.finallyLoc,d):this.complete(c)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){r(555),e.exports=r(289).global},function(e,t,r){var n=r(556);n(n.G,{global:r(223)})},function(e,t,r){var n=r(223),i=r(289),f=r(557),c=r(559),a=r(566),o=function(e,t,r){var s,d,u,h=e&o.F,l=e&o.G,p=e&o.S,b=e&o.P,m=e&o.B,y=e&o.W,g=l?i:i[t]||(i[t]={}),v=g.prototype,w=l?n:p?n[t]:(n[t]||{}).prototype;for(s in l&&(r=t),r)(d=!h&&w&&void 0!==w[s])&&a(g,s)||(u=d?w[s]:r[s],g[s]=l&&"function"!=typeof w[s]?r[s]:m&&d?f(u,n):y&&w[s]==u?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(u):b&&"function"==typeof u?f(Function.call,u):u,b&&((g.virtual||(g.virtual={}))[s]=u,e&o.R&&v&&!v[s]&&c(v,s,u)))};o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,o.U=64,o.R=128,e.exports=o},function(e,t,r){var n=r(558);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(560),i=r(565);e.exports=r(225)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(561),i=r(562),f=r(564),c=Object.defineProperty;t.f=r(225)?Object.defineProperty:function(e,t,r){if(n(e),t=f(t,!0),n(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(224);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){e.exports=!r(225)&&!r(290)((function(){return 7!=Object.defineProperty(r(563)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(224),i=r(223).document,f=n(i)&&n(i.createElement);e.exports=function(e){return f?i.createElement(e):{}}},function(e,t,r){var n=r(224);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t){},function(e,t){},function(e,t){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.read=function(e,t,r,n,i){var f,c,a=8*i-n-1,o=(1<<a)-1,s=o>>1,d=-7,u=r?i-1:0,h=r?-1:1,l=e[t+u];for(u+=h,f=l&(1<<-d)-1,l>>=-d,d+=a;d>0;f=256*f+e[t+u],u+=h,d-=8);for(c=f&(1<<-d)-1,f>>=-d,d+=n;d>0;c=256*c+e[t+u],u+=h,d-=8);if(0===f)f=1-s;else{if(f===o)return c?NaN:1/0*(l?-1:1);c+=Math.pow(2,n),f-=s}return(l?-1:1)*c*Math.pow(2,f-n)},t.write=function(e,t,r,n,i,f){var c,a,o,s=8*f-i-1,d=(1<<s)-1,u=d>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:f-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?(a=isNaN(t)?1:0,c=d):(c=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-c))<1&&(c--,o*=2),(t+=c+u>=1?h/o:h*Math.pow(2,1-u))*o>=2&&(c++,o/=2),c+u>=d?(a=0,c=d):c+u>=1?(a=(t*o-1)*Math.pow(2,i),c+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),c=0));i>=8;e[r+l]=255&a,l+=p,a/=256,i-=8);for(c=c<<i|a,s+=i;s>0;e[r+l]=255&c,l+=p,c/=256,s-=8);e[r+l-p]|=128*b}},function(e,t,r){const n=r(292);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function f(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let f=e[t+1]+n;i>=4294967296&&f++,e[t]=i,e[t+1]=f}function c(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,c,a){const o=u[c],s=u[c+1],h=u[a],l=u[a+1];i(d,e,t),f(d,e,o,s);let p=d[n]^d[e],b=d[n+1]^d[e+1];d[n]=b,d[n+1]=p,i(d,r,n),p=d[t]^d[r],b=d[t+1]^d[r+1],d[t]=p>>>24^b<<8,d[t+1]=b>>>24^p<<8,i(d,e,t),f(d,e,h,l),p=d[n]^d[e],b=d[n+1]^d[e+1],d[n]=p>>>16^b<<16,d[n+1]=b>>>16^p<<16,i(d,r,n),p=d[t]^d[r],b=d[t+1]^d[r+1],d[t]=b>>>31^p<<1,d[t+1]=p>>>31^b<<1}const o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),d=new Uint32Array(32),u=new Uint32Array(32);function h(e,t){let r=0;for(r=0;r<16;r++)d[r]=e.h[r],d[r+16]=o[r];for(d[24]=d[24]^e.t,d[25]=d[25]^e.t/4294967296,t&&(d[28]=~d[28],d[29]=~d[29]),r=0;r<32;r++)u[r]=c(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,s[16*r+0],s[16*r+1]),a(2,10,18,26,s[16*r+2],s[16*r+3]),a(4,12,20,28,s[16*r+4],s[16*r+5]),a(6,14,22,30,s[16*r+6],s[16*r+7]),a(0,10,20,30,s[16*r+8],s[16*r+9]),a(2,12,22,24,s[16*r+10],s[16*r+11]),a(4,14,16,26,s[16*r+12],s[16*r+13]),a(6,8,18,28,s[16*r+14],s[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^d[r]^d[r+16]}function l(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");const r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};for(let e=0;e<16;e++)r.h[e]=o[e];const n=t?t.length:0;return r.h[0]^=16842752^n<<8^e,t&&(p(r,t),r.c=128),r}function p(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}function b(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function m(e,t,r){r=r||64,e=n.normalizeInput(e);const i=l(r,t);return p(i,e),b(i)}e.exports={blake2b:m,blake2bHex:function(e,t,r){const i=m(e,t,r);return n.toHex(i)},blake2bInit:l,blake2bUpdate:p,blake2bFinal:b}},function(e,t,r){const n=r(292);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function f(e,t,r,n,i,f){s[e]=s[e]+s[t]+i,s[n]=c(s[n]^s[e],16),s[r]=s[r]+s[n],s[t]=c(s[t]^s[r],12),s[e]=s[e]+s[t]+f,s[n]=c(s[n]^s[e],8),s[r]=s[r]+s[n],s[t]=c(s[t]^s[r],7)}function c(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),d=new Uint32Array(16);function u(e,t){let r=0;for(r=0;r<8;r++)s[r]=e.h[r],s[r+8]=a[r];for(s[12]^=e.t,s[13]^=e.t/4294967296,t&&(s[14]=~s[14]),r=0;r<16;r++)d[r]=i(e.b,4*r);for(r=0;r<10;r++)f(0,4,8,12,d[o[16*r+0]],d[o[16*r+1]]),f(1,5,9,13,d[o[16*r+2]],d[o[16*r+3]]),f(2,6,10,14,d[o[16*r+4]],d[o[16*r+5]]),f(3,7,11,15,d[o[16*r+6]],d[o[16*r+7]]),f(0,5,10,15,d[o[16*r+8]],d[o[16*r+9]]),f(1,6,11,12,d[o[16*r+10]],d[o[16*r+11]]),f(2,7,8,13,d[o[16*r+12]],d[o[16*r+13]]),f(3,4,9,14,d[o[16*r+14]],d[o[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=s[r]^s[r+8]}function h(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(l(n,t),n.c=64),n}function l(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;u(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);const i=h(r,t);return l(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){const i=b(e,t,r);return n.toHex(i)},blake2sInit:h,blake2sUpdate:l,blake2sFinal:p}},function(e,t,r){"use strict";(function(e){var t=r(196),n=r(356),i=r(357),f=r(171);Object(t.a)(f.a,e,[n.a,i.a])}).call(this,"/")},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){},function(e,t,r){"use strict";var n=r(51),i=r(79),f=r(9),c=r(164),a=n.assert;function o(e){c.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 s(e,t,r,n){c.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 d(e,t,r,n){c.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}f(o,c),e.exports=o,o.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 f=this._getEndoRoots(this.n);0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(t))?r=f[0]:(r=f[1],a(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)}}},o.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),f=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(f).fromRed(),n.redSub(f).fromRed()]},o.prototype._getEndoBasis=function(e){for(var t,r,n,f,c,a,o,s,d,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),y=new i(1),g=0;0!==h.cmpn(0);){var v=l.div(h);s=l.sub(v.mul(h)),d=m.sub(v.mul(p));var w=y.sub(v.mul(b));if(!n&&s.cmp(u)<0)t=o.neg(),r=p,n=s.neg(),f=d;else if(n&&2==++g)break;o=s,l=h,h=s,m=p,p=d,y=b,b=w}c=s.neg(),a=d;var M=n.sqr().add(f.sqr());return c.sqr().add(a.sqr()).cmp(M)>=0&&(c=t,a=r),n.negative&&(n=n.neg(),f=f.neg()),c.negative&&(c=c.neg(),a=a.neg()),[{a:n,b:f},{a:c,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),f=r.b.neg().mul(e).divRound(this.n),c=i.mul(r.a),a=f.mul(n.a),o=i.mul(r.b),s=f.mul(n.b);return{k1:e.sub(c).sub(a),k2:o.add(s).neg()}},o.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 f=n.fromRed().isOdd();return(t&&!f||!t&&f)&&(n=n.redNeg()),this.point(e,n)},o.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)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,f=0;f<e.length;f++){var c=this._endoSplit(t[f]),a=e[f],o=a._getBeta();c.k1.negative&&(c.k1.ineg(),a=a.neg(!0)),c.k2.negative&&(c.k2.ineg(),o=o.neg(!0)),n[2*f]=a,n[2*f+1]=o,i[2*f]=c.k1,i[2*f+1]=c.k2}for(var s=this._wnafMulAdd(1,n,i,2*f,r),d=0;d<2*f;d++)n[d]=null,i[d]=null;return s},f(s,c.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.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}},s.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]},s.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 f=t[2];return n.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[n].concat(f.doubles.points.map(i))},naf:f.naf&&{wnd:f.naf.wnd,points:[n].concat(f.naf.points.map(i))}},n},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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)},s.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),f=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,c)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.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)},s.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)},s.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))},s.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},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},f(d,c.BasePoint),o.prototype.jpoint=function(e,t,r){return new d(this,e,t,r)},d.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)},d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},d.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),f=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),o=f.redSub(c);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),d=s.redMul(a),u=n.redMul(s),h=o.redSqr().redIAdd(d).redISub(u).redISub(u),l=o.redMul(u.redISub(h)).redISub(f.redMul(d)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,l,p)},d.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,f=e.y.redMul(t).redMul(this.z),c=r.redSub(n),a=i.redSub(f);if(0===c.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=c.redSqr(),s=o.redMul(c),d=r.redMul(o),u=a.redSqr().redIAdd(s).redISub(d).redISub(d),h=a.redMul(d.redISub(u)).redISub(i.redMul(s)),l=this.z.redMul(c);return this.curve.jpoint(u,h,l)},d.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,f=this.x,c=this.y,a=this.z,o=a.redSqr().redSqr(),s=c.redAdd(c);for(t=0;t<e;t++){var d=f.redSqr(),u=s.redSqr(),h=u.redSqr(),l=d.redAdd(d).redIAdd(d).redIAdd(n.redMul(o)),p=f.redMul(u),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),y=l.redMul(m);y=y.redIAdd(y).redISub(h);var g=s.redMul(a);t+1<e&&(o=o.redMul(h)),f=b,a=g,s=y}return this.curve.jpoint(f,s.redMul(i),a)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},d.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),f=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(f);c=c.redIAdd(c);var a=n.redAdd(n).redIAdd(n),o=a.redSqr().redISub(c).redISub(c),s=f.redIAdd(f);s=(s=s.redIAdd(s)).redIAdd(s),e=o,t=a.redMul(c.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),u=this.y.redSqr(),h=u.redSqr(),l=this.x.redAdd(u).redSqr().redISub(d).redISub(h);l=l.redIAdd(l);var p=d.redAdd(d).redIAdd(d),b=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},d.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),f=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(f);c=c.redIAdd(c);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),o=a.redSqr().redISub(c).redISub(c);e=o;var s=f.redIAdd(f);s=(s=s.redIAdd(s)).redIAdd(s),t=a.redMul(c.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),u=this.y.redSqr(),h=this.x.redMul(u),l=this.x.redSub(d).redMul(this.x.redAdd(d));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(u).redISub(d);var m=u.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=l.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},d.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),f=t.redSqr(),c=r.redSqr(),a=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(i)),o=t.redAdd(t),s=(o=o.redIAdd(o)).redMul(c),d=a.redSqr().redISub(s.redAdd(s)),u=s.redISub(d),h=c.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=a.redMul(u).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(d,l,p)},d.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),f=i.redSqr(),c=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(c=(c=(c=c.redIAdd(c)).redAdd(c).redIAdd(c)).redISub(f)).redSqr(),o=n.redIAdd(n);o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);var s=i.redIAdd(c).redSqr().redISub(f).redISub(a).redISub(o),d=t.redMul(s);d=(d=d.redIAdd(d)).redIAdd(d);var u=this.x.redMul(a).redISub(d);u=(u=u.redIAdd(u)).redIAdd(u);var h=this.y.redMul(s.redMul(o.redISub(s)).redISub(c.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(c).redSqr().redISub(r).redISub(a);return this.curve.jpoint(u,h,l)},d.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},d.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)},d.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}},d.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)+">"},d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(79),i=r(9),f=r(164),c=r(51);function a(e){f.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 o(e,t,r){f.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(a,f),e.exports=a,a.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(o,f.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},a.prototype.point=function(e,t){return new o(this,e,t)},a.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.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)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.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)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),f=e.x.redSub(e.z).redMul(r),c=i.redMul(n),a=t.z.redMul(f.redAdd(c).redSqr()),o=t.x.redMul(f.redISub(c).redSqr());return this.curve.point(a,o)},o.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 f=i.length-1;f>=0;f--)0===i[f]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(51),i=r(79),f=r(9),c=r(164),a=n.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,c.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),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,t,r,n,f){c.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=f&&new i(f,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()))))}f(o,c),e.exports=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.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)),f=this.one.redSub(this.c2.redMul(this.d).redMul(r)),c=n.redMul(f.redInvm()),a=c.redSqrt();if(0!==a.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var o=a.fromRed().isOdd();return(t&&!o||!t&&o)&&(a=a.redNeg()),this.point(e,a)},o.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),f=r.redMul(this.d).redMul(this.c2).redSub(this.a),c=n.redMul(f.redInvm());if(0===c.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=c.redSqrt();if(0!==a.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},o.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)},f(s,c.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new s(this,e,t,r,n)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.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)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.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),f=n.redAdd(t),c=f.redSub(r),a=n.redSub(t),o=i.redMul(c),s=f.redMul(a),d=i.redMul(a),u=c.redMul(f);return this.curve.point(o,s,u,d)},s.prototype._projDbl=function(){var e,t,r,n,i,f,c=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(n=this.curve._mulA(a)).redAdd(o);this.zOne?(e=c.redSub(a).redSub(o).redMul(s.redSub(this.curve.two)),t=s.redMul(n.redSub(o)),r=s.redSqr().redSub(s).redSub(s)):(i=this.z.redSqr(),f=s.redSub(i).redISub(i),e=c.redSub(a).redISub(o).redMul(f),t=s.redMul(n.redSub(o)),r=s.redMul(f))}else n=a.redAdd(o),i=this.curve._mulC(this.z).redSqr(),f=n.redSub(i).redSub(i),e=this.curve._mulC(c.redISub(n)).redMul(f),t=this.curve._mulC(n).redMul(a.redISub(o)),r=n.redMul(f);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.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)),f=r.redSub(t),c=i.redSub(n),a=i.redAdd(n),o=r.redAdd(t),s=f.redMul(c),d=a.redMul(o),u=f.redMul(o),h=c.redMul(a);return this.curve.point(s,d,h,u)},s.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),f=this.x.redMul(e.x),c=this.y.redMul(e.y),a=this.curve.d.redMul(f).redMul(c),o=i.redSub(a),s=i.redAdd(a),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(f).redISub(c),u=n.redMul(o).redMul(d);return this.curve.twisted?(t=n.redMul(s).redMul(c.redSub(this.curve._mulA(f))),r=o.redMul(s)):(t=n.redMul(s).redMul(c.redSub(f)),r=this.curve._mulC(o).redMul(s)),this.curve.point(u,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.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},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.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}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add},function(e,t,r){"use strict";t.sha1=r(580),t.sha224=r(581),t.sha256=r(295),t.sha384=r(582),t.sha512=r(296)},function(e,t,r){"use strict";var n=r(65),i=r(143),f=r(294),c=n.rotl32,a=n.sum32,o=n.sum32_5,s=f.ft_1,d=i.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,d),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]=c(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],f=this.h[1],d=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=o(c(i,5),s(p,f,d,h),l,r[n],u[p]);l=h,h=d,d=c(f,30),f=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],f),this.h[2]=a(this.h[2],d),this.h[3]=a(this.h[3],h),this.h[4]=a(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(65),i=r(295);function f(){if(!(this instanceof f))return new f;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(f,i),e.exports=f,f.blockSize=512,f.outSize=224,f.hmacStrength=192,f.padLength=64,f.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(65),i=r(296);function f(){if(!(this instanceof f))return new f;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(f,i),e.exports=f,f.blockSize=1024,f.outSize=384,f.hmacStrength=192,f.padLength=128,f.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(65),i=r(143),f=n.rotl32,c=n.sum32,a=n.sum32_3,o=n.sum32_4,s=i.BlockHash;function d(){if(!(this instanceof d))return new d;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(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(d,s),t.ripemd160=d,d.blockSize=512,d.outSize=160,d.hmacStrength=192,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],s=this.h[3],d=this.h[4],g=r,v=n,w=i,M=s,O=d,x=0;x<80;x++){var S=c(f(o(r,u(x,n,i,s),e[p[x]+t],h(x)),m[x]),d);r=d,d=s,s=f(i,10),i=n,n=S,S=c(f(o(g,u(79-x,v,w,M),e[b[x]+t],l(x)),y[x]),O),g=O,O=M,M=f(w,10),w=v,v=S}S=a(this.h[1],i,M),this.h[1]=a(this.h[2],s,O),this.h[2]=a(this.h[3],d,g),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[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(65),i=r(44);function f(e,t,r){if(!(this instanceof f))return new f(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=f,f.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)},f.prototype.update=function(e,t){return this.inner.update(e,t),this},f.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(79),i=r(297),f=r(51),c=r(227),a=r(142),o=f.assert,s=r(587),d=r(588);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(c,e),"Unknown curve "+e),e=c[e]),e instanceof c.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=u,u.prototype.keyPair=function(e){return new s(this,e)},u.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),f=this.n.sub(new n(2));;){var c=new n(t.generate(r));if(!(c.cmp(f)>0))return c.iaddn(1),this.keyFromPrivate(c)}},u.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},u.prototype.sign=function(e,t,r,f){"object"==typeof r&&(f=r,r=null),f||(f={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var c=this.n.byteLength(),a=t.getPrivate().toArray("be",c),o=e.toArray("be",c),s=new i({hash:this.hash,entropy:a,nonce:o,pers:f.pers,persEnc:f.persEnc||"utf8"}),u=this.n.sub(new n(1)),h=0;;h++){var l=f.k?f.k(h):new n(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return f.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),g^=1),new d({r:m,s:y,recoveryParam:g})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var f=(t=new d(t,"hex")).r,c=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var a,o=c.invm(this.n),s=o.mul(e).umod(this.n),u=o.mul(f).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(s,r.getPublic(),u)).isInfinity()&&a.eqXToP(f):!(a=this.g.mulAdd(s,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(f)},u.prototype.recoverPubKey=function(e,t,r,i){o((3&r)===r,"The recovery param is more than two bits"),t=new d(t,i);var f=this.n,c=new n(e),a=t.r,s=t.s,u=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(f),p=f.sub(c).mul(l).umod(f),b=s.mul(l).umod(f);return this.g.mulAdd(p,a,b)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new d(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var f;try{f=this.recoverPubKey(e,t,i)}catch(e){continue}if(f.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(79),i=r(51).assert;function f(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=f,f.fromPublic=function(e,t,r){return t instanceof f?t:new f(e,{pub:t,pubEnc:r})},f.fromPrivate=function(e,t,r){return t instanceof f?t:new f(e,{priv:t,privEnc:r})},f.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"}},f.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},f.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},f.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},f.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)},f.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},f.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},f.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},f.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(79),i=r(51),f=i.assert;function c(e,t){if(e instanceof c)return e;this._importDER(e,t)||(f(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 a(){this.place=0}function o(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,f=0,c=t.place;f<n;f++,c++)i<<=8,i|=e[c],i>>>=0;return!(i<=127)&&(t.place=c,i)}function s(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 d(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=c,c.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var f=o(e,r);if(!1===f)return!1;if(f+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var c=o(e,r);if(!1===c)return!1;var s=e.slice(r.place,c+r.place);if(r.place+=c,2!==e[r.place++])return!1;var d=o(e,r);if(!1===d)return!1;if(e.length!==d+r.place)return!1;var u=e.slice(r.place,d+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(s),this.s=new n(u),this.recoveryParam=null,!0},c.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=s(t),r=s(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];d(n,t.length),(n=n.concat(t)).push(2),d(n,r.length);var f=n.concat(r),c=[48];return d(c,f.length),c=c.concat(f),i.encode(c,e)}},function(e,t,r){"use strict";var n=r(66),i=r(227),f=r(51),c=f.assert,a=f.parseBytes,o=r(590),s=r(591);function d(e){if(c("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof d))return new d(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=d,d.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),f=this.encodePoint(i),c=this.hashInt(f,r.pubBytes(),e).mul(r.priv()),o=n.add(c).umod(this.curve.n);return this.makeSignature({R:i,S:o,Rencoded:f})},d.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),f=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(f)},d.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return f.intFromLE(e.digest()).umod(this.curve.n)},d.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},d.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},d.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},d.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},d.prototype.decodePoint=function(e){var t=(e=f.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=f.intFromLE(r);return this.curve.pointFromY(i,n)},d.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},d.prototype.decodeInt=function(e){return f.intFromLE(e)},d.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(51),i=n.assert,f=n.parseBytes,c=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=f(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=f(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},c(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),c(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),c(a,"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})),c(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),c(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),c(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},function(e,t,r){"use strict";var n=r(79),i=r(51),f=i.assert,c=i.cachedProperty,a=i.parseBytes;function o(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),f(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}c(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),c(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),c(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),c(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=o},function(e,t){},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){const n=r(228),{checkAndInit:i,smixSync:f}=r(347);e.exports=function(e,t,r,c,a,o,s){const{XY:d,V:u,B32:h,x:l,_X:p,B:b,tickCallback:m}=i(e,t,r,c,a,o,s);for(var y=0;y<a;y++)f(b,128*y*c,c,r,u,d,p,h,l,m);return n.pbkdf2Sync(e,b,1,o,"sha256")}},function(e,t,r){(t=e.exports=r(299)).Stream=t,t.Readable=t,t.Writable=r(303),t.Duplex=r(118),t.Transform=r(304),t.PassThrough=r(601),t.finished=r(231),t.pipeline=r(602)},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 f(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 c=r(19).Buffer,a=r(598).inspect,o=a&&a.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,s;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 c.alloc(0);for(var t,r,n,i=c.allocUnsafe(e>>>0),f=this.head,a=0;f;)t=f.data,r=i,n=a,c.prototype.copy.call(t,r,n),a+=f.data.length,f=f.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,f=e>i.length?i.length:e;if(f===i.length?n+=i:n+=i.slice(0,e),0==(e-=f)){f===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(f));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,f=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,f),0==(e-=f)){f===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(f));break}++n}return this.length-=n,t}},{key:o,value:function(e,t){return a(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}))}}])&&f(t.prototype,r),s&&f(t,s),e}()},function(e,t){},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 f=r(231),c=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),d=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function p(e){var t=e[c];if(null!==t){var r=e[h].read();null!==r&&(e[d]=null,e[c]=null,e[a]=null,t(l(r,!1)))}}function b(e){t.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[o];if(null!==r)return Promise.reject(r);if(this[s])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[o]?n(e[o]):r(l(void 0,!0))}))}));var n,i=this[d];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[s]?r(l(void 0,!0)):t[u](r,n)}),n)}}(i,this));else{var f=this[h].read();if(null!==f)return Promise.resolve(l(f,!1));n=new Promise(this[u])}return this[d]=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),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},h,{value:e,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:e._readableState.endEmitted,writable:!0}),i(t,u,{value:function(e,t){var n=r[h].read();n?(r[d]=null,r[c]=null,r[a]=null,e(l(n,!1))):(r[c]=e,r[a]=t)},writable:!0}),t));return r[d]=null,f(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[d]=null,r[c]=null,r[a]=null,t(e)),void(r[o]=e)}var n=r[c];null!==n&&(r[d]=null,r[c]=null,r[a]=null,n(l(void 0,!0))),r[s]=!0})),e.on("readable",b.bind(null,r)),r}}).call(this,r(26))},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(304);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(9)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(117).codes,f=i.ERR_MISSING_ARGS,c=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function o(e,t,i,f){f=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(f);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(231)),n(e,{readable:t,writable:i},(function(e){if(e)return f(e);a=!0,f()}));var o=!1;return function(t){if(!a&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void f(t||new c("pipe"))}}function s(e){e()}function d(e,t){return e.pipe(t)}function u(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=u(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new f("streams");var c=t.map((function(e,r){var f=r<t.length-1;return o(e,f,r>0,(function(e){n||(n=e),e&&c.forEach(s),f||(c.forEach(s),i(n))}))}));return t.reduce(d)}},function(e,t,r){var n=r(9),i=r(119),f=r(11).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function o(){this.init(),this._w=a,i.call(this,64,56)}function s(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(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,f=0|this._c,a=0|this._d,o=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var h=0;h<80;++h){var l=~~(h/20),p=0|((t=n)<<5|t>>>27)+d(l,i,f,a)+o+r[h]+c[l];o=a,a=f,f=s(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=f+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=f.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=o},function(e,t,r){var n=r(9),i=r(119),f=r(11).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function o(){this.init(),this._w=a,i.call(this,64,56)}function s(e){return e<<5|e>>>27}function d(e){return e<<30|e>>>2}function u(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(o,i),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,f=0|this._c,a=0|this._d,o=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=s(n)+u(p,i,f,a)+o+r[l]+c[p]|0;o=a,a=f,f=d(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=f+this._c|0,this._d=a+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var e=f.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=o},function(e,t,r){var n=r(9),i=r(305),f=r(119),c=r(11).Buffer,a=new Array(64);function o(){this.init(),this._w=a,f.call(this,64,56)}n(o,i),o.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},o.prototype._hash=function(){var e=c.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=o},function(e,t,r){var n=r(9),i=r(306),f=r(119),c=r(11).Buffer,a=new Array(160);function o(){this.init(),this._w=a,f.call(this,128,112)}n(o,i),o.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},o.prototype._hash=function(){var e=c.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=o},function(e,t,r){e.exports=i;var n=r(103).EventEmitter;function i(){n.call(this)}r(9)(i,n),i.Readable=r(234),i.Writable=r(613),i.Duplex=r(614),i.Transform=r(615),i.PassThrough=r(616),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 f(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",f),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",o));var c=!1;function a(){c||(c=!0,e.end())}function o(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(d(),0===n.listenerCount(this,"error"))throw e}function d(){r.removeListener("data",i),e.removeListener("drain",f),r.removeListener("end",a),r.removeListener("close",o),r.removeListener("error",s),e.removeListener("error",s),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("error",s),e.on("error",s),r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var n=r(235).Buffer,i=r(610);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,f=n.allocUnsafe(e>>>0),c=this.head,a=0;c;)t=c.data,r=f,i=a,t.copy(r,i),a+=c.data.length,c=c.next;return f},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,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,f,c,a,o=1,s={},d=!1,u=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?((f=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){f.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,n=function(e){var t=u.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)}:(c="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&p(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(c+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 s[o]=i,n(o),o++},h.clearImmediate=l}function l(e){delete s[e]}function p(e){if(d)setTimeout(p,0,e);else{var t=s[e];if(t){d=!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),d=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(32),r(26))},function(e,t,r){"use strict";e.exports=f;var n=r(311),i=Object.create(r(145));function f(e){if(!(this instanceof f))return new f(e);n.call(this,e)}i.inherits=r(9),i.inherits(f,n),f.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(236)},function(e,t,r){e.exports=r(105)},function(e,t,r){e.exports=r(234).Transform},function(e,t,r){e.exports=r(234).PassThrough},function(e,t,r){"use strict";var n=r(9),i=r(11).Buffer,f=r(87),c=i.alloc(128);function a(e,t){f.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,c],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),a=0;a<64;a++)r[a]=54^t[a],n[a]=92^t[a];this._hash=[r]}n(a,f),a.prototype._update=function(e){this._hash.push(e)},a.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=a},function(e,t,r){e.exports=r(314)},function(e,t,r){(function(t,n){var i,f=r(11).Buffer,c=r(316),a=r(317),o=r(318),s=r(319),d=t.crypto&&t.crypto.subtle,u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(e,t,r,n,i){return d.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return d.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return f.from(e)}))}e.exports=function(e,r,p,b,m,y){"function"==typeof m&&(y=m,m=void 0);var g=u[(m=m||"sha1").toLowerCase()];if(!g||"function"!=typeof t.Promise)return n.nextTick((function(){var t;try{t=o(e,r,p,b,m)}catch(e){return y(e)}y(null,t)}));if(c(p,b),e=s(e,a,"Password"),r=s(r,a,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){n.nextTick((function(){t(null,e)}))}),(function(e){n.nextTick((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!d||!d.importKey||!d.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var r=l(i=i||f.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=r,r}(g).then((function(t){return t?l(e,r,p,b,g):o(e,r,p,b,m)})),y)}}).call(this,r(32),r(26))},function(e,t,r){var n=r(621),i=r(238),f=r(239),c=r(634),a=r(167);function o(e,t,r){if(e=e.toLowerCase(),f[e])return i.createCipheriv(e,t,r);if(c[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function s(e,t,r){if(e=e.toLowerCase(),f[e])return i.createDecipheriv(e,t,r);if(c[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),f[e])r=f[e].key,n=f[e].iv;else{if(!c[e])throw new TypeError("invalid suite type");r=8*c[e].key,n=c[e].iv}var i=a(t,!1,r,n);return o(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=o,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),f[e])r=f[e].key,n=f[e].iv;else{if(!c[e])throw new TypeError("invalid suite type");r=8*c[e].key,n=c[e].iv}var i=a(t,!1,r,n);return s(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=s,t.listCiphers=t.getCiphers=function(){return Object.keys(c).concat(i.getCiphers())}},function(e,t,r){var n=r(87),i=r(622),f=r(9),c=r(11).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function o(e){n.call(this);var t,r=e.mode.toLowerCase(),i=a[r];t=e.decrypt?"decrypt":"encrypt";var f=e.key;c.isBuffer(f)||(f=c.from(f)),"des-ede"!==r&&"des-ede-cbc"!==r||(f=c.concat([f,f.slice(0,8)]));var o=e.iv;c.isBuffer(o)||(o=c.from(o)),this._des=i.create({key:f,iv:o,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=o,f(o,n),o.prototype._update=function(e){return c.from(this._des.update(e))},o.prototype._final=function(){return c.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(320),t.Cipher=r(237),t.DES=r(321),t.CBC=r(623),t.EDE=r(624)},function(e,t,r){"use strict";var n=r(44),i=r(9),f={};function c(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(f),n=0;n<r.length;n++){var c=r[n];t.prototype[c]=f[c]}return t.create=function(e){return new t(e)},t},f._cbcInit=function(){var e=new c(this.options.iv);this._cbcState=e},f._update=function(e,t,r,n){var i=this._cbcState,f=this.constructor.super_.prototype,c=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)c[a]^=e[t+a];f._update.call(this,c,0,r,n);for(a=0;a<this.blockSize;a++)c[a]=r[n+a]}else{f._update.call(this,e,t,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=c[a];for(a=0;a<this.blockSize;a++)c[a]=e[t+a]}}},function(e,t,r){"use strict";var n=r(44),i=r(9),f=r(237),c=r(321);function a(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),f=t.slice(16,24);this.ciphers="encrypt"===e?[c.create({type:"encrypt",key:r}),c.create({type:"decrypt",key:i}),c.create({type:"encrypt",key:f})]:[c.create({type:"decrypt",key:f}),c.create({type:"encrypt",key:i}),c.create({type:"decrypt",key:r})]}function o(e){f.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}i(o,f),e.exports=o,o.create=function(e){return new o(e)},o.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},o.prototype._pad=c.prototype._pad,o.prototype._unpad=c.prototype._unpad},function(e,t,r){var n=r(239),i=r(325),f=r(11).Buffer,c=r(326),a=r(87),o=r(166),s=r(167);function d(e,t,r){a.call(this),this._cache=new h,this._cipher=new o.AES(t),this._prev=f.from(r),this._mode=e,this._autopadding=!0}r(9)(d,a),d.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return f.concat(n)};var u=f.alloc(16,16);function h(){this.cache=f.allocUnsafe(0)}function l(e,t,r){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=f.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=f.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new c(a.module,t,r):"auth"===a.type?new i(a.module,t,r):new d(a.module,t,r)}d.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=f.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=f.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return f.concat([this.cache,t])},t.createCipheriv=l,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=s(t,!1,r.key,r.iv);return l(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(146);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(11).Buffer,i=r(146);function f(e,t,r){var f=t.length,c=i(t,e._cache);return e._cache=e._cache.slice(f),e._prev=n.concat([e._prev,r?t:c]),c}t.encrypt=function(e,t,r){for(var i,c=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){c=n.concat([c,f(e,t,r)]);break}i=e._cache.length,c=n.concat([c,f(e,t.slice(0,i),r)]),t=t.slice(i)}return c}},function(e,t,r){var n=r(11).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var f=t.length,c=n.allocUnsafe(f),a=-1;++a<f;)c[a]=i(e,t[a],r);return c}},function(e,t,r){var n=r(11).Buffer;function i(e,t,r){for(var n,i,c=-1,a=0;++c<8;)n=t&1<<7-c?128:0,a+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>c%8,e._prev=f(e._prev,r?n:i);return a}function f(e,t){var r=e.length,i=-1,f=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)f[i]=e[i]<<1|e[i+1]>>7;return f}t.encrypt=function(e,t,r){for(var f=t.length,c=n.allocUnsafe(f),a=-1;++a<f;)c[a]=i(e,t[a],r);return c}},function(e,t,r){(function(e){var n=r(146);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var f=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,f)}}).call(this,r(19).Buffer)},function(e,t,r){var n=r(11).Buffer,i=n.alloc(16,0);function f(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function c(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}c.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},c.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],c=-1;++c<128;){for(0!=(this.state[~~(c/8)]&1<<7-c%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=f(i)},c.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},c.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(f([0,e,0,t])),this.state},e.exports=c},function(e,t,r){var n=r(325),i=r(11).Buffer,f=r(239),c=r(326),a=r(87),o=r(166),s=r(167);function d(e,t,r){a.call(this),this._cache=new u,this._last=void 0,this._cipher=new o.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function u(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var a=f[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new c(a.module,t,r,!0):"auth"===a.type?new n(a.module,t,r,!0):new d(a.module,t,r)}r(9)(d,a),d.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},d.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=i.concat([this.cache,e])},u.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=f[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=s(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(327),i=r(639),f=r(640);var c={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new f(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,a,o){return e.isBuffer(i)||void 0===c[i]?t(r,"binary",i,a):(i=i||"binary",o=o||"binary",a=a||new e([2]),e.isBuffer(a)||(a=new e(a,o)),"number"==typeof r?new f(n(r,a),a,!0):(e.isBuffer(r)||(r=new e(r,i)),new f(r,a,!0)))}}).call(this,r(19).Buffer)},function(e,t){},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(638).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(328),i=new(r(329)),f=new n(24),c=new n(11),a=new n(10),o=new n(3),s=new n(7),d=r(327),u=r(116);function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=b;var p={};function b(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var u,h=0;if(e.isEven()||!d.simpleSieve||!d.fermatTest(e)||!i.test(e))return h+=1,h+="02"===r||"05"===r?8:4,p[n]=h,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(f).cmp(c)&&(h+=8);break;case"05":(u=e.mod(a)).cmp(o)&&u.cmp(s)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new n(u(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),f=this.getPrime();if(i.length<f.length){var c=new t(f.length-i.length);c.fill(0),i=t.concat([c,i])}return i},b.prototype.getPublicKey=function(e){return m(this._pub,e)},b.prototype.getPrivateKey=function(e){return m(this._priv,e)},b.prototype.getPrime=function(e){return m(this.__prime,e)},b.prototype.getGenerator=function(e){return m(this._gen,e)},b.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(19).Buffer)},function(e,t,r){var n=r(11).Buffer,i=r(144),f=r(642),c=r(9),a=r(650),o=r(673),s=r(314);function d(e){f.Writable.call(this);var t=s[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){f.Writable.call(this);var t=s[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new d(e)}function l(e){return new u(e)}Object.keys(s).forEach((function(e){s[e].id=n.from(s[e].id,"hex"),s[e.toLowerCase()]=s[e]})),c(d,f.Writable),d.prototype._write=function(e,t,r){this._hash.update(e),r()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},d.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=a(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},c(u,f.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},u.prototype.verify=function(e,t,r){"string"==typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return o(t,i,e,this._signType,this._tag)},e.exports={Sign:h,Verify:l,createSign:h,createVerify:l}},function(e,t,r){(t=e.exports=r(330)).Stream=t,t.Readable=t,t.Writable=r(334),t.Duplex=r(121),t.Transform=r(335),t.PassThrough=r(648),t.finished=r(240),t.pipeline=r(649)},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 f(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 c=r(19).Buffer,a=r(645).inspect,o=a&&a.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,s;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 c.alloc(0);for(var t,r,n,i=c.allocUnsafe(e>>>0),f=this.head,a=0;f;)t=f.data,r=i,n=a,c.prototype.copy.call(t,r,n),a+=f.data.length,f=f.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,f=e>i.length?i.length:e;if(f===i.length?n+=i:n+=i.slice(0,e),0==(e-=f)){f===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(f));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,f=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,f),0==(e-=f)){f===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(f));break}++n}return this.length-=n,t}},{key:o,value:function(e,t){return a(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}))}}])&&f(t.prototype,r),s&&f(t,s),e}()},function(e,t){},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 f=r(240),c=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),d=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function p(e){var t=e[c];if(null!==t){var r=e[h].read();null!==r&&(e[d]=null,e[c]=null,e[a]=null,t(l(r,!1)))}}function b(e){t.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[o];if(null!==r)return Promise.reject(r);if(this[s])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[o]?n(e[o]):r(l(void 0,!0))}))}));var n,i=this[d];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[s]?r(l(void 0,!0)):t[u](r,n)}),n)}}(i,this));else{var f=this[h].read();if(null!==f)return Promise.resolve(l(f,!1));n=new Promise(this[u])}return this[d]=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),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},h,{value:e,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:e._readableState.endEmitted,writable:!0}),i(t,u,{value:function(e,t){var n=r[h].read();n?(r[d]=null,r[c]=null,r[a]=null,e(l(n,!1))):(r[c]=e,r[a]=t)},writable:!0}),t));return r[d]=null,f(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[d]=null,r[c]=null,r[a]=null,t(e)),void(r[o]=e)}var n=r[c];null!==n&&(r[d]=null,r[c]=null,r[a]=null,n(l(void 0,!0))),r[s]=!0})),e.on("readable",b.bind(null,r)),r}}).call(this,r(26))},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(335);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(9)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(120).codes,f=i.ERR_MISSING_ARGS,c=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function o(e,t,i,f){f=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(f);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(240)),n(e,{readable:t,writable:i},(function(e){if(e)return f(e);a=!0,f()}));var o=!1;return function(t){if(!a&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void f(t||new c("pipe"))}}function s(e){e()}function d(e,t){return e.pipe(t)}function u(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=u(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new f("streams");var c=t.map((function(e,r){var f=r<t.length-1;return o(e,f,r>0,(function(e){n||(n=e),e&&c.forEach(s),f||(c.forEach(s),i(n))}))}));return t.reduce(d)}},function(e,t,r){var n=r(11).Buffer,i=r(312),f=r(241),c=r(242).ec,a=r(20),o=r(169),s=r(343);function d(e,t,r,f){if((e=n.from(e.toArray())).length<t.byteLength()){var c=n.alloc(t.byteLength()-e.length);e=n.concat([c,e])}var a=r.length,o=function(e,t){e=(e=u(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),s=n.alloc(a);s.fill(1);var d=n.alloc(a);return d=i(f,d).update(s).update(n.from([0])).update(e).update(o).digest(),s=i(f,d).update(s).digest(),{k:d=i(f,d).update(s).update(n.from([1])).update(e).update(o).digest(),v:s=i(f,d).update(s).digest()}}function u(e,t){var r=new a(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function h(e,t,r){var f,c;do{for(f=n.alloc(0);8*f.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),f=n.concat([f,t.v]);c=u(f,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==c.cmp(e));return c}function l(e,t,r,n){return e.toRed(a.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,p){var b=o(t);if(b.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=s[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new c(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,b)}if("dsa"===b.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,f=t.params.priv_key,c=t.params.p,o=t.params.q,s=t.params.g,p=new a(0),b=u(e,o).mod(o),m=!1,y=d(f,o,e,r);for(;!1===m;)i=h(o,y,r),p=l(s,i,c,o),0===(m=i.invm(o).imul(b.add(f.mul(p))).mod(o)).cmpn(0)&&(m=!1,p=new a(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,m)}(e,b,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([p,e]);for(var m=b.modulus.byteLength(),y=[0,1];e.length+y.length+1<m;)y.push(255);y.push(0);for(var g=-1;++g<e.length;)y.push(e[g]);return f(y,b)},e.exports.getKey=d,e.exports.makeKey=h},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.3","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","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":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(e,t){},function(e,t,r){"use strict";var n=r(52),i=r(80),f=r(9),c=r(168),a=n.assert;function o(e){c.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 s(e,t,r,n){c.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 d(e,t,r,n){c.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}f(o,c),e.exports=o,o.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 f=this._getEndoRoots(this.n);0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(t))?r=f[0]:(r=f[1],a(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)}}},o.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),f=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(f).fromRed(),n.redSub(f).fromRed()]},o.prototype._getEndoBasis=function(e){for(var t,r,n,f,c,a,o,s,d,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),y=new i(1),g=0;0!==h.cmpn(0);){var v=l.div(h);s=l.sub(v.mul(h)),d=m.sub(v.mul(p));var w=y.sub(v.mul(b));if(!n&&s.cmp(u)<0)t=o.neg(),r=p,n=s.neg(),f=d;else if(n&&2==++g)break;o=s,l=h,h=s,m=p,p=d,y=b,b=w}c=s.neg(),a=d;var M=n.sqr().add(f.sqr());return c.sqr().add(a.sqr()).cmp(M)>=0&&(c=t,a=r),n.negative&&(n=n.neg(),f=f.neg()),c.negative&&(c=c.neg(),a=a.neg()),[{a:n,b:f},{a:c,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),f=r.b.neg().mul(e).divRound(this.n),c=i.mul(r.a),a=f.mul(n.a),o=i.mul(r.b),s=f.mul(n.b);return{k1:e.sub(c).sub(a),k2:o.add(s).neg()}},o.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 f=n.fromRed().isOdd();return(t&&!f||!t&&f)&&(n=n.redNeg()),this.point(e,n)},o.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)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,f=0;f<e.length;f++){var c=this._endoSplit(t[f]),a=e[f],o=a._getBeta();c.k1.negative&&(c.k1.ineg(),a=a.neg(!0)),c.k2.negative&&(c.k2.ineg(),o=o.neg(!0)),n[2*f]=a,n[2*f+1]=o,i[2*f]=c.k1,i[2*f+1]=c.k2}for(var s=this._wnafMulAdd(1,n,i,2*f,r),d=0;d<2*f;d++)n[d]=null,i[d]=null;return s},f(s,c.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.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}},s.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]},s.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 f=t[2];return n.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[n].concat(f.doubles.points.map(i))},naf:f.naf&&{wnd:f.naf.wnd,points:[n].concat(f.naf.points.map(i))}},n},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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)},s.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),f=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,c)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.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)},s.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)},s.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))},s.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},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},f(d,c.BasePoint),o.prototype.jpoint=function(e,t,r){return new d(this,e,t,r)},d.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)},d.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},d.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),f=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),o=f.redSub(c);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),d=s.redMul(a),u=n.redMul(s),h=o.redSqr().redIAdd(d).redISub(u).redISub(u),l=o.redMul(u.redISub(h)).redISub(f.redMul(d)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,l,p)},d.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,f=e.y.redMul(t).redMul(this.z),c=r.redSub(n),a=i.redSub(f);if(0===c.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=c.redSqr(),s=o.redMul(c),d=r.redMul(o),u=a.redSqr().redIAdd(s).redISub(d).redISub(d),h=a.redMul(d.redISub(u)).redISub(i.redMul(s)),l=this.z.redMul(c);return this.curve.jpoint(u,h,l)},d.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a,i=this.curve.tinv,f=this.x,c=this.y,a=this.z,o=a.redSqr().redSqr(),s=c.redAdd(c);for(r=0;r<e;r++){var d=f.redSqr(),u=s.redSqr(),h=u.redSqr(),l=d.redAdd(d).redIAdd(d).redIAdd(n.redMul(o)),p=f.redMul(u),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),y=l.redMul(m);y=y.redIAdd(y).redISub(h);var g=s.redMul(a);r+1<e&&(o=o.redMul(h)),f=b,a=g,s=y}return this.curve.jpoint(f,s.redMul(i),a)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},d.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),f=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(f);c=c.redIAdd(c);var a=n.redAdd(n).redIAdd(n),o=a.redSqr().redISub(c).redISub(c),s=f.redIAdd(f);s=(s=s.redIAdd(s)).redIAdd(s),e=o,t=a.redMul(c.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),u=this.y.redSqr(),h=u.redSqr(),l=this.x.redAdd(u).redSqr().redISub(d).redISub(h);l=l.redIAdd(l);var p=d.redAdd(d).redIAdd(d),b=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},d.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),f=i.redSqr(),c=this.x.redAdd(i).redSqr().redISub(n).redISub(f);c=c.redIAdd(c);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),o=a.redSqr().redISub(c).redISub(c);e=o;var s=f.redIAdd(f);s=(s=s.redIAdd(s)).redIAdd(s),t=a.redMul(c.redISub(o)).redISub(s),r=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),u=this.y.redSqr(),h=this.x.redMul(u),l=this.x.redSub(d).redMul(this.x.redAdd(d));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(u).redISub(d);var m=u.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=l.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},d.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),f=t.redSqr(),c=r.redSqr(),a=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(i)),o=t.redAdd(t),s=(o=o.redIAdd(o)).redMul(c),d=a.redSqr().redISub(s.redAdd(s)),u=s.redISub(d),h=c.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=a.redMul(u).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(d,l,p)},d.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),f=i.redSqr(),c=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(c=(c=(c=c.redIAdd(c)).redAdd(c).redIAdd(c)).redISub(f)).redSqr(),o=n.redIAdd(n);o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);var s=i.redIAdd(c).redSqr().redISub(f).redISub(a).redISub(o),d=t.redMul(s);d=(d=d.redIAdd(d)).redIAdd(d);var u=this.x.redMul(a).redISub(d);u=(u=u.redIAdd(u)).redIAdd(u);var h=this.y.redMul(s.redMul(o.redISub(s)).redISub(c.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(c).redSqr().redISub(r).redISub(a);return this.curve.jpoint(u,h,l)},d.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},d.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)},d.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}},d.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)+">"},d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(80),i=r(9),f=r(168),c=r(52);function a(e){f.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 o(e,t,r){f.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(a,f),e.exports=a,a.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(o,f.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},a.prototype.point=function(e,t){return new o(this,e,t)},a.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.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)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.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)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),f=e.x.redSub(e.z).redMul(r),c=i.redMul(n),a=t.z.redMul(f.redAdd(c).redSqr()),o=t.x.redMul(f.redISub(c).redSqr());return this.curve.point(a,o)},o.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 f=i.length-1;f>=0;f--)0===i[f]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(52),i=r(80),f=r(9),c=r(168),a=n.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,c.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),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,t,r,n,f){c.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=f&&new i(f,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()))))}f(o,c),e.exports=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},o.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)),f=this.one.redSub(this.c2.redMul(this.d).redMul(r)),c=n.redMul(f.redInvm()),a=c.redSqrt();if(0!==a.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var o=a.fromRed().isOdd();return(t&&!o||!t&&o)&&(a=a.redNeg()),this.point(e,a)},o.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),f=r.redMul(this.d).redMul(this.c2).redSub(this.a),c=n.redMul(f.redInvm());if(0===c.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=c.redSqrt();if(0!==a.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},o.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)},f(s,c.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,n){return new s(this,e,t,r,n)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.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)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.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),f=n.redAdd(t),c=f.redSub(r),a=n.redSub(t),o=i.redMul(c),s=f.redMul(a),d=i.redMul(a),u=c.redMul(f);return this.curve.point(o,s,u,d)},s.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var c=(s=this.curve._mulA(i)).redAdd(f);if(this.zOne)e=n.redSub(i).redSub(f).redMul(c.redSub(this.curve.two)),t=c.redMul(s.redSub(f)),r=c.redSqr().redSub(c).redSub(c);else{var a=this.z.redSqr(),o=c.redSub(a).redISub(a);e=n.redSub(i).redISub(f).redMul(o),t=c.redMul(s.redSub(f)),r=c.redMul(o)}}else{var s=i.redAdd(f);a=this.curve._mulC(this.z).redSqr(),o=s.redSub(a).redSub(a);e=this.curve._mulC(n.redISub(s)).redMul(o),t=this.curve._mulC(s).redMul(i.redISub(f)),r=s.redMul(o)}return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.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)),f=r.redSub(t),c=i.redSub(n),a=i.redAdd(n),o=r.redAdd(t),s=f.redMul(c),d=a.redMul(o),u=f.redMul(o),h=c.redMul(a);return this.curve.point(s,d,h,u)},s.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),f=this.x.redMul(e.x),c=this.y.redMul(e.y),a=this.curve.d.redMul(f).redMul(c),o=i.redSub(a),s=i.redAdd(a),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(f).redISub(c),u=n.redMul(o).redMul(d);return this.curve.twisted?(t=n.redMul(s).redMul(c.redSub(this.curve._mulA(f))),r=o.redMul(s)):(t=n.redMul(s).redMul(c.redSub(f)),r=this.curve._mulC(o).redMul(s)),this.curve.point(u,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.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},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.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}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add},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(80),i=r(297),f=r(52),c=r(243),a=r(142),o=f.assert,s=r(658),d=r(659);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(c.hasOwnProperty(e),"Unknown curve "+e),e=c[e]),e instanceof c.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=u,u.prototype.keyPair=function(e){return new s(this,e)},u.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),f=this.n.sub(new n(2));;){var c=new n(t.generate(r));if(!(c.cmp(f)>0))return c.iaddn(1),this.keyFromPrivate(c)}},u.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},u.prototype.sign=function(e,t,r,f){"object"==typeof r&&(f=r,r=null),f||(f={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var c=this.n.byteLength(),a=t.getPrivate().toArray("be",c),o=e.toArray("be",c),s=new i({hash:this.hash,entropy:a,nonce:o,pers:f.pers,persEnc:f.persEnc||"utf8"}),u=this.n.sub(new n(1)),h=0;;h++){var l=f.k?f.k(h):new n(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return f.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),g^=1),new d({r:m,s:y,recoveryParam:g})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var f=(t=new d(t,"hex")).r,c=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var a,o=c.invm(this.n),s=o.mul(e).umod(this.n),u=o.mul(f).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(s,r.getPublic(),u)).isInfinity()&&a.eqXToP(f):!(a=this.g.mulAdd(s,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(f)},u.prototype.recoverPubKey=function(e,t,r,i){o((3&r)===r,"The recovery param is more than two bits"),t=new d(t,i);var f=this.n,c=new n(e),a=t.r,s=t.s,u=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(f),p=f.sub(c).mul(l).umod(f),b=s.mul(l).umod(f);return this.g.mulAdd(p,a,b)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new d(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var f;try{f=this.recoverPubKey(e,t,i)}catch(e){continue}if(f.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(80),i=r(52).assert;function f(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=f,f.fromPublic=function(e,t,r){return t instanceof f?t:new f(e,{pub:t,pubEnc:r})},f.fromPrivate=function(e,t,r){return t instanceof f?t:new f(e,{priv:t,privEnc:r})},f.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"}},f.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},f.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},f.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},f.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)},f.prototype.derive=function(e){return e.mul(this.priv).getX()},f.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},f.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},f.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(80),i=r(52),f=i.assert;function c(e,t){if(e instanceof c)return e;this._importDER(e,t)||(f(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 a(){this.place=0}function o(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,f=0,c=t.place;f<n;f++,c++)i<<=8,i|=e[c],i>>>=0;return!(i<=127)&&(t.place=c,i)}function s(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 d(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=c,c.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var f=o(e,r);if(!1===f)return!1;if(f+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var c=o(e,r);if(!1===c)return!1;var s=e.slice(r.place,c+r.place);if(r.place+=c,2!==e[r.place++])return!1;var d=o(e,r);if(!1===d)return!1;if(e.length!==d+r.place)return!1;var u=e.slice(r.place,d+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(s),this.s=new n(u),this.recoveryParam=null,!0},c.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=s(t),r=s(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];d(n,t.length),(n=n.concat(t)).push(2),d(n,r.length);var f=n.concat(r),c=[48];return d(c,f.length),c=c.concat(f),i.encode(c,e)}},function(e,t,r){"use strict";var n=r(66),i=r(243),f=r(52),c=f.assert,a=f.parseBytes,o=r(661),s=r(662);function d(e){if(c("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof d))return new d(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=d,d.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),f=this.encodePoint(i),c=this.hashInt(f,r.pubBytes(),e).mul(r.priv()),o=n.add(c).umod(this.curve.n);return this.makeSignature({R:i,S:o,Rencoded:f})},d.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),f=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(f)},d.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return f.intFromLE(e.digest()).umod(this.curve.n)},d.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},d.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},d.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},d.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},d.prototype.decodePoint=function(e){var t=(e=f.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=f.intFromLE(r);return this.curve.pointFromY(i,n)},d.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},d.prototype.decodeInt=function(e){return f.intFromLE(e)},d.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(52),i=n.assert,f=n.parseBytes,c=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=f(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=f(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},c(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),c(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),c(a,"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})),c(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),c(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),c(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},function(e,t,r){"use strict";var n=r(80),i=r(52),f=i.assert,c=i.cachedProperty,a=i.parseBytes;function o(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),f(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}c(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),c(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),c(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),c(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=o},function(e,t,r){"use strict";var n=r(337);t.certificate=r(670);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var f=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=f;var c=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));t.PublicKey=c;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),o=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=o;var s=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=s;var d=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=d,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var u=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=u;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(e,t){},function(e,t,r){"use strict";const n=r(339),i=r(341),f=r(9);function c(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new c(e,t)},c.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return f(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},c.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},c.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},c.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},c.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";const n=r(9),i=r(340);function f(e){i.call(this,e),this.enc="pem"}n(f,i),e.exports=f,f.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)n.push(r.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";const n=r(9),i=r(244).Buffer,f=r(342);function c(e){f.call(this,e),this.enc="pem"}n(c,f),e.exports=c,c.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),c=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,o=-1;for(let e=0;e<r.length;e++){const t=r[e].match(c);if(null!==t&&t[2]===n){if(-1!==a){if("END"!==t[1])break;o=e;break}if("BEGIN"!==t[1])break;a=e}}if(-1===a||-1===o)throw new Error("PEM section not found for: "+n);const s=r.slice(a+1,o).join("");s.replace(/[^a-z0-9+/=]+/gi,"");const d=i.from(s,"base64");return f.prototype.decode.call(this,d,t)}},function(e,t,r){"use strict";const n=t;n.Reporter=r(246).Reporter,n.DecoderBuffer=r(147).DecoderBuffer,n.EncoderBuffer=r(147).EncoderBuffer,n.Node=r(245)},function(e,t,r){"use strict";const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t},n.der=r(247)},function(e,t,r){"use strict";var n=r(337),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),f=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),c=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(c),this.key("subjectPublicKey").bitstr())})),o=n.define("RelativeDistinguishedName",(function(){this.setof(f)})),s=n.define("RDNSequence",(function(){this.seqof(o)})),d=n.define("Name",(function(){this.choice({rdnSequence:this.use(s)})})),u=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),l=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(c),this.key("issuer").use(d),this.key("validity").use(u),this.key("subject").use(d),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(c),this.key("signatureValue").bitstr())}));e.exports=p},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,c=r(167),a=r(238),o=r(11).Buffer;e.exports=function(e,t){var r,s=e.toString(),d=s.match(n);if(d){var u="aes"+d[1],h=o.from(d[2],"hex"),l=o.from(d[3].replace(/[\r\n]/g,""),"base64"),p=c(t,h.slice(0,8),parseInt(d[1],10)).key,b=[],m=a.createDecipheriv(u,p,h);b.push(m.update(l)),b.push(m.final()),r=o.concat(b)}else{var y=s.match(f);r=o.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:s.match(i)[1],data:r}}},function(e,t,r){var n=r(11).Buffer,i=r(20),f=r(242).ec,c=r(169),a=r(343);function o(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,s,d){var u=c(r);if("ec"===u.type){if("ecdsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new f(n),c=r.data.subjectPrivateKey.data;return i.verify(t,e,c)}(e,t,u)}if("dsa"===u.type){if("dsa"!==s)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,f=r.data.q,a=r.data.g,s=r.data.pub_key,d=c.signature.decode(e,"der"),u=d.s,h=d.r;o(u,f),o(h,f);var l=i.mont(n),p=u.invm(f);return 0===a.toRed(l).redPow(new i(t).mul(p).mod(f)).fromRed().mul(s.toRed(l).redPow(h.mul(p).mod(f)).fromRed()).mod(n).mod(f).cmp(h)}(e,t,u)}if("rsa"!==s&&"ecdsa/rsa"!==s)throw new Error("wrong public key type");t=n.concat([d,t]);for(var h=u.modulus.byteLength(),l=[1],p=0;t.length+l.length+2<h;)l.push(255),p++;l.push(0);for(var b=-1;++b<t.length;)l.push(t[b]);l=n.from(l);var m=i.mont(u.modulus);e=(e=new i(e).toRed(m)).redPow(new i(u.publicExponent)),e=n.from(e.fromRed().toArray());var y=p<8?1:0;for(h=Math.min(e.length,l.length),e.length!==l.length&&(y=1),b=-1;++b<h;)y|=e[b]^l[b];return 0===y}},function(e,t,r){(function(t){var n=r(242),i=r(675);e.exports=function(e){return new c(e)};var f={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function c(e){this.curveType=f[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length<n){var f=new t(n-i.length);f.fill(0),i=t.concat([f,i])}return r?i.toString(r):i}f.p224=f.secp224r1,f.p256=f.secp256r1=f.prime256v1,f.p192=f.secp192r1=f.prime192v1,f.p384=f.secp384r1,f.p521=f.secp521r1,c.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},c.prototype.computeSecret=function(e,r,n){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),a(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},c.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,e)},c.prototype.getPrivateKey=function(e){return a(this.keys.getPrivate(),e)},c.prototype.setPublicKey=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.keys._importPublic(e),this},c.prototype.setPrivateKey=function(e,r){r=r||"utf8",t.isBuffer(e)||(e=new t(e,r));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(19).Buffer)},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(676).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},function(e,t){},function(e,t,r){t.publicEncrypt=r(678),t.privateDecrypt=r(680),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){var n=r(169),i=r(116),f=r(144),c=r(344),a=r(345),o=r(248),s=r(346),d=r(241),u=r(11).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var l,p=n(e);if(4===h)l=function(e,t){var r=e.modulus.byteLength(),n=t.length,s=f("sha1").update(u.alloc(0)).digest(),d=s.length,h=2*d;if(n>r-h-2)throw new Error("message too long");var l=u.alloc(r-n-h-2),p=r-d-1,b=i(d),m=a(u.concat([s,l,u.alloc(1,1),t],p),c(b,p)),y=a(b,c(m,d));return new o(u.concat([u.alloc(1),y,m],r))}(p,t);else if(1===h)l=function(e,t,r){var n,f=t.length,c=e.modulus.byteLength();if(f>c-11)throw new Error("message too long");n=r?u.alloc(c-f-3,255):function(e){var t,r=u.allocUnsafe(e),n=0,f=i(2*e),c=0;for(;n<e;)c===f.length&&(f=i(2*e),c=0),(t=f[c++])&&(r[n++]=t);return r}(c-f-3);return new o(u.concat([u.from([0,r?1:2]),n,u.alloc(1),t],c))}(p,t,r);else{if(3!==h)throw new Error("unknown padding");if((l=new o(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?d(l,p):s(l,p)}},function(e,t){},function(e,t,r){var n=r(169),i=r(344),f=r(345),c=r(248),a=r(241),o=r(144),s=r(346),d=r(11).Buffer;e.exports=function(e,t,r){var u;u=e.padding?e.padding:r?1:4;var h,l=n(e),p=l.modulus.byteLength();if(t.length>p||new c(t).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?s(new c(t),l):a(t,l);var b=d.alloc(p-h.length);if(h=d.concat([b,h],p),4===u)return function(e,t){var r=e.modulus.byteLength(),n=o("sha1").update(d.alloc(0)).digest(),c=n.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,c+1),s=t.slice(c+1),u=f(a,i(s,c)),h=f(s,i(u,r-c-1));if(function(e,t){e=d.from(e),t=d.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,h.slice(0,c)))throw new Error("decryption error");var l=c;for(;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===u)return function(e,t,r){var n=t.slice(0,2),i=2,f=0;for(;0!==t[i++];)if(i>=t.length){f++;break}var c=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&f++;c.length<8&&f++;if(f)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===u)return h;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var f=r(11),c=r(116),a=f.Buffer,o=f.kMaxLength,s=e.crypto||e.msCrypto,d=Math.pow(2,32)-1;function u(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>d||e<0)throw new TypeError("offset must be a uint32");if(e>o||e>t)throw new RangeError("offset out of range")}function h(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>d||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>o)throw new RangeError("buffer too small")}function l(e,t,r,i){if(n.browser){var f=e.buffer,a=new Uint8Array(f,t,r);return s.getRandomValues(a),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return c(r).copy(e,t),e;c(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}s&&s.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(a.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return u(r,t.length),h(n,r,t.length),l(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(a.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');u(r,t.length),void 0===n&&(n=t.length-r);return h(n,r,t.length),l(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(32),r(26))},function(e,t,r){const n=r(228),{checkAndInit:i,smix:f}=r(347);e.exports=async function(e,t,r,c,a,o,s,d){const{XY:u,V:h,B32:l,x:p,_X:b,B:m,tickCallback:y}=i(e,t,r,c,a,o,s);for(var g=0;g<a;g++)await f(m,128*g*c,c,r,h,u,b,l,p,y,d);return n.pbkdf2Sync(e,m,1,o,"sha256")}},function(e,t,r){"use strict";(function(e){var t=r(130),n=r(196),i=r(172);Object(n.a)(i.a,e,[t.a])}).call(this,"/")},function(e,t,r){var n=r(249);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){var n=r(686),i=r(687);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},function(e,t,r){var n=r(348);function i(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function f(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var f=e[t+1]+n;i>=4294967296&&f++,e[t]=i,e[t+1]=f}function c(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,c,a){var o=u[c],s=u[c+1],h=u[a],l=u[a+1];i(d,e,t),f(d,e,o,s);var p=d[n]^d[e],b=d[n+1]^d[e+1];d[n]=b,d[n+1]=p,i(d,r,n),p=d[t]^d[r],b=d[t+1]^d[r+1],d[t]=p>>>24^b<<8,d[t+1]=b>>>24^p<<8,i(d,e,t),f(d,e,h,l),p=d[n]^d[e],b=d[n+1]^d[e+1],d[n]=p>>>16^b<<16,d[n+1]=b>>>16^p<<16,i(d,r,n),p=d[t]^d[r],b=d[t+1]^d[r+1],d[t]=b>>>31^p<<1,d[t+1]=p>>>31^b<<1}var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),d=new Uint32Array(32),u=new Uint32Array(32);function h(e,t){var r=0;for(r=0;r<16;r++)d[r]=e.h[r],d[r+16]=o[r];for(d[24]=d[24]^e.t,d[25]=d[25]^e.t/4294967296,t&&(d[28]=~d[28],d[29]=~d[29]),r=0;r<32;r++)u[r]=c(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,s[16*r+0],s[16*r+1]),a(2,10,18,26,s[16*r+2],s[16*r+3]),a(4,12,20,28,s[16*r+4],s[16*r+5]),a(6,14,22,30,s[16*r+6],s[16*r+7]),a(0,10,20,30,s[16*r+8],s[16*r+9]),a(2,12,22,24,s[16*r+10],s[16*r+11]),a(4,14,16,26,s[16*r+12],s[16*r+13]),a(6,8,18,28,s[16*r+14],s[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^d[r]^d[r+16]}function l(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=o[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(p(r,t),r.c=128),r}function p(e,t){for(var r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}function b(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function m(e,t,r){r=r||64,e=n.normalizeInput(e);var i=l(r,t);return p(i,e),b(i)}e.exports={blake2b:m,blake2bHex:function(e,t,r){var i=m(e,t,r);return n.toHex(i)},blake2bInit:l,blake2bUpdate:p,blake2bFinal:b}},function(e,t,r){var n=r(348);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function f(e,t,r,n,i,f){s[e]=s[e]+s[t]+i,s[n]=c(s[n]^s[e],16),s[r]=s[r]+s[n],s[t]=c(s[t]^s[r],12),s[e]=s[e]+s[t]+f,s[n]=c(s[n]^s[e],8),s[r]=s[r]+s[n],s[t]=c(s[t]^s[r],7)}function c(e,t){return e>>>t^e<<32-t}var a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),d=new Uint32Array(16);function u(e,t){var r=0;for(r=0;r<8;r++)s[r]=e.h[r],s[r+8]=a[r];for(s[12]^=e.t,s[13]^=e.t/4294967296,t&&(s[14]=~s[14]),r=0;r<16;r++)d[r]=i(e.b,4*r);for(r=0;r<10;r++)f(0,4,8,12,d[o[16*r+0]],d[o[16*r+1]]),f(1,5,9,13,d[o[16*r+2]],d[o[16*r+3]]),f(2,6,10,14,d[o[16*r+4]],d[o[16*r+5]]),f(3,7,11,15,d[o[16*r+6]],d[o[16*r+7]]),f(0,5,10,15,d[o[16*r+8]],d[o[16*r+9]]),f(1,6,11,12,d[o[16*r+10]],d[o[16*r+11]]),f(2,7,8,13,d[o[16*r+12]],d[o[16*r+13]]),f(3,4,9,14,d[o[16*r+14]],d[o[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=s[r]^s[r+8]}function h(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(a),b:new Uint32Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(l(n,t),n.c=64),n}function l(e,t){for(var r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;u(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);var i=h(r,t);return l(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){var i=b(e,t,r);return n.toHex(i)},blake2sInit:h,blake2sUpdate:l,blake2sFinal:p}},function(e,t,r){const{toLE:n}=r(349);class i extends Uint8Array{toJSON(){return{_type:"VecU8",data:Array.from(this)}}}class f extends Uint8Array{toJSON(){return{_type:"AccountId",data:Array.from(this)}}compare(e){return this.length===e.length&&this.every((t,r)=>e[r]===t)}memberOf(e){return void 0!==e.find(e=>this.compare(e))}}class c extends Uint8Array{toJSON(){return{_type:"Hash",data:Array.from(this)}}}class a extends Uint8Array{toJSON(){return{_type:"Signature",data:Array.from(this)}}}class o extends String{toJSON(){return{_type:"VoteThreshold",data:this+""}}}class s extends Number{toJSON(){return{_type:"BlockNumber",data:this+0}}}class d extends Number{toJSON(){return{_type:"AccountIndex",data:this+0}}}class u extends Array{toJSON(){return{_type:"Tuple",data:Array.from(this)}}}class h extends Number{toJSON(){return{_type:"SlashPreference",data:this+0}}}class l extends Number{toJSON(){return{_type:"Perbill",data:this+0}}}class p extends Number{toJSON(){return{_type:"Permill",data:this+0}}}class b extends Date{constructor(e){super(1e3*e),this.number=e}toJSON(){return{_type:"Moment",data:this.number}}}class m extends Number{toJSON(){return{_type:"Balance",data:this+0}}add(e){return new m(this+e)}sub(e){return new m(this-e)}}e.exports={VecU8:i,AccountId:f,Hash:c,Signature:a,VoteThreshold:o,SlashPreference:h,Moment:b,Balance:m,BlockNumber:s,AccountIndex:d,Tuple:u,TransactionEra:class{constructor(e,t){"number"==typeof e&&"number"==typeof t&&(this.period=2<<Math.min(15,Math.max(1,Math.ceil(Math.log2(e))-1)),this.phase=t%this.period)}encode(){if("number"==typeof this.period&&"number"==typeof this.phase){let e=Math.min(15,Math.max(1,Math.ceil(Math.log2(this.period))-1)),t=Math.max(1,this.period>>12);return n((Math.floor(this.phase/t)<<4)+e,2)}return new Uint8Array([0])}},Perbill:l,Permill:p,reviver:function(e,t){if("object"==typeof t&&t)switch(t._type){case"VecU8":return new i(t.data);case"AccountId":return new f(t.data);case"Hash":return new c(t.data);case"Signature":return new a(t.data);case"VoteThreshold":return new o(t.data);case"SlashPreference":return new h(t.data);case"Perbill":return new l(t.data);case"Permill":return new p(t.data);case"Moment":return new b(t.data);case"Tuple":return new u(t.data);case"Balance":return new m(t.data);case"BlockNumber":return new s(t.data);case"AccountIndex":return new d(t.data);case"Payee":return new Payee(t.data)}return t},RewardDestination:class extends String{toJSON(){return{_type:"RewardDestination",data:this+""}}}}},function(e,t,r){"use strict";(function(e){var t=r(362),n=r(363),i=r(130),f=r(196),c=r(129);Object(f.a)(c.a,e,[t.a,n.a,i.a])}).call(this,"/")},function(e,t,r){(function(t){var n=r(350).UINT32;n.prototype.xxh_update=function(e,t){var r,n,c=f._low,a=f._high;r=(n=e*c)>>>16,r+=t*c,r&=65535,r+=e*a;var o=this._low+(65535&n),s=o>>>16,d=(s+=this._high+(65535&r))<<16|65535&o;s=(d=d<<13|d>>>19)>>>16,r=(n=(o=65535&d)*(c=i._low))>>>16,r+=s*c,r&=65535,r+=o*(a=i._high),this._low=65535&n,this._high=65535&r};var i=n("2654435761"),f=n("2246822519"),c=n("3266489917"),a=n("668265263"),o=n("374761393");function s(){return 2==arguments.length?new s(arguments[1]).update(arguments[0]).digest():this instanceof s?void d.call(this,arguments[0]):new s(arguments[0])}function d(e){return this.seed=e instanceof n?e.clone():n(e),this.v1=this.seed.clone().add(i).add(f),this.v2=this.seed.clone().add(f),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(i),this.total_len=0,this.memsize=0,this.memory=null,this}s.prototype.init=d,s.prototype.update=function(e){var r,n="string"==typeof e;n&&(e=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e.charCodeAt(r);i<128?t.push(i):i<2048?t.push(192|i>>6,128|63&i):i<55296||i>=57344?t.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&e.charCodeAt(r)),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return new Uint8Array(t)}(e),n=!1,r=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(r=!0,e=new Uint8Array(e));var i=0,f=e.length,c=i+f;if(0==f)return this;if(this.total_len+=f,0==this.memsize&&(this.memory=n?"":r?new Uint8Array(16):new t(16)),this.memsize+f<16)return n?this.memory+=e:r?this.memory.set(e.subarray(0,f),this.memsize):e.copy(this.memory,this.memsize,0,f),this.memsize+=f,this;if(this.memsize>0){n?this.memory+=e.slice(0,16-this.memsize):r?this.memory.set(e.subarray(0,16-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,16-this.memsize);var a=0;n?(this.v1.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v2.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v3.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2)),a+=4,this.v4.xxh_update(this.memory.charCodeAt(a+1)<<8|this.memory.charCodeAt(a),this.memory.charCodeAt(a+3)<<8|this.memory.charCodeAt(a+2))):(this.v1.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v2.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v3.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2]),a+=4,this.v4.xxh_update(this.memory[a+1]<<8|this.memory[a],this.memory[a+3]<<8|this.memory[a+2])),i+=16-this.memsize,this.memsize=0,n&&(this.memory="")}if(i<=c-16){var o=c-16;do{n?(this.v1.xxh_update(e.charCodeAt(i+1)<<8|e.charCodeAt(i),e.charCodeAt(i+3)<<8|e.charCodeAt(i+2)),i+=4,this.v2.xxh_update(e.charCodeAt(i+1)<<8|e.charCodeAt(i),e.charCodeAt(i+3)<<8|e.charCodeAt(i+2)),i+=4,this.v3.xxh_update(e.charCodeAt(i+1)<<8|e.charCodeAt(i),e.charCodeAt(i+3)<<8|e.charCodeAt(i+2)),i+=4,this.v4.xxh_update(e.charCodeAt(i+1)<<8|e.charCodeAt(i),e.charCodeAt(i+3)<<8|e.charCodeAt(i+2))):(this.v1.xxh_update(e[i+1]<<8|e[i],e[i+3]<<8|e[i+2]),i+=4,this.v2.xxh_update(e[i+1]<<8|e[i],e[i+3]<<8|e[i+2]),i+=4,this.v3.xxh_update(e[i+1]<<8|e[i],e[i+3]<<8|e[i+2]),i+=4,this.v4.xxh_update(e[i+1]<<8|e[i],e[i+3]<<8|e[i+2])),i+=4}while(i<=o)}return i<c&&(n?this.memory+=e.slice(i):r?this.memory.set(e.subarray(i,c),this.memsize):e.copy(this.memory,this.memsize,i,c),this.memsize=c-i),this},s.prototype.digest=function(){var e,t,r=this.memory,s="string"==typeof r,d=0,u=this.memsize,h=new n;for((e=this.total_len>=16?this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):this.seed.clone().add(o)).add(h.fromNumber(this.total_len));d<=u-4;)s?h.fromBits(r.charCodeAt(d+1)<<8|r.charCodeAt(d),r.charCodeAt(d+3)<<8|r.charCodeAt(d+2)):h.fromBits(r[d+1]<<8|r[d],r[d+3]<<8|r[d+2]),e.add(h.multiply(c)).rotl(17).multiply(a),d+=4;for(;d<u;)h.fromBits(s?r.charCodeAt(d++):r[d++],0),e.add(h.multiply(o)).rotl(11).multiply(i);return t=e.clone().shiftRight(15),e.xor(t).multiply(f),t=e.clone().shiftRight(13),e.xor(t).multiply(c),t=e.clone().shiftRight(16),e.xor(t),this.init(this.seed),e},e.exports=s}).call(this,r(19).Buffer)},function(e,t,r){var n;!function(r){i(Math.pow(36,5)),i(Math.pow(16,7)),i(Math.pow(10,9)),i(Math.pow(2,30)),i(36),i(16),i(10),i(2);function i(e,t){return this instanceof i?(this._low=0,this._high=0,this.remainder=null,void 0===t?c.call(this,e):"string"==typeof e?a.call(this,e,t):void f.call(this,e,t)):new i(e,t)}function f(e,t){return this._low=0|e,this._high=0|t,this}function c(e){return this._low=65535&e,this._high=e>>>16,this}function a(e,t){var r=parseInt(e,t||10);return this._low=65535&r,this._high=r>>>16,this}i.prototype.fromBits=f,i.prototype.fromNumber=c,i.prototype.fromString=a,i.prototype.toNumber=function(){return 65536*this._high+this._low},i.prototype.toString=function(e){return this.toNumber().toString(e||10)},i.prototype.add=function(e){var t=this._low+e._low,r=t>>>16;return r+=this._high+e._high,this._low=65535&t,this._high=65535&r,this},i.prototype.subtract=function(e){return this.add(e.clone().negate())},i.prototype.multiply=function(e){var t,r,n=this._high,i=this._low,f=e._high,c=e._low;return t=(r=i*c)>>>16,t+=n*c,t&=65535,t+=i*f,this._low=65535&r,this._high=65535&t,this},i.prototype.div=function(e){if(0==e._low&&0==e._high)throw Error("division by zero");if(0==e._high&&1==e._low)return this.remainder=new i(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new i(0),this._low=1,this._high=0,this;for(var t=e.clone(),r=-1;!this.lt(t);)t.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._low=0,this._high=0;r>=0;r--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),r>=16?this._high|=1<<r-16:this._low|=1<<r);return this},i.prototype.negate=function(){var e=1+(65535&~this._low);return this._low=65535&e,this._high=~this._high+(e>>>16)&65535,this},i.prototype.equals=i.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},i.prototype.greaterThan=i.prototype.gt=function(e){return this._high>e._high||!(this._high<e._high)&&this._low>e._low},i.prototype.lessThan=i.prototype.lt=function(e){return this._high<e._high||!(this._high>e._high)&&this._low<e._low},i.prototype.or=function(e){return this._low|=e._low,this._high|=e._high,this},i.prototype.and=function(e){return this._low&=e._low,this._high&=e._high,this},i.prototype.not=function(){return this._low=65535&~this._low,this._high=65535&~this._high,this},i.prototype.xor=function(e){return this._low^=e._low,this._high^=e._high,this},i.prototype.shiftRight=i.prototype.shiftr=function(e){return e>16?(this._low=this._high>>e-16,this._high=0):16==e?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},i.prototype.shiftLeft=i.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<<e-16,this._low=0,t||(this._high&=65535)):16==e?(this._high=this._low,this._low=0):(this._high=this._high<<e|this._low>>16-e,this._low=this._low<<e&65535,t||(this._high&=65535)),this},i.prototype.rotateLeft=i.prototype.rotl=function(e){var t=this._high<<16|this._low;return t=t<<e|t>>>32-e,this._low=65535&t,this._high=t>>>16,this},i.prototype.rotateRight=i.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=65535&t,this._high=t>>>16,this},i.prototype.clone=function(){return new i(this._low,this._high)},void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){var n;!function(r){var i={16:c(Math.pow(16,5)),10:c(Math.pow(10,5)),2:c(Math.pow(2,5))},f={16:c(16),10:c(10),2:c(2)};function c(e,t,r,n){return this instanceof c?(this.remainder=null,"string"==typeof e?s.call(this,e,t):void 0===t?o.call(this,e):void a.apply(this,arguments)):new c(e,t,r,n)}function a(e,t,r,n){return void 0===r?(this._a00=65535&e,this._a16=e>>>16,this._a32=65535&t,this._a48=t>>>16,this):(this._a00=0|e,this._a16=0|t,this._a32=0|r,this._a48=0|n,this)}function o(e){return this._a00=65535&e,this._a16=e>>>16,this._a32=0,this._a48=0,this}function s(e,t){t=t||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var r=i[t]||new c(Math.pow(t,5)),n=0,f=e.length;n<f;n+=5){var a=Math.min(5,f-n),o=parseInt(e.slice(n,n+a),t);this.multiply(a<5?new c(Math.pow(t,a)):r).add(new c(o))}return this}c.prototype.fromBits=a,c.prototype.fromNumber=o,c.prototype.fromString=s,c.prototype.toNumber=function(){return 65536*this._a16+this._a00},c.prototype.toString=function(e){var t=f[e=e||10]||new c(e);if(!this.gt(t))return this.toNumber().toString(e);for(var r=this.clone(),n=new Array(64),i=63;i>=0&&(r.div(t),n[i]=r.remainder.toNumber().toString(e),r.gt(t));i--);return n[i-1]=r.toNumber().toString(e),n.join("")},c.prototype.add=function(e){var t=this._a00+e._a00,r=t>>>16,n=(r+=this._a16+e._a16)>>>16,i=(n+=this._a32+e._a32)>>>16;return i+=this._a48+e._a48,this._a00=65535&t,this._a16=65535&r,this._a32=65535&n,this._a48=65535&i,this},c.prototype.subtract=function(e){return this.add(e.clone().negate())},c.prototype.multiply=function(e){var t=this._a00,r=this._a16,n=this._a32,i=this._a48,f=e._a00,c=e._a16,a=e._a32,o=t*f,s=o>>>16,d=(s+=t*c)>>>16;s&=65535,d+=(s+=r*f)>>>16;var u=(d+=t*a)>>>16;return d&=65535,u+=(d+=r*c)>>>16,d&=65535,u+=(d+=n*f)>>>16,u+=t*e._a48,u&=65535,u+=r*a,u&=65535,u+=n*c,u&=65535,u+=i*f,this._a00=65535&o,this._a16=65535&s,this._a32=65535&d,this._a48=65535&u,this},c.prototype.div=function(e){if(0==e._a16&&0==e._a32&&0==e._a48){if(0==e._a00)throw Error("division by zero");if(1==e._a00)return this.remainder=new c(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new c(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),r=-1;!this.lt(t);)t.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;r>=0;r--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),r>=48?this._a48|=1<<r-48:r>=32?this._a32|=1<<r-32:r>=16?this._a16|=1<<r-16:this._a00|=1<<r);return this},c.prototype.negate=function(){var e=1+(65535&~this._a00);return this._a00=65535&e,e=(65535&~this._a16)+(e>>>16),this._a16=65535&e,e=(65535&~this._a32)+(e>>>16),this._a32=65535&e,this._a48=~this._a48+(e>>>16)&65535,this},c.prototype.equals=c.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},c.prototype.greaterThan=c.prototype.gt=function(e){return this._a48>e._a48||!(this._a48<e._a48)&&(this._a32>e._a32||!(this._a32<e._a32)&&(this._a16>e._a16||!(this._a16<e._a16)&&this._a00>e._a00))},c.prototype.lessThan=c.prototype.lt=function(e){return this._a48<e._a48||!(this._a48>e._a48)&&(this._a32<e._a32||!(this._a32>e._a32)&&(this._a16<e._a16||!(this._a16>e._a16)&&this._a00<e._a00))},c.prototype.or=function(e){return this._a00|=e._a00,this._a16|=e._a16,this._a32|=e._a32,this._a48|=e._a48,this},c.prototype.and=function(e){return this._a00&=e._a00,this._a16&=e._a16,this._a32&=e._a32,this._a48&=e._a48,this},c.prototype.xor=function(e){return this._a00^=e._a00,this._a16^=e._a16,this._a32^=e._a32,this._a48^=e._a48,this},c.prototype.not=function(){return this._a00=65535&~this._a00,this._a16=65535&~this._a16,this._a32=65535&~this._a32,this._a48=65535&~this._a48,this},c.prototype.shiftRight=c.prototype.shiftr=function(e){return(e%=64)>=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=65535&(this._a32>>e|this._a48<<16-e),this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=65535&(this._a16>>e|this._a32<<16-e),this._a16=65535&(this._a32>>e|this._a48<<16-e),this._a32=this._a48>>e&65535,this._a48=0):(this._a00=65535&(this._a00>>e|this._a16<<16-e),this._a16=65535&(this._a16>>e|this._a32<<16-e),this._a32=65535&(this._a32>>e|this._a48<<16-e),this._a48=this._a48>>e&65535),this},c.prototype.shiftLeft=c.prototype.shiftl=function(e,t){return(e%=64)>=48?(this._a48=this._a00<<e-48,this._a32=0,this._a16=0,this._a00=0):e>=32?(e-=32,this._a48=this._a16<<e|this._a00>>16-e,this._a32=this._a00<<e&65535,this._a16=0,this._a00=0):e>=16?(e-=16,this._a48=this._a32<<e|this._a16>>16-e,this._a32=65535&(this._a16<<e|this._a00>>16-e),this._a16=this._a00<<e&65535,this._a00=0):(this._a48=this._a48<<e|this._a32>>16-e,this._a32=65535&(this._a32<<e|this._a16>>16-e),this._a16=65535&(this._a16<<e|this._a00>>16-e),this._a00=this._a00<<e&65535),t||(this._a48&=65535),this},c.prototype.rotateLeft=c.prototype.rotl=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var r=this._a48<<16|this._a32,n=this._a16<<16|this._a00,i=r<<e|n>>>32-e,f=n<<e|r>>>32-e;return this._a00=65535&f,this._a16=f>>>16,this._a32=65535&i,this._a48=i>>>16,this},c.prototype.rotateRight=c.prototype.rotr=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var r=this._a48<<16|this._a32,n=this._a16<<16|this._a00,i=r>>>e|n<<32-e,f=n>>>e|r<<32-e;return this._a00=65535&f,this._a16=f>>>16,this._a32=65535&i,this._a48=i>>>16,this},c.prototype.clone=function(){return new c(this._a00,this._a16,this._a32,this._a48)},void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){(function(t){var n=r(350).UINT64,i=n("11400714785074694791"),f=n("14029467366897019727"),c=n("1609587929392839161"),a=n("9650029242287828579"),o=n("2870177450012600261");function s(){return 2==arguments.length?new s(arguments[1]).update(arguments[0]).digest():this instanceof s?void d.call(this,arguments[0]):new s(arguments[0])}function d(e){return this.seed=e instanceof n?e.clone():n(e),this.v1=this.seed.clone().add(i).add(f),this.v2=this.seed.clone().add(f),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(i),this.total_len=0,this.memsize=0,this.memory=null,this}s.prototype.init=d,s.prototype.update=function(e){var r,c="string"==typeof e;c&&(e=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e.charCodeAt(r);i<128?t.push(i):i<2048?t.push(192|i>>6,128|63&i):i<55296||i>=57344?t.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&e.charCodeAt(r)),t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return new Uint8Array(t)}(e),c=!1,r=!0),"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&(r=!0,e=new Uint8Array(e));var a=0,o=e.length,s=a+o;if(0==o)return this;if(this.total_len+=o,0==this.memsize&&(this.memory=c?"":r?new Uint8Array(32):new t(32)),this.memsize+o<32)return c?this.memory+=e:r?this.memory.set(e.subarray(0,o),this.memsize):e.copy(this.memory,this.memsize,0,o),this.memsize+=o,this;if(this.memsize>0){c?this.memory+=e.slice(0,32-this.memsize):r?this.memory.set(e.subarray(0,32-this.memsize),this.memsize):e.copy(this.memory,this.memsize,0,32-this.memsize);var d=0;if(c)h=n(this.memory.charCodeAt(d+1)<<8|this.memory.charCodeAt(d),this.memory.charCodeAt(d+3)<<8|this.memory.charCodeAt(d+2),this.memory.charCodeAt(d+5)<<8|this.memory.charCodeAt(d+4),this.memory.charCodeAt(d+7)<<8|this.memory.charCodeAt(d+6)),this.v1.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory.charCodeAt(d+1)<<8|this.memory.charCodeAt(d),this.memory.charCodeAt(d+3)<<8|this.memory.charCodeAt(d+2),this.memory.charCodeAt(d+5)<<8|this.memory.charCodeAt(d+4),this.memory.charCodeAt(d+7)<<8|this.memory.charCodeAt(d+6)),this.v2.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory.charCodeAt(d+1)<<8|this.memory.charCodeAt(d),this.memory.charCodeAt(d+3)<<8|this.memory.charCodeAt(d+2),this.memory.charCodeAt(d+5)<<8|this.memory.charCodeAt(d+4),this.memory.charCodeAt(d+7)<<8|this.memory.charCodeAt(d+6)),this.v3.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory.charCodeAt(d+1)<<8|this.memory.charCodeAt(d),this.memory.charCodeAt(d+3)<<8|this.memory.charCodeAt(d+2),this.memory.charCodeAt(d+5)<<8|this.memory.charCodeAt(d+4),this.memory.charCodeAt(d+7)<<8|this.memory.charCodeAt(d+6)),this.v4.add(h.multiply(f)).rotl(31).multiply(i);else h=n(this.memory[d+1]<<8|this.memory[d],this.memory[d+3]<<8|this.memory[d+2],this.memory[d+5]<<8|this.memory[d+4],this.memory[d+7]<<8|this.memory[d+6]),this.v1.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory[d+1]<<8|this.memory[d],this.memory[d+3]<<8|this.memory[d+2],this.memory[d+5]<<8|this.memory[d+4],this.memory[d+7]<<8|this.memory[d+6]),this.v2.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory[d+1]<<8|this.memory[d],this.memory[d+3]<<8|this.memory[d+2],this.memory[d+5]<<8|this.memory[d+4],this.memory[d+7]<<8|this.memory[d+6]),this.v3.add(h.multiply(f)).rotl(31).multiply(i),d+=8,h=n(this.memory[d+1]<<8|this.memory[d],this.memory[d+3]<<8|this.memory[d+2],this.memory[d+5]<<8|this.memory[d+4],this.memory[d+7]<<8|this.memory[d+6]),this.v4.add(h.multiply(f)).rotl(31).multiply(i);a+=32-this.memsize,this.memsize=0,c&&(this.memory="")}if(a<=s-32){var u=s-32;do{var h;if(c)h=n(e.charCodeAt(a+1)<<8|e.charCodeAt(a),e.charCodeAt(a+3)<<8|e.charCodeAt(a+2),e.charCodeAt(a+5)<<8|e.charCodeAt(a+4),e.charCodeAt(a+7)<<8|e.charCodeAt(a+6)),this.v1.add(h.multiply(f)).rotl(31).multiply(i),a+=8,h=n(e.charCodeAt(a+1)<<8|e.charCodeAt(a),e.charCodeAt(a+3)<<8|e.charCodeAt(a+2),e.charCodeAt(a+5)<<8|e.charCodeAt(a+4),e.charCodeAt(a+7)<<8|e.charCodeAt(a+6)),this.v2.add(h.multiply(f)).rotl(31).multiply(i),a+=8,h=n(e.charCodeAt(a+1)<<8|e.charCodeAt(a),e.charCodeAt(a+3)<<8|e.charCodeAt(a+2),e.charCodeAt(a+5)<<8|e.charCodeAt(a+4),e.charCodeAt(a+7)<<8|e.charCodeAt(a+6)),this.v3.add(h.multiply(f)).rotl(31).multiply(i),a+=8,h=n(e.charCodeAt(a+1)<<8|e.charCodeAt(a),e.charCodeAt(a+3)<<8|e.charCodeAt(a+2),e.charCodeAt(a+5)<<8|e.charCodeAt(a+4),e.charCodeAt(a+7)<<8|e.charCodeAt(a+6)),this.v4.add(h.multiply(f)).rotl(31).multiply(i);else h=n(e[a+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),this.v1.add(h.multiply(f)).rotl(31).multiply(i),h=n(e[(a+=8)+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),this.v2.add(h.multiply(f)).rotl(31).multiply(i),h=n(e[(a+=8)+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),this.v3.add(h.multiply(f)).rotl(31).multiply(i),h=n(e[(a+=8)+1]<<8|e[a],e[a+3]<<8|e[a+2],e[a+5]<<8|e[a+4],e[a+7]<<8|e[a+6]),this.v4.add(h.multiply(f)).rotl(31).multiply(i);a+=8}while(a<=u)}return a<s&&(c?this.memory+=e.slice(a):r?this.memory.set(e.subarray(a,s),this.memsize):e.copy(this.memory,this.memsize,a,s),this.memsize=s-a),this},s.prototype.digest=function(){var e,t,r=this.memory,s="string"==typeof r,d=0,u=this.memsize,h=new n;for(this.total_len>=32?((e=this.v1.clone().rotl(1)).add(this.v2.clone().rotl(7)),e.add(this.v3.clone().rotl(12)),e.add(this.v4.clone().rotl(18)),e.xor(this.v1.multiply(f).rotl(31).multiply(i)),e.multiply(i).add(a),e.xor(this.v2.multiply(f).rotl(31).multiply(i)),e.multiply(i).add(a),e.xor(this.v3.multiply(f).rotl(31).multiply(i)),e.multiply(i).add(a),e.xor(this.v4.multiply(f).rotl(31).multiply(i)),e.multiply(i).add(a)):e=this.seed.clone().add(o),e.add(h.fromNumber(this.total_len));d<=u-8;)s?h.fromBits(r.charCodeAt(d+1)<<8|r.charCodeAt(d),r.charCodeAt(d+3)<<8|r.charCodeAt(d+2),r.charCodeAt(d+5)<<8|r.charCodeAt(d+4),r.charCodeAt(d+7)<<8|r.charCodeAt(d+6)):h.fromBits(r[d+1]<<8|r[d],r[d+3]<<8|r[d+2],r[d+5]<<8|r[d+4],r[d+7]<<8|r[d+6]),h.multiply(f).rotl(31).multiply(i),e.xor(h).rotl(27).multiply(i).add(a),d+=8;for(d+4<=u&&(s?h.fromBits(r.charCodeAt(d+1)<<8|r.charCodeAt(d),r.charCodeAt(d+3)<<8|r.charCodeAt(d+2),0,0):h.fromBits(r[d+1]<<8|r[d],r[d+3]<<8|r[d+2],0,0),e.xor(h.multiply(i)).rotl(23).multiply(f).add(c),d+=4);d<u;)h.fromBits(s?r.charCodeAt(d++):r[d++],0,0,0),e.xor(h.multiply(o)).rotl(11).multiply(i);return t=e.clone().shiftRight(33),e.xor(t).multiply(f),t=e.clone().shiftRight(29),e.xor(t).multiply(c),t=e.clone().shiftRight(32),e.xor(t),this.init(this.seed),e},e.exports=s}).call(this,r(19).Buffer)},function(e,t,r){"use strict";(function(e){var t=r(151),n=r(129),i=r(130),f=r(196),c=r(181);Object(f.a)(c.a,e,[t.a,n.a,i.a])}).call(this,"/")},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"__wbindgen_is_undefined",(function(){return Oi})),r.d(n,"__wbg_self_1b7a39e3a92c949c",(function(){return xi})),r.d(n,"__wbg_require_604837428532a733",(function(){return Si})),r.d(n,"__wbg_crypto_968f1772287e2df0",(function(){return ki})),r.d(n,"__wbg_getRandomValues_a3d34b4fee3c2869",(function(){return ji})),r.d(n,"__wbg_getRandomValues_f5e14ab7ac8e995d",(function(){return Pi})),r.d(n,"__wbg_randomFillSync_d5bd2d655fdf256a",(function(){return Ai})),r.d(n,"__wbindgen_object_drop_ref",(function(){return Ei})),r.d(n,"abort",(function(){return Ii}));var i={};r.r(i),r.d(i,"GenericExtrinsic",(function(){return Hf})),r.d(i,"GenericExtrinsicEra",(function(){return $f})),r.d(i,"GenericMortalEra",(function(){return Qf})),r.d(i,"GenericImmortalEra",(function(){return Jf})),r.d(i,"GenericExtrinsicPayload",(function(){return tc})),r.d(i,"GenericExtrinsicPayloadUnknown",(function(){return rc})),r.d(i,"GenericExtrinsicUnknown",(function(){return nc})),r.d(i,"GenericSignerPayload",(function(){return ac})),r.d(i,"GenericExtrinsicV4",(function(){return oc})),r.d(i,"GenericExtrinsicPayloadV4",(function(){return hc})),r.d(i,"GenericExtrinsicSignatureV4",(function(){return gc})),r.d(i,"GenericEthereumAccountId",(function(){return Ic})),r.d(i,"GenericEthereumLookupSource",(function(){return Zc})),r.d(i,"GenericAccountId",(function(){return Yc})),r.d(i,"GenericAccountIndex",(function(){return Kc})),r.d(i,"GenericBlock",(function(){return Jc})),r.d(i,"GenericCall",(function(){return Fa})),r.d(i,"GenericChainProperties",(function(){return Xa})),r.d(i,"GenericConsensusEngineId",(function(){return Qa})),r.d(i,"GenericEvent",(function(){return Af})),r.d(i,"GenericEventData",(function(){return Pf})),r.d(i,"GenericLookupSource",(function(){return eo})),r.d(i,"GenericMultiAddress",(function(){return ro})),r.d(i,"GenericAddress",(function(){return ro})),r.d(i,"GenericVote",(function(){return co})),r.d(i,"BitVec",(function(){return oo})),r.d(i,"bool",(function(){return no})),r.d(i,"Bool",(function(){return no})),r.d(i,"Bytes",(function(){return uo})),r.d(i,"Data",(function(){return lo})),r.d(i,"DoNotConstruct",(function(){return Ia})),r.d(i,"i8",(function(){return po})),r.d(i,"I8",(function(){return po})),r.d(i,"i16",(function(){return bo})),r.d(i,"I16",(function(){return bo})),r.d(i,"i32",(function(){return mo})),r.d(i,"I32",(function(){return mo})),r.d(i,"i64",(function(){return yo})),r.d(i,"I64",(function(){return yo})),r.d(i,"i128",(function(){return go})),r.d(i,"I128",(function(){return go})),r.d(i,"i256",(function(){return vo})),r.d(i,"I256",(function(){return vo})),r.d(i,"Null",(function(){return wf})),r.d(i,"StorageKey",(function(){return xo})),r.d(i,"Text",(function(){return ko})),r.d(i,"Type",(function(){return jo})),r.d(i,"u8",(function(){return Po})),r.d(i,"U8",(function(){return Po})),r.d(i,"u16",(function(){return Ao})),r.d(i,"U16",(function(){return Ao})),r.d(i,"u32",(function(){return Ir})),r.d(i,"U32",(function(){return Ir})),r.d(i,"u64",(function(){return Yf})),r.d(i,"U64",(function(){return Yf})),r.d(i,"u128",(function(){return Eo})),r.d(i,"U128",(function(){return Eo})),r.d(i,"u256",(function(){return Io})),r.d(i,"U256",(function(){return Io})),r.d(i,"usize",(function(){return To})),r.d(i,"USize",(function(){return To}));var f={};r.r(f),r.d(f,"runtime",(function(){return _o})),r.d(f,"assets",(function(){return Co})),r.d(f,"authorship",(function(){return Bo})),r.d(f,"aura",(function(){return Ho})),r.d(f,"babe",(function(){return Do})),r.d(f,"balances",(function(){return Lo})),r.d(f,"beefy",(function(){return zo})),r.d(f,"collective",(function(){return Vo})),r.d(f,"consensus",(function(){return qo})),r.d(f,"contracts",(function(){return Uo})),r.d(f,"democracy",(function(){return Fo})),r.d(f,"elections",(function(){return Wo})),r.d(f,"engine",(function(){return Ko})),r.d(f,"evm",(function(){return Xo})),r.d(f,"extrinsics",(function(){return Zo})),r.d(f,"genericAsset",(function(){return Go})),r.d(f,"gilt",(function(){return Yo})),r.d(f,"grandpa",(function(){return Jo})),r.d(f,"identity",(function(){return Qo})),r.d(f,"imOnline",(function(){return $o})),r.d(f,"lottery",(function(){return es})),r.d(f,"mmr",(function(){return ts})),r.d(f,"offences",(function(){return rs})),r.d(f,"proxy",(function(){return ns})),r.d(f,"recovery",(function(){return is})),r.d(f,"scheduler",(function(){return fs})),r.d(f,"session",(function(){return os})),r.d(f,"society",(function(){return ss})),r.d(f,"staking",(function(){return hs})),r.d(f,"support",(function(){return ls})),r.d(f,"syncstate",(function(){return ps})),r.d(f,"system",(function(){return bs})),r.d(f,"treasury",(function(){return ms})),r.d(f,"txpayment",(function(){return ys})),r.d(f,"uniques",(function(){return gs})),r.d(f,"utility",(function(){return vs})),r.d(f,"vesting",(function(){return ws})),r.d(f,"attestations",(function(){return Ms})),r.d(f,"bridges",(function(){return Os})),r.d(f,"claims",(function(){return xs})),r.d(f,"crowdloan",(function(){return Ss})),r.d(f,"cumulus",(function(){return js})),r.d(f,"parachains",(function(){return Rs})),r.d(f,"poll",(function(){return Ns})),r.d(f,"purchase",(function(){return _s})),r.d(f,"xcm",(function(){return Hs})),r.d(f,"contractsAbi",(function(){return zs})),r.d(f,"scaleInfo",(function(){return Vs})),r.d(f,"eth",(function(){return Fs})),r.d(f,"metadata",(function(){return Ws})),r.d(f,"rpc",(function(){return Ks})),r.d(f,"author",(function(){return Xs})),r.d(f,"chain",(function(){return Zs})),r.d(f,"childstate",(function(){return Gs})),r.d(f,"offchain",(function(){return Ys})),r.d(f,"payment",(function(){return Qs})),r.d(f,"state",(function(){return $s}));var c={};r.r(c),r.d(c,"accountId",(function(){return Bd})),r.d(c,"flags",(function(){return Hd})),r.d(c,"idAndIndex",(function(){return Dd})),r.d(c,"idToIndex",(function(){return Ld})),r.d(c,"identity",(function(){return qd})),r.d(c,"hasIdentity",(function(){return Ud})),r.d(c,"hasIdentityMulti",(function(){return Fd})),r.d(c,"indexToId",(function(){return Wd})),r.d(c,"indexes",(function(){return Xd})),r.d(c,"info",(function(){return Gd}));var a={};r.r(a),r.d(a,"account",(function(){return hu})),r.d(a,"fees",(function(){return lu})),r.d(a,"votingBalances",(function(){return pu})),r.d(a,"all",(function(){return nu})),r.d(a,"votingBalance",(function(){return bu}));var o={};r.r(o),r.d(o,"bounties",(function(){return gu}));var s={};r.r(s),r.d(s,"bestNumber",(function(){return vu})),r.d(s,"bestNumberFinalized",(function(){return wu})),r.d(s,"bestNumberLag",(function(){return Mu})),r.d(s,"getHeader",(function(){return Su})),r.d(s,"getBlock",(function(){return ju})),r.d(s,"subscribeNewBlocks",(function(){return Pu})),r.d(s,"subscribeNewHeads",(function(){return Au}));var d={};r.r(d),r.d(d,"fees",(function(){return Eu}));var u={};r.r(u),r.d(u,"members",(function(){return Ru})),r.d(u,"prime",(function(){return _u})),r.d(u,"hasProposals",(function(){return Vu})),r.d(u,"proposal",(function(){return qu})),r.d(u,"proposalCount",(function(){return Uu})),r.d(u,"proposalHashes",(function(){return Fu})),r.d(u,"proposals",(function(){return Wu})),r.d(u,"votes",(function(){return Gu})),r.d(u,"votesOf",(function(){return Yu}));var h={};r.r(h),r.d(h,"dispatchQueue",(function(){return rh})),r.d(h,"locks",(function(){return fh})),r.d(h,"nextExternal",(function(){return ch})),r.d(h,"preimage",(function(){return mh})),r.d(h,"preimages",(function(){return yh})),r.d(h,"proposals",(function(){return Mh})),r.d(h,"referendumIds",(function(){return Oh})),r.d(h,"referendums",(function(){return kh})),r.d(h,"referendumsActive",(function(){return jh})),r.d(h,"referendumsFinished",(function(){return Ph})),r.d(h,"_referendumVotes",(function(){return Rh})),r.d(h,"_referendumsVotes",(function(){return Nh})),r.d(h,"_referendumInfo",(function(){return _h})),r.d(h,"referendumsInfo",(function(){return Ch})),r.d(h,"sqrtElectorate",(function(){return Bh}));var l={};r.r(l),r.d(l,"info",(function(){return qh}));var p={};r.r(p),r.d(p,"receivedHeartbeats",(function(){return Fh}));var b={};r.r(b),r.d(b,"members",(function(){return Wh})),r.d(b,"prime",(function(){return Kh})),r.d(b,"hasProposals",(function(){return Xh})),r.d(b,"proposal",(function(){return Zh})),r.d(b,"proposalCount",(function(){return Gh})),r.d(b,"proposalHashes",(function(){return Yh})),r.d(b,"proposals",(function(){return Jh}));var m={};r.r(m),r.d(m,"info",(function(){return nl})),r.d(m,"overview",(function(){return al}));var y={};r.r(y),r.d(y,"eraLength",(function(){return ol})),r.d(y,"eraProgress",(function(){return sl})),r.d(y,"indexes",(function(){return ul})),r.d(y,"info",(function(){return pl})),r.d(y,"progress",(function(){return yl})),r.d(y,"sessionProgress",(function(){return gl}));var g={};r.r(g),r.d(g,"candidates",(function(){return vl})),r.d(g,"info",(function(){return wl})),r.d(g,"member",(function(){return Ml})),r.d(g,"_members",(function(){return Ol})),r.d(g,"members",(function(){return xl}));var v={};r.r(v),r.d(v,"accounts",(function(){return El})),r.d(v,"account",(function(){return Il})),r.d(v,"currentPoints",(function(){return Tl})),r.d(v,"_eraExposure",(function(){return _l})),r.d(v,"eraExposure",(function(){return Cl})),r.d(v,"_erasExposure",(function(){return Bl})),r.d(v,"erasExposure",(function(){return Hl})),r.d(v,"erasHistoric",(function(){return Dl})),r.d(v,"_erasPoints",(function(){return Vl})),r.d(v,"erasPoints",(function(){return ql})),r.d(v,"_eraPrefs",(function(){return Ul})),r.d(v,"eraPrefs",(function(){return Fl})),r.d(v,"_erasPrefs",(function(){return Wl})),r.d(v,"erasPrefs",(function(){return Kl})),r.d(v,"_erasRewards",(function(){return Xl})),r.d(v,"erasRewards",(function(){return Zl})),r.d(v,"_eraSlashes",(function(){return Gl})),r.d(v,"eraSlashes",(function(){return Yl})),r.d(v,"_erasSlashes",(function(){return Jl})),r.d(v,"erasSlashes",(function(){return Ql})),r.d(v,"electedInfo",(function(){return tp})),r.d(v,"keys",(function(){return rp})),r.d(v,"keysMulti",(function(){return np})),r.d(v,"overview",(function(){return cp})),r.d(v,"_ownExposures",(function(){return ap})),r.d(v,"ownExposure",(function(){return op})),r.d(v,"ownExposures",(function(){return sp})),r.d(v,"_ownSlashes",(function(){return dp})),r.d(v,"ownSlash",(function(){return up})),r.d(v,"ownSlashes",(function(){return hp})),r.d(v,"query",(function(){return pp})),r.d(v,"queryMulti",(function(){return bp})),r.d(v,"_stakerExposures",(function(){return mp})),r.d(v,"stakerExposures",(function(){return yp})),r.d(v,"stakerExposure",(function(){return gp})),r.d(v,"_stakerPoints",(function(){return vp})),r.d(v,"stakerPoints",(function(){return wp})),r.d(v,"_stakerPrefs",(function(){return Mp})),r.d(v,"stakerPrefs",(function(){return Op})),r.d(v,"_stakerRewardsEras",(function(){return jp})),r.d(v,"_stakerRewards",(function(){return Pp})),r.d(v,"stakerRewards",(function(){return Ap})),r.d(v,"stakerRewardsMultiEras",(function(){return Ep})),r.d(v,"stakerRewardsMulti",(function(){return Ip})),r.d(v,"_stakerSlashes",(function(){return Tp})),r.d(v,"stakerSlashes",(function(){return Rp})),r.d(v,"stashes",(function(){return Np})),r.d(v,"nextElected",(function(){return _p})),r.d(v,"validators",(function(){return Cp})),r.d(v,"waitingInfo",(function(){return Hp}));var w={};r.r(w),r.d(w,"members",(function(){return Dp})),r.d(w,"prime",(function(){return Lp})),r.d(w,"hasProposals",(function(){return zp})),r.d(w,"proposal",(function(){return Vp})),r.d(w,"proposalCount",(function(){return qp})),r.d(w,"proposalHashes",(function(){return Up})),r.d(w,"proposals",(function(){return Fp}));var M={};r.r(M),r.d(M,"proposals",(function(){return Wp}));var O={};r.r(O),r.d(O,"events",(function(){return Kp})),r.d(O,"signingInfo",(function(){return $p}));r(381);function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var k=0;function j(e){return"__private_"+k+++"_"+e}var P=r(187),A=r.n(P),E=r(712),I=r(92),T=r(37);function R(e){return null===e}var N=r(45);const _=N.a.WebSocket;var C=r(91);function B(e){return"bigint"==typeof e}function H(e,t){return JSON.stringify(e,(e,t)=>B(t)?t.toString():t,t)}function D(e){return"number"==typeof e}var L=j("id");class z{constructor(){Object.defineProperty(this,L,{writable:!0,value:0})}decodeResponse(e){Object(T.a)(e,"Empty response object received"),Object(T.a)("2.0"===e.jsonrpc,"Invalid jsonrpc field in decoded object");const t=!Object(I.a)(e.params)&&!Object(I.a)(e.method);return Object(T.a)(D(e.id)||t&&(D(e.params.subscription)||Object(C.a)(e.params.subscription)),"Invalid id field in decoded object"),this._checkError(e.error),Object(T.a)(!Object(I.a)(e.result)||t,"No result found in JsonRpc response"),t?(this._checkError(e.params.error),e.params.result):e.result}encodeJson(e,t){return H(this.encodeObject(e,t))}encodeObject(e,t){return{id:++S(this,L)[L],jsonrpc:"2.0",method:e,params:t}}getId(){return S(this,L)[L]}_checkError(e){if(e){const{code:t,data:r,message:n}=e;throw new Error(`${t}: ${n}${function(e){if(Object(I.a)(e))return"";const t=": "+(Object(C.a)(e)?e.replace(/Error\("/g,"").replace(/\("/g,"(").replace(/"\)/g,")").replace(/\(/g,", ").replace(/\)/g,""):H(e));return t.length<=256?t:t.substr(0,255)+"…"}(r)}`)}}}var V="ws://127.0.0.1:9944";const q={1e3:"Normal Closure",1001:"Going Away",1002:"Protocol Error",1003:"Unsupported Data",1004:"(For future)",1005:"No Status Received",1006:"Abnormal Closure",1007:"Invalid frame payload data",1008:"Policy Violation",1009:"Message too big",1010:"Missing Extension",1011:"Internal Error",1012:"Service Restart",1013:"Try Again Later",1014:"Bad Gateway",1015:"TLS Handshake"};function U(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const W={chain_finalisedHead:"chain_finalizedHead",chain_subscribeFinalisedHeads:"chain_subscribeFinalizedHeads",chain_unsubscribeFinalisedHeads:"chain_unsubscribeFinalizedHeads"},K=Object(E.a)("api-ws");function X(e,t){Object.keys(e).forEach(r=>{t&&t(e[r]),delete e[r]})}var Z=j("coder"),G=j("endpoints"),Y=j("headers"),J=j("eventemitter"),Q=j("handlers"),$=j("isReadyPromise"),ee=j("waitingForId"),te=j("autoConnectMs"),re=j("endpointIndex"),ne=j("isConnected"),ie=j("subscriptions"),fe=j("websocket"),ce=j("emit"),ae=j("onSocketClose"),oe=j("onSocketError"),se=j("onSocketMessage"),de=j("onSocketMessageResult"),ue=j("onSocketMessageSubscribe"),he=j("onSocketOpen"),le=j("resubscribe");class pe{constructor(e=V,t=2500,r={}){Object.defineProperty(this,Z,{writable:!0,value:void 0}),Object.defineProperty(this,G,{writable:!0,value:void 0}),Object.defineProperty(this,Y,{writable:!0,value:void 0}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,Q,{writable:!0,value:{}}),Object.defineProperty(this,$,{writable:!0,value:void 0}),Object.defineProperty(this,ee,{writable:!0,value:{}}),Object.defineProperty(this,te,{writable:!0,value:void 0}),Object.defineProperty(this,re,{writable:!0,value:void 0}),Object.defineProperty(this,ne,{writable:!0,value:!1}),Object.defineProperty(this,ie,{writable:!0,value:{}}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ce,{writable:!0,value:(e,...t)=>{S(this,J)[J].emit(e,...t)}}),Object.defineProperty(this,ae,{writable:!0,value:e=>{const t=new Error(`disconnected from ${S(this,G)[G][S(this,re)[re]]}: ${e.code}:: ${e.reason||(r=e.code,r>=0&&r<=999?"(Unused)":q[r]||function(e){return e<=1999?"(For WebSocket standard)":e<=2999?"(For WebSocket extensions)":e<=3999?"(For libraries and frameworks)":e<=4999?"(For applications)":void 0}(r)||"(Unknown)")}`);var r;S(this,te)[te]>0&&K.error(t.message),S(this,ne)[ne]=!1,S(this,fe)[fe]&&(S(this,fe)[fe].onclose=null,S(this,fe)[fe].onerror=null,S(this,fe)[fe].onmessage=null,S(this,fe)[fe].onopen=null,S(this,fe)[fe]=null),S(this,ce)[ce]("disconnected"),X(S(this,Q)[Q],e=>e.callback(t,void 0)),X(S(this,ee)[ee]),S(this,te)[te]>0&&setTimeout(()=>{this.connectWithRetry().catch(()=>{})},S(this,te)[te])}}),Object.defineProperty(this,oe,{writable:!0,value:e=>{K.debug(()=>["socket error",e]),S(this,ce)[ce]("error",e)}}),Object.defineProperty(this,se,{writable:!0,value:e=>{K.debug(()=>["received",e.data]);const t=JSON.parse(e.data);return Object(I.a)(t.method)?S(this,de)[de](t):S(this,ue)[ue](t)}}),Object.defineProperty(this,de,{writable:!0,value:e=>{const t=S(this,Q)[Q][e.id];if(t){try{const{method:r,params:n,subscription:i}=t,f=S(this,Z)[Z].decodeResponse(e);if(t.callback(null,f),i){const e=`${i.type}::${f}`;S(this,ie)[ie][e]=F(F({},i),{},{method:r,params:n}),S(this,ee)[ee][e]&&S(this,ue)[ue](S(this,ee)[ee][e])}}catch(e){t.callback(e,void 0)}delete S(this,Q)[Q][e.id]}else K.debug(()=>"Unable to find handler for id="+e.id)}}),Object.defineProperty(this,ue,{writable:!0,value:e=>{const t=`${W[e.method]||e.method||"invalid"}::${e.params.subscription}`,r=S(this,ie)[ie][t];if(!r)return S(this,ee)[ee][t]=e,void K.debug(()=>"Unable to find handler for subscription="+t);delete S(this,ee)[ee][t];try{const t=S(this,Z)[Z].decodeResponse(e);r.callback(null,t)}catch(e){r.callback(e,void 0)}}}),Object.defineProperty(this,he,{writable:!0,value:()=>(Object(T.a)(!R(S(this,fe)[fe]),"WebSocket cannot be null in onOpen"),K.debug(()=>["connected to",S(this,G)[G][S(this,re)[re]]]),S(this,ne)[ne]=!0,S(this,ce)[ce]("connected"),S(this,le)[le](),!0)}),Object.defineProperty(this,le,{writable:!0,value:()=>{const e=S(this,ie)[ie];S(this,ie)[ie]={},Promise.all(Object.keys(e).map(async t=>{const{callback:r,method:n,params:i,type:f}=e[t];if(!f.startsWith("author_"))try{await this.subscribe(f,n,i,r)}catch(e){K.error(e)}})).catch(K.error)}});const n=Array.isArray(e)?e:[e];Object(T.a)(0!==n.length,"WsProvider requires at least one Endpoint"),n.forEach(e=>{Object(T.a)(/^(wss|ws):\/\//.test(e),()=>`Endpoint should start with 'ws://', received '${e}'`)}),S(this,J)[J]=new A.a,S(this,te)[te]=t||0,S(this,Z)[Z]=new z,S(this,re)[re]=-1,S(this,G)[G]=n,S(this,Y)[Y]=r,S(this,fe)[fe]=null,t>0&&this.connectWithRetry().catch(()=>{}),S(this,$)[$]=new Promise(e=>{S(this,J)[J].once("connected",()=>{e(this)})})}get hasSubscriptions(){return!0}get isConnected(){return S(this,ne)[ne]}get isReady(){return S(this,$)[$]}clone(){return new pe(S(this,G)[G])}async connect(){try{S(this,re)[re]=(S(this,re)[re]+1)%S(this,G)[G].length,S(this,fe)[fe]=void 0!==N.a.WebSocket&&(e=N.a.WebSocket,(t=_)&&(e===t||e.isPrototypeOf(t)))?new _(S(this,G)[G][S(this,re)[re]]):new _(S(this,G)[G][S(this,re)[re]],void 0,void 0,S(this,Y)[Y],void 0,{fragmentOutgoingMessages:!0,fragmentationThreshold:262144,maxReceivedMessageSize:16777216}),S(this,fe)[fe].onclose=S(this,ae)[ae],S(this,fe)[fe].onerror=S(this,oe)[oe],S(this,fe)[fe].onmessage=S(this,se)[se],S(this,fe)[fe].onopen=S(this,he)[he]}catch(e){throw K.error(e),S(this,ce)[ce]("error",e),e}var e,t}async connectWithRetry(){if(S(this,te)[te]>0)try{await this.connect()}catch(e){setTimeout(()=>{this.connectWithRetry().catch(()=>{})},S(this,te)[te])}}async disconnect(){try{Object(T.a)(!R(S(this,fe)[fe]),"Cannot disconnect on a non-connected websocket"),S(this,te)[te]=0,S(this,fe)[fe].close(1e3)}catch(e){throw K.error(e),S(this,ce)[ce]("error",e),e}}on(e,t){return S(this,J)[J].on(e,t),()=>{S(this,J)[J].removeListener(e,t)}}send(e,t,r){return new Promise((n,i)=>{try{Object(T.a)(this.isConnected&&!R(S(this,fe)[fe]),"WebSocket is not connected");const f=S(this,Z)[Z].encodeJson(e,t),c=S(this,Z)[Z].getId(),a=(e,t)=>{e?i(e):n(t)};K.debug(()=>["calling",e,f]),S(this,Q)[Q][c]={callback:a,method:e,params:t,subscription:r},S(this,fe)[fe].send(f)}catch(e){i(e)}})}subscribe(e,t,r,n){return this.send(t,r,{callback:n,type:e})}async unsubscribe(e,t,r){const n=`${e}::${r}`;if(Object(I.a)(S(this,ie)[ie][n]))return K.debug(()=>"Unable to find active subscription="+n),!1;delete S(this,ie)[ie][n];try{return!(this.isConnected&&!R(S(this,fe)[fe]))||this.send(t,[r])}catch(e){return!1}}}var be=r(89),me=r(714),ye=r(715),ge=r(40),ve=r(134),we=r(151),Me=r(90),Oe=r(194),xe=r(351),Se=r(354),ke=r.n(Se);function je(e){return ke()(e.toString())}var Pe=r(184);function Ae(...e){let t=0,r=0;const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Object(ge.a)(e[r]),t+=n[r].length;const i=new Uint8Array(t);for(let e=0;e<n.length;e++)i.set(n[e],r),r+=n[e].length;return i}function Ee(e){return"boolean"==typeof e}function Ie(e,t,r,n){const[i,f]=Array.isArray(r)?[r,n||[]]:[Object.values(r),Object.keys(r)],c=[];let a=0;for(let r=0;r<i.length;r++){const n=i[r];try{const r=new n(e,t.subarray(a));c.push(r),a+=r.encodedLength}catch(i){let c;try{c=new n(e).toRawType()}catch{c=""}throw new Error(`decodeU8a: failed at ${Object(ve.a)(t.subarray(a).slice(0,8))}… on ${f[r]?""+f[r]:""}${c?": "+c:""}:: ${i.message}`)}}return c}function Te(e,t){return Object(C.a)(t)?e.createClass(t):t}function Re(e,t){return Object.entries(t).reduce((t,[r,n])=>(t[r]=Te(e,n),t),{})}function Ne(e){return Object(be.a)(e.eq)}function _e(e,t){return e.size===t.length&&!t.some(t=>{return r=t,!Array.isArray(r)||2!==r.length||function(e,t){return Object(I.a)(e)||(Ne(e)?!e.eq(t):e!==t)}(e.get(t[0]),t[1]);var r})}function Ce(e,t){return Array.isArray(t)?_e(e,t):t instanceof Map?_e(e,[...t.entries()]):!!Object(xe.a)(t)&&_e(e,Object.entries(t))}function Be(e,t,r,n){if(Object(Me.a)(r))return Be(e,t,Object(Pe.a)(r),n);if(Object(Oe.a)(r)){const n=Object.keys(t),i=Ie(e,r,Object.values(t),n);return n.reduce((e,t,r)=>(e[t]=i[r],e),{})}return r?function(e,t,r,n){let i;const f=Object.keys(t);return Object(T.a)(!Array.isArray(r)||r.length===f.length,()=>`Struct: Unable to map ${H(r)} array to object with known keys ${f.join(", ")}`),f.reduce((f,c,a)=>{const o=n.get(c)&&!r[c]?n.get(c):c;try{if(Array.isArray(r))f[c]=r[a]instanceof t[c]?r[a]:new t[c](e,r[a]);else if(r instanceof Map){const n=r.get(o);f[c]=n instanceof t[c]?n:new t[c](e,n)}else{if(!Object(xe.a)(r))throw new Error(`Cannot decode value ${H(r)} (typeof ${typeof r}), expected an input object with known keys`);{let n=r[o];Object(I.a)(n)&&(Object(I.a)(i)&&(i=Object.entries(r).reduce((e,[t,r])=>(e[je(t)]=r,e),{})),n=i[o]),f[c]=n instanceof t[c]?n:new t[c](e,n)}}}catch(r){let n=t[c].name;try{n=new t[c](e).toRawType()}catch(e){}throw new Error(`Struct: failed on ${o}: ${n}:: ${r.message}`)}return f},{})}(e,t,r,n):{}}var He=j("jsonMap"),De=j("Types");class Le extends Map{constructor(e,t,r={},n=new Map){super(Object.entries(Be(e,Re(e,t),r,n))),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,He,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),this.registry=e,S(this,He)[He]=n,S(this,De)[De]=Re(e,t)}static with(e,t){return class extends Le{constructor(r,n){super(r,e,n,t),Object.keys(e).forEach(e=>{Object(I.a)(this[e])&&Object.defineProperty(this,e,{enumerable:!0,get:()=>this.get(e)})})}}}static typesToMap(e,t){return Object.entries(t).reduce((t,[r,n])=>(t[r]=e.getClassName(n)||new n(e).toRawType(),t),{})}get defKeys(){return Object.keys(S(this,De)[De])}get isEmpty(){const e=this.toArray();for(let t=0;t<e.length;t++)if(!e[t].isEmpty)return!1;return!0}get Type(){return Object.entries(S(this,De)[De]).reduce((e,[t,r])=>(e[t]=new r(this.registry).toRawType(),e),{})}get encodedLength(){return this.toArray().reduce((e,t)=>e+=t.encodedLength,0)}get hash(){return this.registry.hash(this.toU8a())}eq(e){return Ce(this,e)}get(e){return super.get(e)}getAtIndex(e){return this.toArray()[e]}toArray(){return[...this.values()]}toHex(){return Object(ve.a)(this.toU8a())}toHuman(e){return[...this.keys()].reduce((t,r)=>{const n=this.get(r);return t[r]=n&&n.toHuman(e),t},{})}toJSON(){return[...this.keys()].reduce((e,t)=>{const r=S(this,He)[He].get(t)||t,n=this.get(t);return e[r]=n&&n.toJSON(),e},{})}toRawType(){return H(Le.typesToMap(this.registry,S(this,De)[De]))}toString(){return H(this.toJSON())}toU8a(e){return Ae(...[...this.entries()].filter(([,e])=>Object(be.a)(null==e?void 0:e.toU8a)).map(([t,r])=>r.toU8a(!e||Ee(e)?e:e[t])))}}function ze(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 Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qe(e,t){return t.toNumber()>=2?e.createType("StorageHasherV10",t.toNumber()+1):e.createType("StorageHasherV10",t)}function Ue(e,t){return t.isMap?[Ve(Ve({},t.asMap),{},{hasher:qe(e,t.asMap.hasher)}),1]:t.isDoubleMap?[Ve(Ve({},t.asDoubleMap),{},{hasher:qe(e,t.asDoubleMap.hasher),key2Hasher:qe(e,t.asDoubleMap.key2Hasher)}),2]:[t.asPlain,0]}function Fe(e,{modules:t}){return e.createType("MetadataV10",{modules:t.map(t=>function(e,t){const r=t.storage.unwrapOr(null);return e.createType("ModuleMetadataV10",Ve(Ve({},t),{},{storage:r?Ve(Ve({},r),{},{items:r.items.map(t=>Ve(Ve({},t),{},{type:e.createType("StorageEntryTypeV10",...Ue(e,t.type))}))}):null}))}(e,t))})}function We(e,{modules:t}){return e.createType("MetadataV11",{extrinsic:{signedExtensions:[],version:0},modules:t})}function Ke(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 Xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ze(e,{extrinsic:t,modules:r}){return e.createType("MetadataLatest",{extrinsic:t,modules:r.map(t=>e.createType("ModuleMetadataV12",Xe(Xe({},t),{},{index:255})))})}function Ge(e,t){return e.createType("MetadataV13",t)}r(683);var Ye=r(698),Je=r.n(Ye),Qe=r(193);function $e(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 et(e,t={isLe:!1,isNegative:!1}){if(!e)return new Je.a(0);const r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({isLe:!1,isNegative:!1},Ee(t)?{isLe:t}:t),n=Object(Qe.a)(e),i=new Je.a((r.isLe?function(e){return(e.match(/.{1,2}/g)||[]).reverse().join("")}(n):n)||"00",16);return r.isNegative?i.fromTwos(4*n.length):i}function tt(e){return e?Object(Me.a)(e)?et(e.toString()):B(e)?new Je.a(e.toString()):Je.a.isBN(e)?e:function(e){return!!e&&Object(be.a)(e.toBn)}(e)?e.toBn():new Je.a(e):new Je.a(0)}var rt={};var nt={assets:{Approval:"AssetApproval",ApprovalKey:"AssetApprovalKey",Balance:"TAssetBalance",DestroyWitness:"AssetDestroyWitness"},babe:{EquivocationProof:"BabeEquivocationProof"},balances:{Status:"BalanceStatus"},beefy:{AuthorityId:"BeefyId"},contracts:{StorageKey:"ContractStorageKey"},electionProviderMultiPhase:{Phase:"ElectionPhase"},ethereum:{Block:"EthBlock",Header:"EthHeader",Receipt:"EthReceipt",Transaction:"EthTransaction",TransactionStatus:"EthTransactionStatus"},evm:{Account:"EvmAccount",Log:"EvmLog",Vicinity:"EvmVicinity"},grandpa:{Equivocation:"GrandpaEquivocation",EquivocationProof:"GrandpaEquivocationProof"},identity:{Judgement:"IdentityJudgement"},inclusion:{ValidatorIndex:"ParaValidatorIndex"},parachains:{Id:"ParaId"},parasInclusion:{ValidatorIndex:"ParaValidatorIndex"},parasScheduler:{ValidatorIndex:"ParaValidatorIndex"},parasShared:{ValidatorIndex:"ParaValidatorIndex"},proposeParachain:{Proposal:"ParachainProposal"},proxy:{Announcement:"ProxyAnnouncement"},scheduler:{ValidatorIndex:"ParaValidatorIndex"},shared:{ValidatorIndex:"ParaValidatorIndex"},society:{Judgement:"SocietyJudgement",Vote:"SocietyVote"},staking:{Compact:"CompactAssignments"},treasury:{Proposal:"TreasuryProposal"}};function it(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 ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ct={AnchorData:{anchoredBlock:"u64",docRoot:"H256",id:"H256"},PreCommitData:{expirationBlock:"u64",identity:"H256",signingRoot:"H256"},Fee:{key:"Hash",price:"Balance"},MultiAccountData:{deposit:"Balance",depositor:"AccountId",signatories:"Vec<AccountId>",threshold:"u16"},ChainId:"u8",DepositNonce:"u64",ResourceId:"[u8; 32]","chainbridge::ChainId":"u8",RegistryId:"H160",TokenId:"U256",AssetId:{registryId:"RegistryId",tokenId:"TokenId"},AssetInfo:{metadata:"Bytes"},MintInfo:{anchorId:"Hash",proofs:"Vec<ProofMint>",staticHashes:"[Hash; 3]"},Proof:{leafHash:"H256",sortedHashes:"H256"},ProofMint:{hashes:"Vec<Hash>",property:"Bytes",salt:"[u8; 32]",value:"Bytes"},RegistryInfo:{fields:"Vec<Bytes>",ownerCanBurn:"bool"}};function at(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 ot(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const st={CompactAssignments:"CompactAssignmentsWith24",RawSolution:"RawSolutionWith24",Keys:"SessionKeys6",ProxyType:{_enum:["Any","NonTransfer","Governance","Staking","IdentityJudgement","CancelProxy"]}},dt={AccountInfo:"AccountInfoWithRefCount",Address:"LookupSource",CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16",Keys:"SessionKeys5",LookupSource:"IndicesLookupSource",ValidatorPrefs:"ValidatorPrefsWithCommission"},ut={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16",Keys:"SessionKeys5",LookupSource:"AccountId",ValidatorPrefs:"ValidatorPrefsWithCommission"};function ht(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 lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const pt={CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16",Keys:"SessionKeys6",ProxyType:{_enum:{Any:0,NonTransfer:1,Governance:2,Staking:3,UnusedSudoBalances:4,IdentityJudgement:5,CancelProxy:6}}},bt={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",Keys:"SessionKeys5",LookupSource:"AccountId",ValidatorPrefs:"ValidatorPrefsWithCommission"};function mt(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 yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const gt={FullIdentification:"()",Keys:"SessionKeys7B"};var vt=[{minmax:[0,void 0],types:{TAssetBalance:"u128",ProxyType:{_enum:["Any","NonTransfer","CancelProxy","Assets","AssetOwner","AssetManager","Staking"]}}}];function wt(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 Mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ot={CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16",Keys:"SessionKeys6",ProxyType:{_enum:["Any","NonTransfer","Staking","SudoBalances","IdentityJudgement","CancelProxy"]}},xt={AccountInfo:"AccountInfoWithRefCount",Address:"AccountId",CompactAssignments:"CompactAssignmentsWith16",LookupSource:"AccountId",Keys:"SessionKeys5",RawSolution:"RawSolutionWith16",ValidatorPrefs:"ValidatorPrefsWithCommission"};var St={"centrifuge-chain":[{minmax:[240,999],types:ft(ft({},ct),{},{AccountInfo:"AccountInfoWithRefCount",Address:"LookupSource",LookupSource:"IndicesLookupSource",Multiplier:"Fixed64",RefCount:"RefCountTo259"})},{minmax:[1e3,void 0],types:ft({},ct)}],kusama:[{minmax:[1019,1031],types:ot(ot({},dt),{},{BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchError:"DispatchErrorTo198",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",SlashingSpans:"SlashingSpansTo204",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"})},{minmax:[1032,1042],types:ot(ot({},dt),{},{BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",SlashingSpans:"SlashingSpansTo204",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"})},{minmax:[1043,1045],types:ot(ot({},dt),{},{BalanceLock:"BalanceLockTo212",CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Keys:"SessionKeys5",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",StakingLedger:"StakingLedgerTo223",Votes:"VotesTo230",Weight:"u32"})},{minmax:[1046,1054],types:ot(ot(ot({},st),ut),{},{CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",ReferendumInfo:"ReferendumInfoTo239",StakingLedger:"StakingLedgerTo240",Weight:"u32"})},{minmax:[1055,1056],types:ot(ot(ot({},st),ut),{},{CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",StakingLedger:"StakingLedgerTo240",Weight:"u32"})},{minmax:[1057,1061],types:ot(ot(ot({},st),ut),{},{CompactAssignments:"CompactAssignmentsTo257",DispatchInfo:"DispatchInfoTo244",Heartbeat:"HeartbeatTo244",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"})},{minmax:[1062,2012],types:ot(ot(ot({},st),ut),{},{CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"})},{minmax:[2013,2022],types:ot(ot(ot({},st),ut),{},{CompactAssignments:"CompactAssignmentsTo257",RefCount:"RefCountTo259"})},{minmax:[2023,2024],types:ot(ot(ot({},st),ut),{},{RefCount:"RefCountTo259"})},{minmax:[2025,2027],types:ot(ot({},st),ut)},{minmax:[2028,2029],types:ot(ot({},st),{},{AccountInfo:"AccountInfoWithDualRefCount",CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16"})},{minmax:[2030,9e3],types:ot(ot({},st),{},{CompactAssignments:"CompactAssignmentsWith16",RawSolution:"RawSolutionWith16"})},{minmax:[9010,void 0],types:ot({},st)}],node:[{minmax:[0,void 0],types:{}}],"node-template":[{minmax:[0,void 0],types:{}}],polkadot:[{minmax:[0,12],types:lt(lt(lt({},pt),bt),{},{CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"})},{minmax:[13,22],types:lt(lt(lt({},pt),bt),{},{CompactAssignments:"CompactAssignmentsTo257",RefCount:"RefCountTo259"})},{minmax:[23,24],types:lt(lt(lt({},pt),bt),{},{RefCount:"RefCountTo259"})},{minmax:[25,27],types:lt(lt({},pt),bt)},{minmax:[28,29],types:lt(lt({},pt),{},{AccountInfo:"AccountInfoWithDualRefCount"})},{minmax:[30,void 0],types:lt({},pt)}],rococo:[{minmax:[0,200],types:yt(yt({},gt),{},{AccountInfo:"AccountInfoWithDualRefCount",Address:"AccountId",LookupSource:"AccountId"})},{minmax:[201,214],types:yt(yt({},gt),{},{AccountInfo:"AccountInfoWithDualRefCount"})},{minmax:[215,228],types:yt(yt({},gt),{},{Keys:"SessionKeys6"})},{minmax:[229,void 0],types:yt({},gt)}],shell:[{minmax:[0,void 0],types:{}}],statemine:vt,statemint:vt,westend:[{minmax:[1,2],types:Mt(Mt(Mt({},Ot),xt),{},{CompactAssignments:"CompactAssignmentsTo257",Multiplier:"Fixed64",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259",Weight:"u32"})},{minmax:[3,22],types:Mt(Mt(Mt({},Ot),xt),{},{CompactAssignments:"CompactAssignmentsTo257",OpenTip:"OpenTipTo225",RefCount:"RefCountTo259"})},{minmax:[23,42],types:Mt(Mt(Mt({},Ot),xt),{},{CompactAssignments:"CompactAssignmentsTo257",RefCount:"RefCountTo259"})},{minmax:[43,44],types:Mt(Mt(Mt({},Ot),xt),{},{RefCount:"RefCountTo259"})},{minmax:[45,47],types:Mt(Mt({},Ot),xt)},{minmax:[48,49],types:Mt(Mt({},Ot),{},{AccountInfo:"AccountInfoWithDualRefCount"})},{minmax:[50,void 0],types:Mt({},Ot)}],westmint:vt};const kt={"dock-mainnet":["0xf73467c6544aa68df2ee546b135f955c46b90fa627e9b5d7935f41061bb8a5a9"],edgeware:["0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b"],equilibrium:["0x6f1a800de3daff7f5e037ddf66ab22ce03ab91874debeddb1086f5f7dbd48925"],hydradx:["0xd2a620c27ec5cbc5621ff9a522689895074f7cca0d08e7134a7804e1a3ba86fc","0x10af6e84234477d84dc572bac0789813b254aa490767ed06fb9591191d1073f9","0x3d75507dd46301767e601265791da1d9cb47b6ebc94e87347b635e5bf58bd047","0x0ed32bfcab4a83517fac88f2aa7cbc2f88d3ab93be9a12b6188a036bf8a943c2"],karura:["0xbaf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b"],kulupu:["0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba"],kusama:["0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe","0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636","0x3fd7b9eb6a00376e5be61f01abb429ffb0b104be05eaff4d458da48fcd425baf"],plasm:["0x3e86364d4b4894021cb2a0390bcf2feb5517d5292f2de2bb9404227e908b0b8b"],polkadot:["0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"],polymesh:["0x9deeb940c92ae02111c3bd5baca89970384f4c9849f02a1b2e53e66414d30f9f"],statemine:["0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"],subsocial:["0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8"]},jt={kusama:"polkadot",polkadot:"polkadot",statemine:"polkadot",statemint:"polkadot",westmint:"polkadot"},Pt={"dock-mainnet":594,edgeware:523,equilibrium:99999997,kusama:434,polkadot:354,polymesh:595,statemine:434},At={"dock-testnet":!0,jupiter:!0,"mathchain-testnet":!0,"zero-alphaville":!0},Et=[0,2,42],It=[{decimals:[10],displayName:"Polkadot Relay Chain",network:"polkadot",prefix:0,standardAccount:"*25519",symbols:["DOT"],website:"https://polkadot.network"},{decimals:null,displayName:"Bare 32-bit Schnorr/Ristretto (S/R 25519) public key.",network:null,prefix:1,standardAccount:null,symbols:null,website:null},{decimals:[12],displayName:"Kusama Relay Chain",network:"kusama",prefix:2,standardAccount:"*25519",symbols:["KSM"],website:"https://kusama.network"},{decimals:null,displayName:"Bare 32-bit Ed25519 public key.",network:null,prefix:3,standardAccount:null,symbols:null,website:null},{decimals:null,displayName:"Katal Chain",network:"katalchain",prefix:4,standardAccount:"*25519",symbols:null,website:null},{decimals:[15],displayName:"Plasm Network",network:"plasm",prefix:5,standardAccount:"*25519",symbols:["PLM"],website:"https://plasmnet.io"},{decimals:[12],displayName:"Bifrost",network:"bifrost",prefix:6,standardAccount:"*25519",symbols:["BNC"],website:"https://bifrost.finance/"},{decimals:[18],displayName:"Edgeware",network:"edgeware",prefix:7,standardAccount:"*25519",symbols:["EDG"],website:"https://edgewa.re"},{decimals:[12],displayName:"Karura",network:"karura",prefix:8,standardAccount:"*25519",symbols:["KAR"],website:"https://karura.network/"},{decimals:[18],displayName:"Laminar Reynolds Canary",network:"reynolds",prefix:9,standardAccount:"*25519",symbols:["REY"],website:"http://laminar.network/"},{decimals:[12],displayName:"Acala",network:"acala",prefix:10,standardAccount:"*25519",symbols:["ACA"],website:"https://acala.network/"},{decimals:[18],displayName:"Laminar",network:"laminar",prefix:11,standardAccount:"*25519",symbols:["LAMI"],website:"http://laminar.network/"},{decimals:[6],displayName:"Polymesh",network:"polymesh",prefix:12,standardAccount:"*25519",symbols:["POLYX"],website:"https://polymath.network/"},{decimals:null,displayName:"SubstraTEE",network:"substratee",prefix:13,standardAccount:"*25519",symbols:null,website:"https://www.substratee.com"},{decimals:[0],displayName:"Totem",network:"totem",prefix:14,standardAccount:"*25519",symbols:["XTX"],website:"https://totemaccounting.com"},{decimals:[12],displayName:"Synesthesia",network:"synesthesia",prefix:15,standardAccount:"*25519",symbols:["SYN"],website:"https://synesthesia.network/"},{decimals:[12],displayName:"Kulupu",network:"kulupu",prefix:16,standardAccount:"*25519",symbols:["KLP"],website:"https://kulupu.network/"},{decimals:null,displayName:"Dark Mainnet",network:"dark",prefix:17,standardAccount:"*25519",symbols:null,website:null},{decimals:[9,9],displayName:"Darwinia Network",network:"darwinia",prefix:18,standardAccount:"*25519",symbols:["RING","KTON"],website:"https://darwinia.network/"},{decimals:[12],displayName:"GeekCash",network:"geek",prefix:19,standardAccount:"*25519",symbols:["GEEK"],website:"https://geekcash.org"},{decimals:[12],displayName:"Stafi",network:"stafi",prefix:20,standardAccount:"*25519",symbols:["FIS"],website:"https://stafi.io"},{decimals:[6],displayName:"Dock Testnet",network:"dock-testnet",prefix:21,standardAccount:"*25519",symbols:["DCK"],website:"https://dock.io"},{decimals:[6],displayName:"Dock Mainnet",network:"dock-mainnet",prefix:22,standardAccount:"*25519",symbols:["DCK"],website:"https://dock.io"},{decimals:null,displayName:"ShiftNrg",network:"shift",prefix:23,standardAccount:"*25519",symbols:null,website:null},{decimals:[18],displayName:"ZERO",network:"zero",prefix:24,standardAccount:"*25519",symbols:["PLAY"],website:"https://zero.io"},{decimals:[18],displayName:"ZERO Alphaville",network:"zero-alphaville",prefix:25,standardAccount:"*25519",symbols:["PLAY"],website:"https://zero.io"},{decimals:[10],displayName:"Jupiter",network:"jupiter",prefix:26,standardAccount:"*25519",symbols:["jDOT"],website:"https://jupiter.patract.io"},{decimals:null,displayName:"Subsocial",network:"subsocial",prefix:28,standardAccount:"*25519",symbols:null,website:null},{decimals:[18],displayName:"Dhiway CORD Network",network:"cord",prefix:29,standardAccount:"*25519",symbols:["DCU"],website:"https://dhiway.com/"},{decimals:[12],displayName:"Phala Network",network:"phala",prefix:30,standardAccount:"*25519",symbols:["PHA"],website:"https://phala.network"},{decimals:[12],displayName:"Litentry Network",network:"litentry",prefix:31,standardAccount:"*25519",symbols:["LIT"],website:"https://litentry.com/"},{decimals:[9],displayName:"Robonomics",network:"robonomics",prefix:32,standardAccount:"*25519",symbols:["XRT"],website:"https://robonomics.network"},{decimals:null,displayName:"DataHighway",network:"datahighway",prefix:33,standardAccount:"*25519",symbols:null,website:null},{decimals:[12],displayName:"Ares Protocol",network:"ares",prefix:34,standardAccount:"*25519",symbols:["ARES"],website:"https://www.aresprotocol.com/"},{decimals:[15],displayName:"Valiu Liquidity Network",network:"vln",prefix:35,standardAccount:"*25519",symbols:["USDv"],website:"https://valiu.com/"},{decimals:[18],displayName:"Centrifuge Chain",network:"centrifuge",prefix:36,standardAccount:"*25519",symbols:["CFG"],website:"https://centrifuge.io/"},{decimals:[18],displayName:"Nodle Chain",network:"nodle",prefix:37,standardAccount:"*25519",symbols:["NODL"],website:"https://nodle.io/"},{decimals:[18],displayName:"KILT Chain",network:"kilt",prefix:38,standardAccount:"*25519",symbols:["KILT"],website:"https://kilt.io/"},{decimals:[18],displayName:"MathChain mainnet",network:"mathchain",prefix:39,standardAccount:"*25519",symbols:["MATH"],website:"https://mathwallet.org"},{decimals:[18],displayName:"MathChain testnet",network:"mathchain-testnet",prefix:40,standardAccount:"*25519",symbols:["MATH"],website:"https://mathwallet.org"},{decimals:null,displayName:"Polimec Chain",network:"poli",prefix:41,standardAccount:"*25519",symbols:null,website:"https://polimec.io/"},{decimals:null,displayName:"Substrate",network:"substrate",prefix:42,standardAccount:"*25519",symbols:null,website:"https://substrate.dev/"},{decimals:null,displayName:"Bare 32-bit ECDSA SECP-256k1 public key.",network:null,prefix:43,standardAccount:null,symbols:null,website:null},{decimals:[8],displayName:"ChainX",network:"chainx",prefix:44,standardAccount:"*25519",symbols:["PCX"],website:"https://chainx.org/"},{decimals:[12,12],displayName:"UniArts Network",network:"uniarts",prefix:45,standardAccount:"*25519",symbols:["UART","UINK"],website:"https://uniarts.me"},{decimals:null,displayName:"This prefix is reserved.",network:"reserved46",prefix:46,standardAccount:null,symbols:null,website:null},{decimals:null,displayName:"This prefix is reserved.",network:"reserved47",prefix:47,standardAccount:null,symbols:null,website:null},{decimals:[12],displayName:"Neatcoin Mainnet",network:"neatcoin",prefix:48,standardAccount:"*25519",symbols:["NEAT"],website:"https://neatcoin.org"},{decimals:[12],displayName:"HydraDX",network:"hydradx",prefix:63,standardAccount:"*25519",symbols:["HDX"],website:"https://hydradx.io"},{decimals:[18],displayName:"AvN Mainnet",network:"aventus",prefix:65,standardAccount:"*25519",symbols:["AVT"],website:"https://aventus.io"},{decimals:[12],displayName:"Crust Network",network:"crust",prefix:66,standardAccount:"*25519",symbols:["CRU"],website:"https://crust.network"},{decimals:[0,9,9,9,9,9,9,9],displayName:"Equilibrium Network",network:"equilibrium",prefix:67,standardAccount:"*25519",symbols:["Unknown","USD","EQ","ETH","BTC","EOS","DOT","CRV"],website:"https://equilibrium.io"},{decimals:[18],displayName:"SORA Network",network:"sora",prefix:69,standardAccount:"*25519",symbols:["XOR"],website:"https://sora.org"},{decimals:[12],displayName:"Manta network",network:"manta",prefix:77,standardAccount:"*25519",symbols:["MA"],website:"https://manta.network"},{decimals:[12],displayName:"Calamari: Manta Canary Network",network:"calamari",prefix:78,standardAccount:"*25519",symbols:["KMA"],website:"https://manta.network"},{decimals:[18],displayName:"PolkaSmith Canary Network",network:"polkasmith",prefix:98,standardAccount:"*25519",symbols:["PKS"],website:"https://polkafoundry.com"},{decimals:[18],displayName:"PolkaFoundry Network",network:"polkafoundry",prefix:99,standardAccount:"*25519",symbols:["PKF"],website:"https://polkafoundry.com"},{decimals:[18],displayName:"OriginTrail Parachain",network:"origintrail-parachain",prefix:101,standardAccount:"secp256k1",symbols:["TRAC"],website:"https://origintrail.io"},{decimals:[18],displayName:"Altair",network:"altair",prefix:136,standardAccount:"*25519",symbols:["AIR"],website:"https://centrifuge.io/"},{decimals:[18],displayName:"Social Network",network:"social-network",prefix:252,standardAccount:"*25519",symbols:["NET"],website:"https://social.network"},{decimals:[18],displayName:"Moonbeam",network:"moonbeam",prefix:1284,standardAccount:"*25519",symbols:["GLMR"],website:"https://moonbeam.network"},{decimals:[18],displayName:"Moonriver",network:"moonriver",prefix:1285,standardAccount:"*25519",symbols:["MOVR"],website:"https://moonbeam.network"},{decimals:[12],displayName:"Basilisk",network:"basilisk",prefix:10041,standardAccount:"*25519",symbols:["BSX"],website:"https://bsx.fi"}].map(e=>{const t=e.network||"",r=e;return r.slip44=Pt[t],r.hasLedgerSupport=!!r.slip44,r.genesisHash=kt[t]||[],r.icon=jt[t]||"substrate",r.isIgnored=!t||!!At[t]||t.startsWith("reserved"),r}).filter(e=>!e.isIgnored&&!!e.network).sort((e,t)=>Et.includes(e.prefix)===Et.includes(t.prefix)?0:Et.includes(e.prefix)?-1:Et.includes(t.prefix)?1:e.displayName.localeCompare(t.displayName));var Tt=It.filter(e=>e.genesisHash.length||42===e.prefix);var Rt=[[0,1020],[26669,1021],[38245,1022],[54248,1023],[59659,1024],[67651,1025],[82191,1027],[83238,1028],[101503,1029],[203466,1030],[295787,1031],[461692,1032],[504329,1033],[569327,1038],[587687,1039],[653183,1040],[693488,1042],[901442,1045],[1375086,1050],[1445458,1051],[1472960,1052],[1475648,1053],[1491596,1054],[1574408,1055],[2064961,1058],[2201991,1062],[2671528,2005],[2704202,2007],[2728002,2008],[2832534,2011],[2962294,2012],[324e4,2013],[3274408,2015],[3323565,2019],[3534175,2022],[3860281,2023],[4143129,2024],[4401242,2025],[4841367,2026],[5961600,2027],[6137912,2028],[6561855,2029],[7100891,2030],[7468792,9010],[7668600,9030],[7812476,9040],[8010981,9050],[8073833,9070]];var Nt=[[0,0],[29231,1],[188836,5],[199405,6],[214264,7],[244358,8],[303079,9],[314201,10],[342400,11],[443963,12],[528470,13],[687751,14],[746085,15],[787923,16],[799302,17],[1205128,18],[1603423,23],[1733218,24],[2005673,25],[2436698,26],[3613564,27],[3899547,28],[4345767,29],[4876134,30],[5661442,9050]];var _t=[[214356,4],[392764,7],[409740,8],[809976,20],[877581,24],[879238,25],[889472,26],[902937,27],[932751,28],[991142,29],[1030162,31],[1119657,32],[1199282,33],[1342534,34],[1392263,35],[1431703,36],[1433369,37],[1490972,41],[2087397,43],[2316688,44],[2549864,45],[3925782,46],[3925843,47],[4207800,48],[4627944,49],[5124076,50],[5478664,900],[5482450,9e3],[5584305,9010],[5784566,9030],[5879822,9031],[5896856,9032],[5897316,9033],[6117927,9050],[6210274,9070]];const Ct={westend:{genesisHash:["0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"]}};function Bt(e,t){const r=t.filter((e,r)=>{const n=t[r-1];return 0!==r&&(e[0]<=n[0]||e[1]<=n[1])});return Object(T.a)(!r.length,()=>`${e}: Mismatched upgrade ordering: ${H(r)}`),t}var Ht=Object.entries({kusama:Rt,polkadot:Nt,westend:_t}).map((function([e,t]){const r=Tt.find(t=>t.network===e)||Ct[e];return Object(T.a)(r,()=>"Unable to find info for chain "+e),{genesisHash:Object(Pe.a)(r.genesisHash[0]),network:e,versions:Bt(e,t).map(([e,t])=>({blockNumber:new Je.a(e),specVersion:new Je.a(t)}))}}));function Dt(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 Lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zt(e=[],t){return e.filter(({minmax:[e,r]})=>(Object(I.a)(e)||t>=e)&&(Object(I.a)(r)||t<=r)).reduce((e,{types:t})=>Lt(Lt({},e),t),{})}function Vt(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 qt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ut={Council:"CollectiveOrigin",System:"SystemOrigin",TechnicalCommittee:"CollectiveOrigin",Xcm:"XcmOrigin",XcmPallet:"XcmOrigin",Authority:"AuthorityOrigin",GeneralCouncil:"CollectiveOrigin"},Ft=[["<",">"],["<",","],[",",">"],["(",")"],["(",","],[",",","],[",",")"]];function Wt(e,t){t.forEach(t=>{const r=Object.keys(e).find(e=>t.eq(e));if(r)t.setOverride(e[r]);else{const r=t.toString(),n=Object.entries(e).reduce((e,[t,r])=>Ft.reduce((e,[n,i])=>e.replace(`${n}${t}${i}`,`${n}${r}${i}`),e),r);r!==n&&t.setOverride(n)}})}function Kt(e,t,r){return t.map(t=>(Wt(r,t.args.map(({type:e})=>e)),e.createType("FunctionMetadataLatest",t)))}function Xt(e,t,r){return t.map(t=>(Wt(r,[t.type]),e.createType("ModuleConstantMetadataLatest",t)))}function Zt(e,t,r){return t.map(t=>(Wt(r,t.args.map(e=>e)),e.createType("EventMetadataLatest",t)))}function Gt(e,{items:t,prefix:r},n){return e.createType("StorageMetadataLatest",{items:t.map(t=>(Wt(n,t.type.isPlain?[t.type.asPlain]:t.type.isMap?[t.type.asMap.value,t.type.asMap.key]:t.type.isDoubleMap?[t.type.asDoubleMap.value,t.type.asDoubleMap.key1,t.type.asDoubleMap.key2]:[t.type.asNMap.value,...t.type.asNMap.keyVec]),e.createType("StorageEntryMetadataLatest",t))),prefix:r})}function Yt(e,t,{calls:r,constants:n,events:i,storage:f}){const c=function({knownTypes:e},t){var r;return Lt(Lt({},nt[t]||{}),(null===(r=e.typesAlias)||void 0===r?void 0:r[t])||{})}(e,je(t.name));return e.createType("ModuleMetadataLatest",qt(qt({},t),{},{calls:r&&Kt(e,r,c),constants:Xt(e,n,c),events:i&&Zt(e,i,c),storage:f&&Gt(e,f,c)}))}function Jt(e,{extrinsic:t,modules:r},n){return function(e,t,r){e.register({OriginCaller:{_enum:t.map((e,t)=>[e.name.toString(),r>=12?e.index.toNumber():t]).sort((e,t)=>e[1]-t[1]).reduce((e,[t,r])=>{for(let t=Object.keys(e).length;t<r;t++)e["Empty"+t]="Null";return e[t]=Ut[t]||"Null",e},{})}})}(e,r,n),e.createType("MetadataLatest",{extrinsic:t,modules:r.map(t=>Yt(e,t,{calls:t.calls.unwrapOr(null),constants:t.constants,events:t.events.unwrapOr(null),storage:t.storage.unwrapOr(null)}))})}const Qt=new Je.a(0),$t=new Je.a(1),er=new Je.a(2),tr=(new Je.a(3),new Je.a(4)),rr=(new Je.a(5),new Je.a(6),new Je.a(7),new Je.a(8),new Je.a(9),new Je.a(10)),nr=new Je.a(100),ir=(new Je.a(1e3),new Je.a(1e6)),fr=new Je.a(1e9),cr=fr.mul(fr),ar=new Je.a(Number.MAX_SAFE_INTEGER);function or(e,t={isLe:!0,isNegative:!1}){return et(Object(ve.a)(e),t)}function sr(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 dr(e,t={bitLength:-1,isLe:!0,isNegative:!1},r){const n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sr(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({bitLength:-1,isLe:!0,isNegative:!1},D(t)?{bitLength:t,isLe:r}:t),i=tt(e),f=-1===n.bitLength?Math.ceil(i.bitLength()/8):Math.ceil((n.bitLength||0)/8);return e?function(e,t,{isLe:r,isNegative:n}){const i=new Uint8Array(t),f=n?e.toTwos(8*t):e;return i.set(f.toArray(r?"le":"be",t),0),i}(i,f,n):function(e,t){return-1===t.bitLength?new Uint8Array:new Uint8Array(e)}(f,n)}function ur(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 hr(e,t={bitLength:-1,isLe:!1,isNegative:!1},r){if(!e)return"0x00";const n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ur(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ur(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({isLe:!1,isNegative:!1},D(t)?{bitLength:t,isLe:r}:t);return Object(ve.a)(dr(e,n))}const lr=new RegExp("(\\d+?)(?=(\\d{3})+(?!\\d)|$)","g");function pr(e){const t=e[0].startsWith("-"),r=t?e.substr(1).match(lr):e.match(lr);return r?`${t?"-":""}${r.join(",")}`:e}const br=[{power:-24,text:"yocto",value:"y"},{power:-21,text:"zepto",value:"z"},{power:-18,text:"atto",value:"a"},{power:-15,text:"femto",value:"f"},{power:-12,text:"pico",value:"p"},{power:-9,text:"nano",value:"n"},{power:-6,text:"micro",value:"µ"},{power:-3,text:"milli",value:"m"},{power:0,text:"Unit",value:"-"},{power:3,text:"Kilo",value:"k"},{power:6,text:"Mill",value:"M"},{power:9,text:"Bill",value:"B"},{power:12,text:"Tril",value:"T"},{power:15,text:"Peta",value:"P"},{power:18,text:"Exa",value:"E"},{power:21,text:"Zeta",value:"Z"},{power:24,text:"Yotta",value:"Y"}];function mr(e){for(let t=0;t<br.length;t++)if(br[t].value===e)return br[t];return br[8]}function yr(e,t,r){if(r)return mr(r);const n=7+Math.ceil((e.length-t)/3);return br[n]||br[n<0?0:br.length-1]}const gr=br[8].text;let vr=0,wr=gr;const Mr=function(e,t=!0,r=vr){let n=tt(e).toString();if(0===n.length||"0"===n)return"0";const i=n[0].startsWith("-");i&&(n=n.substr(1));const{decimals:f=r,forceUnit:c,withSi:a=!0,withSiFull:o=!1,withUnit:s=!0}=Ee(t)?{withSi:t}:t,d=yr(n,f,c),u=n.length-(f+d.power),h=n.substr(0,u),l=(`${new Array((u<0?0-u:0)+1).join("0")}${n}`.substr(u<0?0:u)+"0000").substr(0,4),p=a||o?"-"===d.value?s?" "+(Ee(s)?d.text:s):"":` ${o?d.text:d.value}${s?`${o?" ":""}${Ee(s)?br[8].text:s}`:""}`:"";return`${i?"-":""}${pr(h||"0")}.${l}${p}`};function Or(e){return pr(tt(e).toString())}Mr.calcSi=(e,t=vr)=>yr(e,t),Mr.findSi=mr,Mr.getDefaults=()=>({decimals:vr,unit:wr}),Mr.getOptions=(e=vr)=>br.filter(({power:t})=>!(t<0)||e+t>=0),Mr.setDefaults=({decimals:e,unit:t})=>{vr=Object(I.a)(e)?vr:Array.isArray(e)?e[0]:e,wr=Object(I.a)(t)?wr:Array.isArray(t)?t[0]:t,br[8].text=wr};const xr=new Je.a(1e4),Sr=[["Perquintill",cr],["Perbill",fr],["Permill",ir],["Percent",nr]];function kr(e,t,r){return Object(Me.a)(e,-1,!0)?et(e,{isLe:!1,isNegative:r}).toString():Object(Oe.a)(e)?function(e,t,r){if(!e.length)return"0";try{return or(e.subarray(0,t/8),{isLe:!0,isNegative:r}).toString()}catch(t){throw new Error(`AbstractInt: failed on ${H(e)}:: ${t.message}`)}}(e,t,r):Object(C.a)(e)?new Je.a(e.toString(),10).toString():tt(e).toString()}var jr=j("bitLength"),Pr=j("isSigned");class Ar extends Je.a{constructor(e,t=0,r=64,n=!1){super(kr(t,r,n)),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,jr,{writable:!0,value:void 0}),Object.defineProperty(this,Pr,{writable:!0,value:void 0}),this.registry=e,S(this,jr)[jr]=r,S(this,Pr)[Pr]=n;const i=this.gte(Qt),f=r-(n&&i?1:0);Object(T.a)(n||i,()=>this.toRawType()+": Negative number passed to unsigned type"),Object(T.a)(super.bitLength()<=f,()=>`${this.toRawType()}: Input too large. Found input with ${super.bitLength()} bits, expected ${f}`)}get encodedLength(){return S(this,jr)[jr]/8}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return this.isZero()}get isUnsigned(){return!S(this,Pr)[Pr]}bitLength(){return S(this,jr)[jr]}eq(e){return super.eq(Object(Me.a)(e)?et(e.toString(),{isLe:!1,isNegative:S(this,Pr)[Pr]}):tt(e))}isMax(){return this.toU8a().filter(e=>255===e).length===S(this,jr)[jr]/8}toBigInt(){return BigInt(this.toString())}toBn(){return this}toHex(e=!1){return hr(this,{bitLength:this.bitLength(),isLe:e,isNegative:!this.isUnsigned})}toHuman(e){const t=this.toRawType();if("Balance"===t)return this.isMax()?"everything":Mr(this,{decimals:this.registry.chainDecimals[0],withSi:!0,withUnit:this.registry.chainTokens[0]});const[,r]=Sr.find(([e])=>e===t)||[];return r?function(e,t){return(e.mul(xr).div(t).toNumber()/100).toFixed(2)+"%"}(this,r):Or(this)}toJSON(e=!1){return e||super.bitLength()>52?this.toHex():this.toNumber()}toRawType(){return this instanceof this.registry.createClass("Balance")?"Balance":`${this.isUnsigned?"u":"i"}${this.bitLength()}`}toString(e){return super.toString(e)}toU8a(e){return dr(this,{bitLength:this.bitLength(),isLe:!0,isNegative:!this.isUnsigned})}}class Er extends Ar{static with(e,t){return class extends Er{constructor(t,r){super(t,r,e)}toRawType(){return t||super.toRawType()}}}}class Ir extends(Er.with(32)){}class Tr extends Ir{constructor(e,t){super(e,t),this.isEmpty||Object(T.a)(this.eq(1635018093),()=>`MagicNumber mismatch: expected ${e.createType("u32",1635018093).toHex()}, found ${this.toHex()}`)}}function Rr(e){const t=e.map(e=>e.toString().trim()),r=t.findIndex(e=>!e.length);return-1===r?t:t.slice(0,r)}function Nr(e,t){const r=t.unwrapOr(null);return e.createType("Option<Vec<FunctionMetadataLatest>>",r?r.map(({args:t,documentation:r,name:n})=>e.createType("FunctionMetadataLatest",{args:t,documentation:Rr(r),name:n})):null)}function _r(e,{extrinsic:t,modules:r}){return e.createType("MetadataLatest",{extrinsic:t,modules:r.map(({calls:t,index:r,name:n})=>({calls:Nr(e,t),index:r,name:n}))}).toJSON()}function Cr(e,t=[]){return[...new Set(e.reduce((e,t)=>Array.isArray(t)?Cr(t,e):(e.push(t),e),t))]}const Br=["BTreeMap","BTreeSet","HashMap","Vec"],Hr=Br.concat(["Compact","DoNotConstruct","Int","Linkage","Result","Option","UInt"]),Dr=["<","(","[",'"',","," "],Lr=[Vr("<T::InherentOfflineReport as InherentOfflineReport>::Inherent","InherentOfflineReport",!1),Vr("VecDeque<","Vec<",!1),e=>{for(let t=0;t<e.length;t++)if("<"===e[t]){const r=zr(e,t+1)-14;" as HasCompact"===e.substr(r,14)&&(e=`Compact<${e.substr(t+1,r-t-1)}>`)}return e},Ur("Bounded",!0),Ur("Weak",!1),e=>e.replace(/\s/g,"").replace(/(T|Self)::/g,"").replace(/<(T|Self)asTrait>::/g,"").replace(/<Tas[a-z]+::Trait>::/g,"").replace(/<LookupasStaticLookup>/g,"Lookup").replace(/::Type/g,""),function(){const e=e=>`(${e},${e})`;return t=>qr(t,"PairOf<",e)}(),function(e){const t=e=>e;return r=>qr(r,e,t)}("Box<"),e=>{for(let t=0;t<e.length;t++)if("<"===e[t]&&!Hr.find(r=>{const n=t-r.length;return n>=0&&e.substr(n,r.length)===r&&(0===n||Dr.includes(e[n-1]))})){const r=zr(e,t+1);e=`${e.substr(0,t)}${e.substr(r+1)}`}return e},Vr("String","Text"),Vr("Vec<u8>","Bytes"),Vr("&\\[u8\\]","Bytes"),Vr("&'static\\[u8\\]","Bytes"),Vr("RawAddress","Address"),Vr("Lookup::Source","LookupSource"),Vr("Lookup::Target","LookupTarget"),Vr("exec::StorageKey","ContractStorageKey"),e=>e.replace(/,\)/g,")").replace(/\(([^,]+)\)/,"$1"),(e,{allowNamespaces:t}={})=>{let r=0;for(;-1!==r;)if(r=e.indexOf("::"),0===r)e=e.substr(2);else if(-1!==r){if(t)return e;let n=r;for(;-1!==n&&!Dr.includes(e[n]);)n--;e=`${e.substr(0,n+1)}${e.substr(r+2)}`}return e}];function zr(e,t){let r=0;for(let n=t;n<e.length;n++)if(">"===e[n]){if(!r)return n;r--}else"<"===e[n]&&r++;throw new Error(`Unable to find closing matching <> on '${e}' (start ${t})`)}function Vr(e,t,r=!0){return n=>n.replace(new RegExp(`(^${e}|${Dr.map(t=>`\\${t}${e}`).join("|")})`,"g"),e=>r&&Dr.includes(e[0])?`${e[0]}${t}`:t)}function qr(e,t,r){let n=-1;for(;;){if(n=e.indexOf(t,n+1),-1===n)return e;const i=n+t.length,f=zr(e,i);e=`${e.substr(0,n)}${r(e.substr(i,f-i))}${e.substr(f+1)}`}}function Ur(e,t){return r=>Br.reduce((r,n)=>qr(r,`${e}${n}<`,e=>{const r=e.split(",").map(e=>e.trim()).filter(e=>e);return t&&r.pop(),`${n}<${r.join(",")}>`}),r)}function Fr(e,t){return Lr.reduce((e,r)=>r(e,t),e.toString()).trim()}let Wr;function Kr(...e){return!e.some(e=>0!==e)}function Xr(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 Zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xr(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e[e.BTreeMap=0]="BTreeMap",e[e.BTreeSet=1]="BTreeSet",e[e.Compact=2]="Compact",e[e.Enum=3]="Enum",e[e.Linkage=4]="Linkage",e[e.Option=5]="Option",e[e.Plain=6]="Plain",e[e.Result=7]="Result",e[e.Set=8]="Set",e[e.Struct=9]="Struct",e[e.Tuple=10]="Tuple",e[e.Vec=11]="Vec",e[e.VecFixed=12]="VecFixed",e[e.HashMap=13]="HashMap",e[e.Int=14]="Int",e[e.UInt=15]="UInt",e[e.DoNotConstruct=16]="DoNotConstruct",e[e.Null=17]="Null"}(Wr||(Wr={}));const Gr=["_alias","_fallback"];function Yr(e){return Object(C.a)(e)?e.toString():JSON.stringify(e)}function Jr(e,t,r){return e.info=Wr.Enum,Array.isArray(t)?e.sub=t.map((e,t)=>({index:t,info:Wr.Plain,name:e,type:"Null"})):!function(e){const t=Object.values(e);return!t.some(e=>D(e))||(Object(T.a)(t.every(e=>D(e)&&e>=0&&e<=255),"Invalid number-indexed enum definition"),!1)}(t)?e.sub=Object.entries(t).map(([e,t])=>({index:t,info:Wr.Plain,name:e,type:"Null"})):e.sub=Object.entries(t).map(([e,t],n)=>Zr(Zr({},fn(Yr(t||"Null"),{name:e},r)),{},{index:n})),e}function Qr(e,t,r,n){return e.sub=0===r.length?[]:function(e){let[t,r,n,i,f]=[0,0,0,0,0];const c=[],a=a=>{Kr(t,r,n,i)&&(c.push(e.substr(f,a-f).trim()),f=a+1)};for(let f=0;f<e.length;f++)switch(e[f]){case",":a(f);break;case"<":t++;break;case">":t--;break;case"[":r++;break;case"]":r--;break;case"{":n++;break;case"}":n--;break;case"(":i++;break;case")":i--}return Object(T.a)(Kr(t,r,n,i),()=>"Invalid definition (missing terminators) found in "+e),c.push(e.substr(f,e.length-f).trim()),c}(r).map(e=>fn(e,{},n)),e}function $r(e,t,r,n){const[i,f]=t.substr(n.length+1,t.length-n.length-1-1).split(","),c=parseInt(i.trim(),10);return Object(T.a)(c<=8192&&c%8==0,()=>`${t}: Only support for ${n}<bitLength>, where length <= 8192 and a power of 8, found ${c}`),e.displayName=f,e.length=c,e}function en(e,[t,r]){return e.substr(0,t.length)===t&&e.substr(-1*r.length)===r}const tn=[["[","]",Wr.VecFixed,function(e,t,r,n){const i=t.length-1;let f=-1,c=0;for(let e=1;e<i&&-1===f;e++)";"===t[e]&&0===c?f=e:["[","(","<"].includes(t[e])?c++:["]",")",">"].includes(t[e])&&c--;Object(T.a)(-1!==f,()=>t+": Unable to extract location of ';'");const a=t.substr(1,f-1),[o,s]=t.substr(f+1,i-f-1).split(";"),d=parseInt(o.trim(),10);return Object(T.a)(d<=256,()=>t+": Only support for [Type; <length>], where length <= 256"),e.displayName=s,e.length=d,e.sub=fn(a,{},n),e}],["{","}",Wr.Struct,function(e,t,r,n){const i=JSON.parse(t),f=Object.keys(i);return 1===f.length&&"_enum"===f[0]?Jr(e,i[f[0]],n):1===f.length&&"_set"===f[0]?function(e,t){return e.info=Wr.Set,e.length=t._bitLength,e.sub=Object.entries(t).filter(([e])=>!e.startsWith("_")).map(([e,t])=>({index:t,info:Wr.Plain,name:e,type:e})),e}(e,i[f[0]]):(e.alias=i._alias?new Map(Object.entries(i._alias)):void 0,e.fallbackType=i._fallback,e.sub=f.filter(e=>!Gr.includes(e)).map(e=>fn(Yr(i[e]),{name:e},n)),e)}],["(",")",Wr.Tuple,Qr],["BTreeMap<",">",Wr.BTreeMap,Qr],["HashMap<",">",Wr.HashMap,Qr],["Int<",">",Wr.Int,function(e,t,r){return $r(e,t,0,"Int")}],["Result<",">",Wr.Result,Qr],["UInt<",">",Wr.UInt,function(e,t,r){return $r(e,t,0,"UInt")}],["DoNotConstruct<",">",Wr.DoNotConstruct,function(e,t,r){const n="DoNotConstruct".length;return e.displayName=t.substr(n+1,t.length-n-1-1),e}]],rn=[["BTreeSet<",">",Wr.BTreeSet],["Compact<",">",Wr.Compact],["Linkage<",">",Wr.Linkage],["Option<",">",Wr.Option],["Vec<",">",Wr.Vec]];function nn(e,[t,r]){return e.substr(t.length,e.length-t.length-r.length)}function fn(e,{displayName:t,name:r}={},n=0){const i=Fr(e),f={displayName:t,info:Wr.Plain,name:r,type:i};Object(T.a)(64!=++n,"getTypeDef: Maximum nested limit reached");const c=tn.find(e=>en(i,e));if(c)return f.info=c[2],c[3](f,i,nn(i,c),n);const a=rn.find(e=>en(i,e));return a&&(f.info=a[2],f.sub=fn(nn(i,a),{},n)),f}const cn=Object(E.a)("metadata");function an(e,t,r){const n=Cr(function e(t){return t.map(t=>{const r=fn(t);switch(r.info){case Wr.Plain:return r.type;case Wr.BTreeSet:case Wr.Compact:case Wr.Option:case Wr.Vec:case Wr.VecFixed:return e([r.sub.type]);case Wr.BTreeMap:case Wr.HashMap:case Wr.Result:case Wr.Tuple:return e(r.sub.map(({type:e})=>e));default:throw new Error("Unhandled: Unable to create and validate type from "+t)}})}(r)).filter(t=>!e.hasType(t)).sort();if(0!==n.length){const e="Unknown types found, no types for "+n.join(", ");if(t)throw new Error(e);cn.warn(e)}return r}function on({type:e}){return e.toString()}function sn({modules:e}){return e.map(e=>function(e){return e.calls?e.calls.unwrapOr([]):[]}(e).map(({args:e})=>e.map(on)))}function dn({modules:e}){return e.map(({constants:e})=>(e||[]).map(on))}function un({modules:e}){return e.map(({events:e})=>function(e){return e?e.unwrapOr([]):[]}(e).map(({args:e})=>e.map(e=>e.toString())))}function hn({modules:e}){return e.map(({storage:e})=>function(e){return e?e.unwrapOr({items:[]}).items:[]}(e).map(({type:e})=>e.isPlain?[e.asPlain.toString()]:e.isMap?[e.asMap.value.toString(),e.asMap.key.toString()]:e.isDoubleMap?[e.asDoubleMap.value.toString(),e.asDoubleMap.key1.toString(),e.asDoubleMap.key2.toString()]:[e.asNMap.value.toString(),...e.asNMap.keyVec.map(e=>e.toString())]))}var ln=j("converted"),pn=j("assertVersion"),bn=j("getVersion"),mn=j("metadata");class yn extends Le{constructor(e,t){super(e,{magicNumber:Tr,metadata:"MetadataAll"},t),Object.defineProperty(this,ln,{writable:!0,value:new Map}),Object.defineProperty(this,pn,{writable:!0,value:e=>(Object(T.a)(this.version<=e,()=>`Cannot convert metadata from version ${this.version} to ${e}`),this.version===e)}),Object.defineProperty(this,bn,{writable:!0,value:(e,t)=>{const r="asV"+e,n="latest"===e?"asV13":"asV"+(e-1);return"latest"!==e&&S(this,pn)[pn](e)?S(this,mn)[mn]()[r]:(S(this,ln)[ln].has(e)||S(this,ln)[ln].set(e,t(this.registry,this[n],this.version)),S(this,ln)[ln].get(e))}}),Object.defineProperty(this,mn,{writable:!0,value:()=>this.get("metadata")})}get asCallsOnly(){return new yn(this.registry,{magicNumber:this.magicNumber,metadata:this.registry.createType("MetadataAll",_r(this.registry,this.asLatest),this.version)})}get asV9(){return S(this,pn)[pn](9),S(this,mn)[mn]().asV9}get asV10(){return S(this,bn)[bn](10,Fe)}get asV11(){return S(this,bn)[bn](11,We)}get asV12(){return S(this,bn)[bn](12,Ze)}get asV13(){return S(this,bn)[bn](13,Ge)}get asLatest(){return S(this,bn)[bn]("latest",Jt)}get magicNumber(){return this.get("magicNumber")}get version(){return S(this,mn)[mn]().index}getUniqTypes(e){return function(e,t,r){return an(e,r,Cr([sn(t),dn(t),un(t),hn(t)]))}(this.registry,this.asLatest,e)}toJSON(){return this.asLatest,super.toJSON()}}const gn=new Uint8Array([109,101,116,97,9]),vn=new Uint8Array;function wn(e,t){if(!t||Object(Oe.a)(t)||Object(Me.a)(t)){const r=function e(t=vn){return Object(Me.a)(t)?e(Object(ge.a)(t)):Object(Oe.a)(t)&&0===t.length?gn:t}(t),n=r[4];try{return new yn(e,r)}catch(t){if(9===n)return r[4]=10,wn(e,r);throw t}}return new yn(e,t)}class Mn extends yn{constructor(e,t){super(e,wn(e,t))}}function On(e,{modules:t},r){return t.filter(({calls:e})=>e.isSome).reduce((t,{calls:n,index:i,name:f},c)=>{const a=r>=12?i.toNumber():c,o=je(f);return t[o]=n.unwrap().reduce((t,r,n)=>(t[je(r.name)]=function(e,t,r,n){const i=n.args,f=je(n.name),c=(...c)=>(Object(T.a)(i.length===c.length,()=>`Extrinsic ${t}.${f} expects ${i.length.valueOf()} arguments, got ${c.length}.`),e.createType("Call",{args:c,callIndex:r},n));return c.is=e=>function(e,t){return e.callIndex[0]===t[0]&&e.callIndex[1]===t[1]}(e,r),c.callIndex=r,c.meta=n,c.method=f,c.section=t,c.toJSON=()=>n.toJSON(),c}(e,o,new Uint8Array([a,n]),r),t),{}),t},{})}function xn(e,{modules:t},r){return t.reduce((t,{constants:r,name:n})=>(r.isEmpty||(t[je(n)]=r.reduce((t,r)=>{const n=r.type.toString(),i=e.createType(n,Object(Pe.a)(r.value.toHex()));return i.meta=r,t[je(r.name)]=i,t},{})),t),{})}var Sn=r(355),kn=r.n(Sn);r(572);const jn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pn=[],An=[];for(let e=0;e<jn.length;++e)Pn[e]=jn[e],An[jn.charCodeAt(e)]=e;An["-".charCodeAt(0)]=62,An["_".charCodeAt(0)]=63;var En=r(195);const In=En.bytes,Tn=(En.sizeCompressed,En.sizeUncompressed),Rn=Uint8Array,Nn=Uint16Array,_n=Uint32Array,Cn=new Rn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bn=new Rn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hn=new Rn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Dn=(e,t)=>{const r=new Nn(31);for(let n=0;n<31;++n)r[n]=t+=1<<e[n-1];const n=new _n(r[30]);for(let e=1;e<30;++e)for(let t=r[e];t<r[e+1];++t)n[t]=t-r[e]<<5|e;return[r,n]},[Ln,zn]=Dn(Bn,2);Ln[28]=258,zn[258]=28;const[Vn]=Dn(Hn,0),qn=new Nn(32768);for(let e=0;e<32768;++e){let t=(43690&e)>>>1|(21845&e)<<1;t=(52428&t)>>>2|(13107&t)<<2,t=(61680&t)>>>4|(3855&t)<<4,qn[e]=((65280&t)>>>8|(255&t)<<8)>>>1}const Un=(e,t,r)=>{const n=e.length;let i=0;const f=new Nn(t);for(;i<n;++i)++f[e[i]-1];const c=new Nn(t);for(i=0;i<t;++i)c[i]=c[i-1]+f[i-1]<<1;let a;if(r){a=new Nn(1<<t);const r=15-t;for(i=0;i<n;++i)if(e[i]){const n=i<<4|e[i],f=t-e[i];let o=c[e[i]-1]++<<f;for(const e=o|(1<<f)-1;o<=e;++o)a[qn[o]>>>r]=n}}else for(a=new Nn(n),i=0;i<n;++i)a[i]=qn[c[e[i]-1]++]>>>15-e[i];return a},Fn=new Rn(288);for(let e=0;e<144;++e)Fn[e]=8;for(let e=144;e<256;++e)Fn[e]=9;for(let e=256;e<280;++e)Fn[e]=7;for(let e=280;e<288;++e)Fn[e]=8;const Wn=new Rn(32);for(let e=0;e<32;++e)Wn[e]=5;const Kn=Un(Fn,9,1),Xn=Un(Wn,5,1),Zn=(e,t,r)=>{const n=t>>>3;return(e[n]|e[n+1]<<8)>>>(7&t)&r},Gn=(e,t)=>{const r=t>>>3;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},Yn=e=>{let t=e[0];for(let r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Jn=(e,t,r)=>{const n=!r||r.i;r||(r={});const i=e.length,f=!t||!n;t||(t=new Rn(3*i));const c=e=>{let r=t.length;if(e>r){const n=new Rn(Math.max(r<<1,e));n.set(t),t=n}};let a=r.f||0,o=r.p||0,s=r.b||0,d=r.l,u=r.d,h=r.m,l=r.n;if(a&&!d)return t;const p=i<<3;do{if(!d){r.f=a=Zn(e,o,1);const m=Zn(e,o+1,3);if(o+=3,!m){const a=((b=o)>>>3)+(7&b&&1)+4,d=e[a-4]|e[a-3]<<8,u=a+d;if(u>i){if(n)throw"unexpected EOF";break}f&&c(s+d),t.set(e.subarray(a,u),s),r.b=s+=d,r.p=o=u<<3;continue}if(1==m)d=Kn,u=Xn,h=9,l=5;else{if(2!=m)throw"invalid block type";{const t=Zn(e,o,31)+257,r=Zn(e,o+10,15)+4,i=t+Zn(e,o+5,31)+1;o+=14;const f=new Rn(i),c=new Rn(19);for(let t=0;t<r;++t)c[Cn[t]]=Zn(e,o+3*t,7);o+=3*r;const a=Yn(c),s=(1<<a)-1;if(!n&&o+i*(a+7)>p)break;const b=Un(c,a,1);for(let t=0;t<i;){const r=b[Zn(e,o,s)];o+=15&r;const n=r>>>4;if(n<16)f[t++]=n;else{let r=0,i=0;for(16==n?(i=3+Zn(e,o,3),o+=2,r=f[t-1]):17==n?(i=3+Zn(e,o,7),o+=3):18==n&&(i=11+Zn(e,o,127),o+=7);i--;)f[t++]=r}}const m=f.subarray(0,t),y=f.subarray(t);h=Yn(m),l=Yn(y),d=Un(m,h,1),u=Un(y,l,1)}}if(o>p)throw"unexpected EOF"}f&&c(s+131072);const m=(1<<h)-1,y=(1<<l)-1,g=h+l+18;for(;n||o+g<p;){const r=d[Gn(e,o)&m],n=r>>>4;if(o+=15&r,o>p)throw"unexpected EOF";if(!r)throw"invalid length/literal";if(n<256)t[s++]=n;else{if(256==n){d=void 0;break}{let r=n-254;if(n>264){const t=n-257,i=Bn[t];r=Zn(e,o,(1<<i)-1)+Ln[t],o+=i}const i=u[Gn(e,o)&y],a=i>>>4;if(!i)throw"invalid distance";o+=15&i;let d=Vn[a];if(a>3){const t=Hn[a];d+=Gn(e,o)&(1<<t)-1,o+=t}if(o>p)throw"unexpected EOF";f&&c(s+131072);const h=s+r;for(;s<h;s+=4)t[s]=t[s-d],t[s+1]=t[s+1-d],t[s+2]=t[s+2-d],t[s+3]=t[s+3-d];s=h}}}r.l=d,r.p=o,r.b=s,d&&(a=1,r.m=h,r.d=u,r.n=l)}while(!a);var b;return s==t.length?t:((e,t,r)=>{(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);const n=new(e instanceof Nn?Nn:e instanceof _n?_n:Rn)(r-t);return n.set(e.subarray(t,r)),n})(t,0,s)};const Qn=($n=function(e){const[t,r]=function(e){const t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");const r=e.indexOf("=");return-1===r?[t,0]:[r,4-r%4]}(e),n=new Uint8Array(3*(t+r)/4-r);let i,f,c=0;const a=r>0?t-4:t;for(i=0;i<a;i+=4)f=An[e.charCodeAt(i)]<<18|An[e.charCodeAt(i+1)]<<12|An[e.charCodeAt(i+2)]<<6|An[e.charCodeAt(i+3)],n[c++]=f>>16&255,n[c++]=f>>8&255,n[c++]=255&f;return 2===r?(f=An[e.charCodeAt(i)]<<2|An[e.charCodeAt(i+1)]>>4,n[c++]=255&f):1===r&&(f=An[e.charCodeAt(i)]<<10|An[e.charCodeAt(i+1)]<<4|An[e.charCodeAt(i+2)]>>2,n[c++]=f>>8&255,n[c++]=255&f),n}(In),ei=new Uint8Array(Tn),Jn(((e=>{if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"})($n),$n.subarray(2,-4)),ei));var $n,ei;const ti=new(r(365).a)("utf-8");function ri(e){return null!=e&&e.length?ti.decode(e):""}var ni=r(185);let ii=null,fi=null,ci=null;function ai(e){return(...t)=>(Object(T.a)(ii,"The WASM interface has not been initialized. Ensure that you wait for the initialization Promise with waitReady() from @polkadot/wasm-crypto (or cryptoWaitReady() from @polkadot/util-crypto) before attempting to use WASM-only interfaces."),e(ii)(...t))}function oi(){return null!==fi&&fi.buffer===ii.memory.buffer||(fi=new Int32Array(ii.memory.buffer)),fi}function si(){return null!==ci&&ci.buffer===ii.memory.buffer||(ci=new Uint8Array(ii.memory.buffer)),ci}function di(e,t){return si().subarray(e/1,e/1+t)}function ui(e){const t=ii.__wbindgen_malloc(1*e.length);return si().set(e,t/1),[t,e.length]}function hi(e){return ui(Object(ni.a)(e))}function li(){const e=oi()[2],t=oi()[3],r=di(e,t).slice();return ii.__wbindgen_free(e,1*t),r}var pi=r(186);const bi={getRandomValues:pi.a},mi={crypto:bi},yi=new Array(32).fill(void 0).concat(void 0,null,!0,!1);let gi=yi.length;function vi(e){return yi[e]}function wi(e){const t=vi(e);return function(e){e<36||(yi[e]=gi,gi=e)}(e),t}function Mi(e){gi===yi.length&&yi.push(yi.length+1);const t=gi;return gi=yi[t],yi[t]=e,t}function Oi(e){return void 0===vi(e)}function xi(){return Mi(mi)}function Si(e,t){throw new Error("Unable to require "+function(e,t){return ri(di(e,t))}(e,t))}function ki(e){return Mi(bi)}function ji(e){return Mi(bi.getRandomValues)}function Pi(e,t,r){bi.getRandomValues(di(t,r))}function Ai(e,t,r){throw new Error("randomFillsync is not available")}function Ei(e){wi(e)}function Ii(){throw new Error("abort")}const Ti=async function(e,t,r){try{Object(T.a)("undefined"!=typeof WebAssembly&&e&&e.length,"WebAssembly is not available in your environment");const t=await WebAssembly.instantiate(e,{wbg:r});ii=t.instance.exports}catch(e){t?ii=t(r):(console.error("FATAL: Unable to initialize @polkadot/wasm-crypto"),console.error(e),ii=null)}}(Qn,null,n).catch(()=>null),Ri=ai(e=>t=>(e.ext_bip39_generate(8,t),ri(li()))),Ni=ai(e=>t=>{const[r,n]=hi(t);return e.ext_bip39_to_entropy(8,r,n),li()}),_i=ai(e=>(t,r)=>{const[n,i]=hi(t),[f,c]=hi(r);return e.ext_bip39_to_mini_secret(8,n,i,f,c),li()}),Ci=ai(e=>(t,r)=>{const[n,i]=hi(t),[f,c]=hi(r);return e.ext_bip39_to_seed(8,n,i,f,c),li()}),Bi=ai(e=>t=>{const[r,n]=hi(t);return 0!==e.ext_bip39_validate(r,n)}),Hi=ai(e=>t=>{const[r,n]=ui(t);return e.ext_ed_from_seed(8,r,n),li()}),Di=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r),[o,s]=ui(n);return e.ext_ed_sign(8,i,f,c,a,o,s),li()}),Li=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r),[o,s]=ui(n);return 0!==e.ext_ed_verify(i,f,c,a,o,s)}),zi=ai(e=>(t,r)=>{const[n,i]=ui(t),[f,c]=ui(r);return e.ext_sr_derive_keypair_hard(8,n,i,f,c),li()}),Vi=ai(e=>(t,r)=>{const[n,i]=ui(t),[f,c]=ui(r);return e.ext_sr_derive_keypair_soft(8,n,i,f,c),li()}),qi=(ai(e=>(t,r)=>{const[n,i]=ui(t),[f,c]=ui(r);return e.ext_sr_derive_public_soft(8,n,i,f,c),li()}),ai(e=>t=>{const[r,n]=ui(t);return e.ext_sr_from_seed(8,r,n),li()})),Ui=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r),[o,s]=ui(n);return e.ext_sr_sign(8,i,f,c,a,o,s),li()}),Fi=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r),[o,s]=ui(n);return 0!==e.ext_sr_verify(i,f,c,a,o,s)}),Wi=ai(e=>(t,r,n,i)=>{const[f,c]=ui(t),[a,o]=ui(r),[s,d]=ui(n),[u,h]=ui(i);return e.ext_vrf_sign(8,f,c,a,o,s,d,u,h),li()}),Ki=ai(e=>(t,r,n,i,f)=>{const[c,a]=ui(t),[o,s]=ui(r),[d,u]=ui(n),[h,l]=ui(i),[p,b]=ui(f);return 0!==e.ext_vrf_verify(c,a,o,s,d,u,h,l,p,b)}),Xi=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r);return e.ext_blake2b(8,i,f,c,a,n),li()}),Zi=ai(e=>t=>{const[r,n]=ui(t);return e.ext_keccak256(8,r,n),li()}),Gi=ai(e=>(t,r,n)=>{const[i,f]=ui(t),[c,a]=ui(r);return e.ext_pbkdf2(8,i,f,c,a,n),li()}),Yi=ai(e=>(t,r,n,i,f)=>{const[c,a]=ui(t),[o,s]=ui(r);return e.ext_scrypt(8,c,a,o,s,n,i,f),li()}),Ji=(ai(e=>t=>{const[r,n]=ui(t);return e.ext_sha512(8,r,n),li()}),ai(e=>(t,r)=>{const[n,i]=ui(t);return e.ext_twox(8,n,i,r),li()}));function Qi(){return!!ii}function $i(e,t=256,r,n=!1){const i=Math.ceil(t/8);return Qi()&&!n?Xi(Object(ge.a)(e),Object(ge.a)(r),i):kn.a.blake2b(Object(ge.a)(e),r||void 0,i)}class ef extends Map{constructor(e,t){const r=function(e){return Object.entries(e||{})}(t);super(r),this.registry=void 0,this.createdAtHash=void 0,this.registry=e,r.forEach(([e])=>{Object(I.a)(this[e])&&Object.defineProperty(this,e,{enumerable:!0,get:()=>this.get(e)})})}get encodedLength(){return 0}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===[...this.keys()].length}eq(e){return Ce(this,e)}toHex(){throw new Error("Unimplemented")}toHuman(){return[...this.entries()].reduce((e,[t,r])=>(e[t]=Object(be.a)(r.toHuman)?r.toHuman():r,e),{})}toJSON(){return[...this.entries()].reduce((e,[t,r])=>(e[t]=r,e),{})}toRawType(){return"Json"}toString(){return H(this.toJSON())}toU8a(e){throw new Error("Unimplemented")}}const tf=[9,10,13];class rf extends Uint8Array{constructor(e,t){super(Object(ge.a)(t)),this.registry=void 0,this.createdAtHash=void 0,this.registry=e}get encodedLength(){return this.length}get hash(){return this.registry.hash(this.toU8a())}get isAscii(){return(e=this)?!Object(ge.a)(e).some(e=>e>=127||e<32&&!tf.includes(e)):Object(C.a)(e);var e}get isEmpty(){return!this.length||Object(I.a)(this.find(e=>!!e))}get isUtf8(){return function(e){if(!e)return Object(C.a)(e);const t=Object(ge.a)(e),r=t.length;let n=0;for(;n<r;)if(t[n]<=127)n+=1;else if(t[n]>=194&&t[n]<=223){if(!(n+1<r))return!1;if(t[n+1]<128||t[n+1]>191)return!1;n+=2}else if(224===t[n]){if(!(n+2<r))return!1;if(t[n+1]<160||t[n+1]>191)return!1;if(t[n+2]<128||t[n+2]>191)return!1;n+=3}else if(t[n]>=225&&t[n]<=236){if(!(n+2<r))return!1;if(t[n+1]<128||t[n+1]>191)return!1;if(t[n+2]<128||t[n+2]>191)return!1;n+=3}else if(237===t[n]){if(!(n+2<r))return!1;if(t[n+1]<128||t[n+1]>159)return!1;if(t[n+2]<128||t[n+2]>191)return!1;n+=3}else if(t[n]>=238&&t[n]<=239){if(!(n+2<r))return!1;if(t[n+1]<128||t[n+1]>191)return!1;if(t[n+2]<128||t[n+2]>191)return!1;n+=3}else if(240===t[n]){if(!(n+3<r))return!1;if(t[n+1]<144||t[n+1]>191)return!1;if(t[n+2]<128||t[n+2]>191)return!1;if(t[n+3]<128||t[n+3]>191)return!1;n+=4}else if(t[n]>=241&&t[n]<=243){if(!(n+3<r))return!1;if(t[n+1]<128||t[n+1]>191)return!1;if(t[n+2]<128||t[n+2]>191)return!1;if(t[n+3]<128||t[n+3]>191)return!1;n+=4}else{if(244!==t[n])return!1;if(!(n+3<r))return!1;if(t[n+1]<128||t[n+1]>143)return!1;if(t[n+2]<128||t[n+2]>191)return!1;if(t[n+3]<128||t[n+3]>191)return!1;n+=4}return!0}(this)}get length(){return super.length}bitLength(){return 8*this.length}eq(e){return e instanceof Uint8Array?this.length===e.length&&!this.some((t,r)=>t!==e[r]):this.eq(Object(ge.a)(e))}slice(e,t){return Uint8Array.from(this).slice(e,t)}subarray(e,t){return Uint8Array.from(this).subarray(e,t)}toHex(){return Object(ve.a)(this)}toHuman(){return this.isAscii?this.toUtf8():this.toJSON()}toJSON(){return this.toHex()}toRawType(){return"Raw"}toString(){return this.toHex()}toU8a(e){return Uint8Array.from(this)}toUtf8(){return Object(T.a)(this.isUtf8,"The character sequence is not a valid Utf8 string"),ri(this)}}const nf={extrinsic:{},payload:{}},ff={LimitParathreadCommits:nf,OnlyStakingAndClaims:nf,PrevalidateAttests:nf,RestrictFunctionality:nf,TransactionCallFilter:nf,ValidateDoubleVoteReports:nf},cf={DisallowSigned:nf},af={extrinsic:{era:"ExtrinsicEra"},payload:{blockHash:"Hash"}};function of(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 sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?of(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):of(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const df=sf(sf(sf(sf({},{ChargeTransactionPayment:{extrinsic:{tip:"Compact<Balance>"},payload:{}},CheckBlockGasLimit:nf,CheckEra:af,CheckGenesis:{extrinsic:{},payload:{genesisHash:"Hash"}},CheckMortality:af,CheckNonce:{extrinsic:{nonce:"Compact<Index>"},payload:{}},CheckSpecVersion:{extrinsic:{},payload:{specVersion:"u32"}},CheckTxVersion:{extrinsic:{},payload:{transactionVersion:"u32"}},CheckVersion:{extrinsic:{},payload:{specVersion:"u32"}},CheckWeight:nf,LockStakingStatus:nf,ValidateEquivocationReport:nf}),ff),cf),{ChargeAssetTxPayment:{extrinsic:{tip:"Compact<Balance>",assetId:"Option<AssetId>"},payload:{}}}),uf=["CheckVersion","CheckGenesis","CheckEra","CheckNonce","CheckWeight","ChargeTransactionPayment","CheckBlockGasLimit"];function hf(e,t,r={}){return e.map(e=>r[e]||df[e]).filter(e=>!!e).reduce((e,r)=>sf(sf({},e),r[t]),{})}const lf=new Je.a(2).pow(new Je.a(6)).subn(1),pf=new Je.a(2).pow(new Je.a(14)).subn(1),bf=new Je.a(2).pow(new Je.a(30)).subn(1);function mf(e){const t=tt(e);if(t.lte(lf))return new Uint8Array([t.toNumber()<<2]);if(t.lte(pf))return dr(t.shln(2).iadd($t),16,!0);if(t.lte(bf))return dr(t.shln(2).iadd(er),32,!0);const r=dr(t);let n=r.length;for(;0===r[n-1];)n--;return Object(T.a)(n>=4,"Invalid length, previous checks match anything less than 2^30"),Ae([3+(n-4<<2)],r.subarray(0,n))}function yf(e,t){return!!Array.isArray(t)&&(e.length===t.length&&Object(I.a)(e.find((e,r)=>Ne(e)?!e.eq(t[r]):e!==t[r])))}class gf extends Array{constructor(e,...t){super(...t),this.registry=void 0,this.createdAtHash=void 0,this.registry=e}get encodedLength(){return this.reduce((e,t)=>e+t.encodedLength,mf(this.length).length)}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.length}get length(){return super.length}eq(e){return yf(this,e)}toArray(){return Array.from(this)}toHex(){return Object(ve.a)(this.toU8a())}toHuman(e){return this.map(t=>t.toHuman(e))}toJSON(){return this.map(e=>e.toJSON())}toString(){return`[${this.map(e=>e.toString()).join(", ")}]`}toU8a(e){const t=this.map(t=>t.toU8a(e));return e?Ae(...t):Ae(mf(this.length),...t)}concat(e){return this.toArray().concat(e instanceof gf?e.toArray():e)}filter(e,t){return this.toArray().filter(e,t)}map(e,t){return this.toArray().map(e,t)}includes(e){return this.some(t=>t.eq(e))}slice(e,t){return this.toArray().slice(e,t)}}class vf extends gf{constructor(e,t,r){const n=Array.isArray(t)?t.map(t=>Te(e,t)):Re(e,t);super(e,...function(e,t,r){return Object(Oe.a)(r)||Object(Me.a)(r)?Ie(e,Object(ge.a)(r),t):(Array.isArray(t)?t:Object.values(t)).map((t,n)=>{try{const i=null==r?void 0:r[n];return i instanceof t?i:new t(e,i)}catch(e){throw new Error(`Tuple: failed on ${n}:: ${e.message}`)}})}(e,n,r)),this._Types=void 0,this._Types=n}static with(e){return class extends vf{constructor(t,r){super(t,e,r)}}}get encodedLength(){return this.reduce((e,t)=>e+t.encodedLength,0)}get Types(){return Array.isArray(this._Types)?this._Types.map(e=>new e(this.registry).toRawType()):Object.keys(this._Types)}toRawType(){return`(${(Array.isArray(this._Types)?this._Types:Object.values(this._Types)).map(e=>this.registry.getClassName(e)||new e(this.registry).toRawType()).join(",")})`}toString(){return H(this.toJSON())}toU8a(e){return Ae(...this.map(t=>t.toU8a(e)))}}class wf{constructor(e){this.registry=void 0,this.createdAtHash=void 0,this.registry=e}get encodedLength(){return 0}get hash(){throw new Error(".hash is not implemented on Null")}get isEmpty(){return!0}eq(e){return e instanceof wf||R(e)}toHex(){return"0x"}toHuman(){return this.toJSON()}toJSON(){return null}toRawType(){return"Null"}toString(){return""}toU8a(e){return new Uint8Array}}function Mf(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 Of(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mf(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xf=j("meta"),Sf=j("method"),kf=j("section"),jf=j("typeDef");class Pf extends vf{constructor(e,t,r=[],n=[],i,f="<unknown>",c="<unknown>"){super(e,r,t),Object.defineProperty(this,xf,{writable:!0,value:void 0}),Object.defineProperty(this,Sf,{writable:!0,value:void 0}),Object.defineProperty(this,kf,{writable:!0,value:void 0}),Object.defineProperty(this,jf,{writable:!0,value:void 0}),S(this,xf)[xf]=i,S(this,Sf)[Sf]=c,S(this,kf)[kf]=f,S(this,jf)[jf]=n}get meta(){return S(this,xf)[xf]}get method(){return S(this,Sf)[Sf]}get section(){return S(this,kf)[kf]}get typeDef(){return S(this,jf)[jf]}}class Af extends Le{constructor(e,t){const{DataType:r,value:n}=function(e,t){if(!t||!t.length)return{DataType:wf};const r=t.subarray(0,2);return{DataType:e.findMetaEvent(r),value:{data:t.subarray(2),index:r}}}(e,t);super(e,{index:"EventId",data:r},n)}get data(){return this.get("data")}get index(){return this.get("index")}get meta(){return this.data.meta}get method(){return this.data.method}get section(){return this.data.section}get typeDef(){return this.data.typeDef}toHuman(e){return Of(Of({method:this.method,section:this.section},e?{documentation:this.meta.documentation.map(e=>e.toString())}:{}),super.toHuman(e))}}function Ef(e){const t=Object(ge.a)(e),r=3&t[0];if(0===r)return[1,new Je.a(t[0]).ishrn(2)];if(1===r)return[2,or(t.slice(0,2),!0).ishrn(2)];if(2===r)return[4,or(t.slice(0,4),!0).ishrn(2)];const n=1+new Je.a(t[0]).ishrn(2).iadd(tr).toNumber();return[n,or(t.subarray(1,n),!0)]}function If(e){return Ae(mf(e.length),e)}class Tf{constructor(e,t){this.registry=void 0,this.createdAtHash=void 0,this._raw=void 0,this.registry=e,this._raw=t}get encodedLength(){return this.toU8a().length}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return this._raw.isEmpty}eq(e){return this._raw.eq(e)}toHex(e){return this._raw.toHex(e)}toHuman(e){return this._raw.toHuman(e)}toJSON(){return this._raw.toJSON()}toString(){return this._raw.toString()}toU8a(e){return this._raw.toU8a(e)}toRawType(){return"Base"}}const Rf=new Uint8Array,Nf=new Uint8Array([0]);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}const Cf=["ExtrinsicUnknown","ExtrinsicUnknown","ExtrinsicUnknown","ExtrinsicUnknown","ExtrinsicV4"];class Bf extends Tf{get args(){return this.method.args}get argsDef(){return this.method.argsDef}get callIndex(){return this.method.callIndex}get data(){return this.method.data}get era(){return this._raw.signature.era}get encodedLength(){return this.toU8a().length}get isSigned(){return this._raw.signature.isSigned}get length(){return this.toU8a(!0).length}get meta(){return this.method.meta}get method(){return this._raw.method}get nonce(){return this._raw.signature.nonce}get signature(){return this._raw.signature.signature}get signer(){return this._raw.signature.signer}get tip(){return this._raw.signature.tip}get type(){return this._raw.version}get version(){return this.type|(this.isSigned?128:0)}is(e){return this.method.is(e)}}class Hf extends Bf{constructor(e,t,{version:r}={}){super(e,Hf._decodeExtrinsic(e,t,r))}static _newFromValue(e,t,r){if(t instanceof Hf)return t._raw;const n=128==(128&r),i=Cf[127&r]||Cf[0];return e.createType(i,t,{isSigned:n,version:r})}static _decodeExtrinsic(e,t,r=4){return Object(Oe.a)(t)||Array.isArray(t)||Object(Me.a)(t)?Hf._decodeU8a(e,Object(ge.a)(t),r):t instanceof e.createClass("Call")?Hf._newFromValue(e,{method:t},r):Hf._newFromValue(e,t,r)}static _decodeU8a(e,t,r){if(!t.length)return Hf._newFromValue(e,new Uint8Array,r);const[n,i]=Ef(t),f=n+i.toNumber();Object(T.a)(f<=t.length,()=>`Extrinsic: length less than remainder, expected at least ${f}, found ${t.length}`);const c=t.subarray(n,f);return Hf._newFromValue(e,c.subarray(1),c[0])}addSignature(e,t,r){return this._raw.addSignature(e,t,r),this}sign(e,t){return this._raw.sign(e,t),this}signFake(e,t){return this._raw.signFake(e,t),this}toHex(e){return Object(ve.a)(this.toU8a(e))}toHuman(e){return function(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){x(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}({isSigned:this.isSigned,method:this.method.toHuman(e)},this.isSigned?{era:this.era.toHuman(e),nonce:this.nonce.toHuman(e),signature:this.signature.toHex(),signer:this.signer.toHuman(e),tip:this.tip.toHuman(e)}:{})}toJSON(){return this.toHex()}toRawType(){return"Extrinsic"}toU8a(e){const t=Ae(new Uint8Array([this.version]),this._raw.toU8a());return e?t:If(t)}}function Df(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function Lf(e,t){if(Array.isArray(t))return{def:t.reduce((e,t,r)=>(e[t]={Type:wf,index:r},e),{}),isBasic:!0,isIndexed:!1};let r,n,i;return!function(e){const t=Object.values(e);return!t.some(e=>D(e))||(Object(T.a)(t.every(e=>D(e)&&e>=0&&e<=255),"Invalid number-indexed enum definition"),!1)}(t)?(i=Object.entries(t).reduce((e,[t,r])=>(e[t]={Type:wf,index:r},e),{}),r=!0,n=!0):(i=Object.entries(Re(e,t)).reduce((e,[t,r],n)=>(e[t]={Type:r,index:n},e),{}),r=!Object.values(i).some(({Type:e})=>e!==wf),n=!1),{def:i,isBasic:r,isIndexed:n}}function zf(e,t,r=0,n){const i=Object.values(t).find(e=>e.index===r);return Object(T.a)(!Object(I.a)(i),()=>`Unable to create Enum via index ${r}, in ${Object.keys(t).join(", ")}`),{index:r,value:n instanceof i.Type?n:new i.Type(e,n)}}function Vf(e,t,r,n){const i=Object.keys(t).map(e=>e.toLowerCase()),f=r.toLowerCase(),c=i.indexOf(f);Object(T.a)(-1!==c,()=>`Cannot map Enum JSON, unable to find '${r}' in ${i.join(", ")}`);try{return zf(e,t,Object.values(t)[c].index,n)}catch(e){throw new Error(`Enum(${r}):: ${e.message}`)}}function qf(e,t,r){if(Object(Oe.a)(r)){if(r.length)return zf(e,t,r[0],r.subarray(1))}else{if(D(r))return zf(e,t,r);if(Object(C.a)(r))return function(e,t,r){return Object(Me.a)(r)?qf(e,t,Object(Pe.a)(r)):Vf(e,t,r)}(e,t,r.toString());if(Object(xe.a)(r)){const n=Object.keys(r)[0];return Vf(e,t,n,r[n])}}return zf(e,t,Object.values(t)[0].index)}var Uf=j("def"),Ff=j("entryIndex"),Wf=j("indexes"),Kf=j("isBasic"),Xf=j("isIndexed"),Zf=j("raw");class Gf{constructor(e,t,r,n){this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,Uf,{writable:!0,value:void 0}),Object.defineProperty(this,Ff,{writable:!0,value:void 0}),Object.defineProperty(this,Wf,{writable:!0,value:void 0}),Object.defineProperty(this,Kf,{writable:!0,value:void 0}),Object.defineProperty(this,Xf,{writable:!0,value:void 0}),Object.defineProperty(this,Zf,{writable:!0,value:void 0});const i=Lf(e,t),f=function(e,t,r,n){return D(n)?zf(e,t,n,r):r instanceof Gf?zf(e,t,r.index,r.value):qf(e,t,r)}(e,i.def,r,n);this.registry=e,S(this,Uf)[Uf]=i.def,S(this,Kf)[Kf]=i.isBasic,S(this,Xf)[Xf]=i.isIndexed,S(this,Wf)[Wf]=Object.values(i.def).map(({index:e})=>e),S(this,Ff)[Ff]=S(this,Wf)[Wf].indexOf(f.index)||0,S(this,Zf)[Zf]=f.value}static with(e){return class extends Gf{constructor(t,r,n){super(t,e,r,n),Object.keys(S(this,Uf)[Uf]).forEach(e=>{const t=Df(je(e.replace(" ","_"))),r="as"+t,n="is"+t;Object(I.a)(this[n])&&Object.defineProperty(this,n,{enumerable:!0,get:()=>this.type===e}),Object(I.a)(this[r])&&Object.defineProperty(this,r,{enumerable:!0,get:()=>(Object(T.a)(this[n],()=>`Cannot convert '${this.type}' via ${r}`),this.value)})})}}}get encodedLength(){return 1+S(this,Zf)[Zf].encodedLength}get hash(){return this.registry.hash(this.toU8a())}get index(){return S(this,Wf)[Wf][S(this,Ff)[Ff]]}get isBasic(){return S(this,Kf)[Kf]}get isEmpty(){return S(this,Zf)[Zf].isEmpty}get isNone(){return this.isNull}get isNull(){return S(this,Zf)[Zf]instanceof wf}get defIndexes(){return S(this,Wf)[Wf]}get defKeys(){return Object.keys(S(this,Uf)[Uf])}get type(){return this.defKeys[S(this,Ff)[Ff]]}get value(){return S(this,Zf)[Zf]}eq(e){return D(e)?this.toNumber()===e:S(this,Kf)[Kf]&&Object(C.a)(e)?this.type===e:Object(Oe.a)(e)?!this.toU8a().some((t,r)=>t!==e[r]):Object(Me.a)(e)?this.toHex()===e:e instanceof Gf?this.index===e.index&&this.value.eq(e.value):Object(xe.a)(e)?this.value.eq(e[this.type]):this.value.eq(e)}toHex(){return Object(ve.a)(this.toU8a())}toHuman(e){return S(this,Kf)[Kf]?this.type:{[this.type]:S(this,Zf)[Zf].toHuman(e)}}toJSON(){return S(this,Kf)[Kf]?this.type:{[je(this.type)]:S(this,Zf)[Zf].toJSON()}}toNumber(){return this.index}_toRawStruct(){if(S(this,Kf)[Kf])return S(this,Xf)[Xf]?this.defKeys.reduce((e,t,r)=>(e[t]=S(this,Wf)[Wf][r],e),{}):this.defKeys;const e=Object.entries(S(this,Uf)[Uf]).reduce((e,[t,{Type:r}])=>(e[t]=r,e),{});return Le.typesToMap(this.registry,e)}toRawType(){return H({_enum:this._toRawStruct()})}toString(){return this.isNull?this.type:H(this.toJSON())}toU8a(e){return Ae(new Uint8Array(e?[]:[this.index]),S(this,Zf)[Zf].toU8a(e))}}class Yf extends(Er.with(64)){}class Jf extends rf{constructor(e,t){super(e,Nf)}}class Qf extends vf{constructor(e,t){super(e,{period:Yf,phase:Yf},Qf._decodeMortalEra(e,t))}static _decodeMortalEra(e,t){if(!t)return[new Yf(e),new Yf(e)];if(Object(Oe.a)(t)||Object(Me.a)(t)||Array.isArray(t))return Qf._decodeMortalU8a(e,Object(ge.a)(t));if(Object(xe.a)(t))return Qf._decodeMortalObject(e,t);throw new Error("Invalid data passed to Mortal era")}static _decodeMortalObject(e,t){const{current:r,period:n}=t;let i=Math.pow(2,Math.ceil(Math.log2(n)));i=Math.min(Math.max(i,4),65536);const f=r%i,c=Math.max(i>>12,1),a=f/c*c;return[new Yf(e,i),new Yf(e,a)]}static _decodeMortalU8a(e,t){if(0===t.length)return[new Yf(e),new Yf(e)];const r=or(t.subarray(0,1)).toNumber()+(or(t.subarray(1,2)).toNumber()<<8),n=2<<r%16,i=(r>>4)*Math.max(n>>12,1);return Object(T.a)(n>=4&&i<n,"Invalid data passed to Mortal era"),[new Yf(e,n),new Yf(e,i)]}get encodedLength(){return 2}get period(){return this[0]}get phase(){return this[1]}toHuman(){return{period:Or(this.period),phase:Or(this.phase)}}toJSON(){return this.toHex()}toU8a(e){const t=this.period.toNumber(),r=this.phase.toNumber(),n=Math.max(t>>12,1),i=function(e){const t=e.toString(2);let r=0;for(;"0"===t[t.length-1-r];)r++;return r}(t),f=Math.min(15,Math.max(1,i-1))+(r/n<<4);return new Uint8Array([255&f,f>>8])}birth(e){return Math.floor((Math.max(tt(e).toNumber(),this.phase.toNumber())-this.phase.toNumber())/this.period.toNumber())*this.period.toNumber()+this.phase.toNumber()}death(e){return this.birth(e)+this.period.toNumber()}}class $f extends Gf{constructor(e,t){super(e,{ImmortalEra:Jf,MortalEra:Qf},$f._decodeExtrinsicEra(t))}static _decodeExtrinsicEra(e=new Uint8Array){if(e instanceof $f)return $f._decodeExtrinsicEra(e.toU8a());if(Object(Me.a)(e))return $f._decodeExtrinsicEra(Object(Pe.a)(e));if(!e||Object(Oe.a)(e))return null!=e&&e.length&&0!==e[0]?new Uint8Array([1,e[0],e[1]]):new Uint8Array([0]);if(Object(xe.a)(e)){const t=Object.entries(e).map(([e,t])=>[e.toLowerCase(),t]),r=t.find(([e])=>"mortalera"===e.toLowerCase()),n=t.find(([e])=>"immortalera"===e.toLowerCase());return r?{MortalEra:r[1]}:n?{ImmortalEra:n[1]}:{MortalEra:e}}throw new Error("Invalid data passed to Era")}get encodedLength(){return this.isImmortalEra?this.asImmortalEra.encodedLength:this.asMortalEra.encodedLength}get asImmortalEra(){return Object(T.a)(this.isImmortalEra,()=>`Cannot convert '${this.type}' via asImmortalEra`),this.value}get asMortalEra(){return Object(T.a)(this.isMortalEra,()=>`Cannot convert '${this.type}' via asMortalEra`),this.value}get isImmortalEra(){return 0===this.index}get isMortalEra(){return this.index>0}toU8a(e){return this.isMortalEra?this.asMortalEra.toU8a(e):this.asImmortalEra.toU8a(e)}}const ec=["ExtrinsicPayloadUnknown","ExtrinsicPayloadUnknown","ExtrinsicPayloadUnknown","ExtrinsicPayloadUnknown","ExtrinsicPayloadV4"];class tc extends Tf{constructor(e,t,{version:r}={}){super(e,tc.decodeExtrinsicPayload(e,t,r))}static decodeExtrinsicPayload(e,t,r=4){return t instanceof tc?t._raw:e.createType(ec[r]||ec[0],t,{version:r})}get blockHash(){return this._raw.blockHash}get era(){return this._raw.era}get genesisHash(){return this._raw.genesisHash||this.registry.createType("Hash")}get method(){return this._raw.method}get nonce(){return this._raw.nonce}get specVersion(){return this._raw.specVersion||this.registry.createType("u32")}get tip(){return this._raw.tip||this.registry.createType("Compact<Balance>")}get transactionVersion(){return this._raw.transactionVersion||this.registry.createType("u32")}eq(e){return this._raw.eq(e)}sign(e){const t=this._raw.sign(e);return{signature:Object(ve.a)(t)}}toHuman(e){return this._raw.toHuman(e)}toJSON(){return this.toHex()}toString(){return this.toHex()}toU8a(e){return super.toU8a(!!e&&{method:!0})}}class rc extends Le{constructor(e,t,{version:r=0}={}){throw super(e,{}),new Error("Unsupported extrinsic payload version "+r)}}class nc extends Le{constructor(e,t,{isSigned:r=!1,version:n=0}={}){throw super(e,{}),new Error(`Unsupported ${r?"":"un"}signed extrinsic version ${127&n}`)}}function ic(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 fc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ic(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const cc={address:"Address",blockHash:"Hash",blockNumber:"BlockNumber",era:"ExtrinsicEra",genesisHash:"Hash",method:"Call",nonce:"Compact<Index>",runtimeVersion:"RuntimeVersion",signedExtensions:"Vec<Text>",tip:"Compact<Balance>",version:"u8"};class ac extends Le{constructor(e,t){const r=fc(fc({},e.getSignedExtensionTypes()),e.getSignedExtensionExtra());super(e,fc(fc({},r),cc),t),this._extraTypes=void 0,this._extraTypes=Object.entries(r).reduce((e,[t,r])=>(cc[t]||(e[t]=r),e),{})}get address(){return this.get("address")}get blockHash(){return this.get("blockHash")}get blockNumber(){return this.get("blockNumber")}get era(){return this.get("era")}get genesisHash(){return this.get("genesisHash")}get method(){return this.get("method")}get nonce(){return this.get("nonce")}get runtimeVersion(){return this.get("runtimeVersion")}get signedExtensions(){return this.get("signedExtensions")}get tip(){return this.get("tip")}get version(){return this.get("version")}toPayload(){return fc(fc({},Object.keys(this._extraTypes).reduce((e,t)=>(e[t]=this.get(t).toHex(),e),{})),{},{address:this.address.toString(),blockHash:this.blockHash.toHex(),blockNumber:this.blockNumber.toHex(),era:this.era.toHex(),genesisHash:this.genesisHash.toHex(),method:this.method.toHex(),nonce:this.nonce.toHex(),signedExtensions:this.signedExtensions.map(e=>e.toString()),specVersion:this.runtimeVersion.specVersion.toHex(),tip:this.tip.toHex(),transactionVersion:this.runtimeVersion.transactionVersion.toHex(),version:this.version.toNumber()})}toRaw(){const e=this.toPayload(),t=Object(ve.a)(this.registry.createType("ExtrinsicPayload",e,{version:e.version}).toU8a({method:!0}));return{address:e.address,data:t,type:"payload"}}}class oc extends Le{constructor(e,t,{isSigned:r}={}){super(e,{signature:"ExtrinsicSignatureV4",method:"Call"},oc.decodeExtrinsic(e,t,r))}static decodeExtrinsic(e,t,r=!1){if(t instanceof oc)return t;if(t instanceof e.createClass("Call"))return{method:t};if(Object(Oe.a)(t)){const n=e.createType("ExtrinsicSignatureV4",t,{isSigned:r});return{method:e.createType("Call",t.subarray(n.encodedLength)),signature:n}}return t||{}}get encodedLength(){return this.toU8a().length}get method(){return this.get("method")}get signature(){return this.get("signature")}get version(){return 4}addSignature(e,t,r){return this.signature.addSignature(e,t,r),this}sign(e,t){return this.signature.sign(this.method,e,t),this}signFake(e,t){return this.signature.signFake(this.method,e,t),this}}function sc(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 dc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var uc=j("signOptions");class hc extends Le{constructor(e,t){super(e,dc(dc({method:"Bytes"},e.getSignedExtensionTypes()),e.getSignedExtensionExtra()),t),Object.defineProperty(this,uc,{writable:!0,value:void 0}),S(this,uc)[uc]={withType:e.createType("ExtrinsicSignature")instanceof Gf}}get blockHash(){return this.get("blockHash")}get era(){return this.get("era")}get genesisHash(){return this.get("genesisHash")}get method(){return this.get("method")}get nonce(){return this.get("nonce")}get specVersion(){return this.get("specVersion")}get tip(){return this.get("tip")}get transactionVersion(){return this.get("transactionVersion")}sign(e){return function(e,t,r,n){const i=r.length>256?e.hash(r):r;return t.sign(i,n)}(this.registry,e,this.toU8a({method:!0}),S(this,uc)[uc])}}function lc(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}const pc=new Uint8Array,bc=new Uint8Array([1]);function mc(e,t){return e.createType("Address",Object(Oe.a)(t)?Object(ve.a)(t):t)}var yc=j("fakePrefix");class gc extends Le{constructor(e,t,{isSigned:r}={}){super(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lc(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({signer:"Address",signature:"ExtrinsicSignature"},e.getSignedExtensionTypes()),gc.decodeExtrinsicSignature(t,r)),Object.defineProperty(this,yc,{writable:!0,value:void 0}),S(this,yc)[yc]=e.createType("ExtrinsicSignature")instanceof Gf?bc:pc}static decodeExtrinsicSignature(e,t=!1){return e&&(e instanceof gc||t)?e:Rf}get encodedLength(){return this.isSigned?super.encodedLength:0}get isSigned(){return!this.signature.isEmpty}get era(){return this.get("era")}get nonce(){return this.get("nonce")}get signature(){return this.multiSignature.value||this.multiSignature}get multiSignature(){return this.get("signature")}get signer(){return this.get("signer")}get tip(){return this.get("tip")}_injectSignature(e,t,{era:r,nonce:n,tip:i}){return this.set("era",r),this.set("nonce",n),this.set("signer",e),this.set("signature",t),this.set("tip",i),this}addSignature(e,t,r){return this._injectSignature(mc(this.registry,e),this.registry.createType("ExtrinsicSignature",t),new hc(this.registry,r))}createPayload(e,{blockHash:t,era:r,genesisHash:n,nonce:i,runtimeVersion:{specVersion:f,transactionVersion:c},tip:a}){return new hc(this.registry,{blockHash:t,era:r||Nf,genesisHash:n,method:e.toHex(),nonce:i,specVersion:f,tip:a||0,transactionVersion:c||0})}sign(e,t,r){Object(T.a)(t&&t.addressRaw,()=>"Expected a valid keypair for signing, found "+H(t));const n=mc(this.registry,t.addressRaw),i=this.createPayload(e,r),f=this.registry.createType("ExtrinsicSignature",i.sign(t));return this._injectSignature(n,f,i)}signFake(e,t,r){Object(T.a)(t,()=>"Expected a valid address for signing, found "+H(t));const n=mc(this.registry,t),i=this.createPayload(e,r),f=this.registry.createType("ExtrinsicSignature",Ae(S(this,yc)[yc],new Uint8Array(64).fill(66)));return this._injectSignature(n,f,i)}toU8a(e){return this.isSigned?super.toU8a(e):Rf}}var vc=r(250),wc=r.n(vc);function Mc(e,t=256,r=!1){const n=256===t;return Qi()&&n&&!r?Zi(Object(ge.a)(e)):new Uint8Array((n?wc.a.keccak256:wc.a.keccak512).update(Object(ge.a)(e)).arrayBuffer())}function Oc(e){return!(!e||42!==e.length||!Object(Me.a)(e))&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||function(e){const t=e.replace("0x",""),r=Object(ve.a)(Mc(t.toLowerCase()),-1,!1);for(let e=0;e<40;e++)if(n=t[e],i=parseInt(r[e],16),n!==(i>7?n.toUpperCase():n.toLowerCase()))return!1;var n,i;return!0}(e))}var xc=r(358);const Sc=new(0,r.n(xc).a.ec)("secp256k1"),kc={bitLength:256,isLe:!1};function jc(e){Object(T.a)([33,65].includes(e.length),"Invalid publicKey provided");const t=Sc.keyFromPublic(e).getPublic();return Ae(dr(t.getX(),kc),dr(t.getY(),kc))}function Pc(e){if(!e)return"0x";const t=Object(ge.a)(e);Object(T.a)([20,32,33,65].includes(t.length),"Invalid address or publicKey passed");const r=Object(ve.a)(([33,65].includes((n=t).length)&&(n=Mc(jc(n))),n.slice(-20)),-1,!1);var n;const i=Object(ve.a)(Mc(r),-1,!1);let f="";for(let e=0;e<40;e++)f=`${f}${parseInt(i[e],16)>7?r[e].toUpperCase():r[e]}`;return"0x"+f}class Ac extends rf{constructor(e,t=new Uint8Array,r=256){super(e,function e(t,r){if(Array.isArray(t)||Object(C.a)(t))return e(Object(ge.a)(t),r);const n=r/8,i=new Uint8Array(n);return t&&t.length?(Object(T.a)(t.length>=n,()=>`Expected at least ${n} bytes (${r} bits), found ${t.length} bytes`),t.subarray(0,n)):i}(t,r))}static with(e,t){return class extends Ac{constructor(t,r){super(t,r,e)}toRawType(){return t||super.toRawType()}}}toRawType(){return`[u8;${this.length}]`}}function Ec(e){return Object(Oe.a)(e)||Array.isArray(e)?Object(ge.a)(e):Object(Me.a)(e)||Oc(e)?Object(Pe.a)(e):Object(C.a)(e)?Object(ge.a)(e):e}class Ic extends Ac{constructor(e,t=new Uint8Array){super(e,Ec(t),160)}static encode(e){return Pc(e)}eq(e){return super.eq(Ec(e))}toHuman(){return this.toJSON()}toJSON(){return this.toString()}toString(){return Ic.encode(this)}toRawType(){return"AccountId"}}var Tc=r(352);function Rc(e){return new Uint8Array(e||[])}var Nc=r(249);const _c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Cc=r.n(Nc)()(_c),Bc={alphabet:_c,ipfsChar:"z",type:"base58"};function Hc(e,t){return function({alphabet:e,ipfsChar:t,type:r},n,i){Object(T.a)(n&&"string"==typeof n,()=>`Expected non-null, non-empty ${r} string input`),Object(T.a)(!i||n[0]===t,()=>`Expected ${r} to start with '${t}'`);for(let t=i?1:0;t<n.length;t++)Object(T.a)(e.includes(n[t]),()=>`Invalid ${r} character "${n[t]}" (0x${n.charCodeAt(t).toString(16)}) at index ${t}`);return!0}(Bc,e,t)}const Dc=Object(ni.a)("SS58PRE");function Lc(e){return $i(Ae(Dc,e),512)}const zc={allowedDecodedLengths:[1,2,4,8,32,33],allowedEncodedLengths:[3,4,6,10,35,36,37,38],allowedPrefix:It.map(({prefix:e})=>e),prefix:42};function Vc(e,t,r=-1){if(Object(T.a)(e,"Invalid empty address passed"),Object(Oe.a)(e)||Object(Me.a)(e))return Object(ge.a)(e);try{const f=(Hc(n=e,i),Rc(Cc.decode(n.substr(i?1:0))));Object(T.a)(zc.allowedEncodedLengths.includes(f.length),"Invalid decoded address length");const[c,a,o,s]=function(e){const t=64&e[0]?2:1,r=1===t?e[0]:(63&e[0])<<2|e[1]>>6|(63&e[1])<<8,n=[34+t,35+t].includes(e.length),i=e.length-(n?2:1),f=Lc(e.subarray(0,i));return[0==(128&e[0])&&![46,47].includes(e[0])&&(n?e[e.length-2]===f[0]&&e[e.length-1]===f[1]:e[e.length-1]===f[0]),i,t,r]}(f);return Object(T.a)(t||c,"Invalid decoded address checksum"),Object(T.a)([-1,s].includes(r),()=>`Expected ss58Format ${r}, received ${s}`),f.slice(o,a)}catch(t){throw new Error(`Decoding ${e}: ${t.message}`)}var n,i}function qc(e,t=zc.prefix){const r=Vc(e);Object(T.a)(t>=0&&t<=16383&&![46,47].includes(t),"Out of range ss58Format specified"),Object(T.a)(zc.allowedDecodedLengths.includes(r.length),()=>"Expected a valid key to convert, with length "+zc.allowedDecodedLengths.join(", "));const n=Ae(t<64?[t]:[(252&t)>>2|64,t>>8|(3&t)<<6],r);return function(e,t){const r=Cc.encode(Object(ge.a)(e));return t?"z"+r:r}(Ae(n,Lc(n).subarray(0,[32,33].includes(r.length)?2:1)))}const Uc=new Je.a(239),Fc=new Je.a(1).shln(16),Wc=new Je.a(1).shln(32);class Kc extends Ir{constructor(e,t=new Je.a(0)){super(e,function e(t){return t instanceof Kc?t.toBn():Object(Tc.a)(t)||D(t)||Object(Me.a)(t)||Object(Oe.a)(t)||B(t)?t:e(Vc(t))}(t))}static calcLength(e){const t=tt(e);return t.lte(Uc)?1:t.lt(Fc)?2:t.lt(Wc)?4:8}static readLength(e){const t=e[0];return 252===t?[1,2]:253===t?[1,4]:254===t?[1,8]:[0,1]}static writeLength(e){switch(e.length){case 2:return new Uint8Array([252]);case 4:return new Uint8Array([253]);case 8:return new Uint8Array([254]);default:return new Uint8Array([])}}eq(e){return Object(Tc.a)(e)||D(e)?super.eq(e):super.eq(this.registry.createType("AccountIndex",e))}toHuman(){return this.toJSON()}toJSON(){return this.toString()}toString(){const e=Kc.calcLength(this);return qc(this.toU8a().subarray(0,e),this.registry.chainSS58)}toRawType(){return"AccountIndex"}}const Xc=new Uint8Array([255]);class Zc extends Tf{constructor(e,t=new Uint8Array){super(e,Zc._decodeAddress(e,t))}static _decodeAddress(e,t){return t instanceof Zc?t._raw:t instanceof Ic||t instanceof Kc?t:Object(Tc.a)(t)||D(t)||B(t)?e.createType("AccountIndex",t):Array.isArray(t)||Object(Me.a)(t)||Object(Oe.a)(t)?function(e,t){if(20===t.length)return e.createType("EthereumAccountId",t);if(255===t[0])return e.createType("EthereumAccountId",t.subarray(1));const[r,n]=Kc.readLength(t);return e.createType("AccountIndex",or(t.subarray(r,r+n),!0))}(e,Object(ge.a)(t)):function(e,t){const r=Vc(t);return 20===r.length?e.createType("EthereumAccountId",r):e.createType("AccountIndex",or(r,!0))}(e,t)}get encodedLength(){const e=this._rawLength;return e+(e>1?1:0)}get _rawLength(){return this._raw instanceof Kc?Kc.calcLength(this._raw):this._raw.encodedLength}toHex(){return Object(ve.a)(this.toU8a())}toRawType(){return"Address"}toU8a(e){const t=this._raw.toU8a().subarray(0,this._rawLength);return e?t:Ae(this._raw instanceof Kc?Kc.writeLength(t):Xc,t)}}function Gc(e){if(!e)return new Uint8Array;if(Object(Oe.a)(e)||Array.isArray(e))return Object(ge.a)(e);if(Object(Me.a)(e))return Object(Pe.a)(e);if(Object(C.a)(e))return Vc(e);throw new Error("Unknown type passed to AccountId constructor, found typeof "+typeof e)}class Yc extends Ac{constructor(e,t){const r=Gc(t);Object(T.a)(r.length>=32||!r.some(e=>e),()=>"Invalid AccountId provided, expected 32 bytes, found "+r.length),super(e,r,256)}eq(e){return super.eq(Gc(e))}toHuman(){return this.toJSON()}toJSON(){return this.toString()}toString(){return qc(this,this.registry.chainSS58)}toRawType(){return"AccountId"}}class Jc extends Le{constructor(e,t){super(e,{header:"Header",extrinsics:"Vec<Extrinsic>"},t)}get contentHash(){return this.registry.hash(this.toU8a())}get extrinsics(){return this.get("extrinsics")}get hash(){return this.header.hash}get header(){return this.get("header")}}const Qc=Object(E.a)("Map");function $c(e,t,r,n){const i=new Map;return n.forEach((n,f)=>{try{i.set(f instanceof t?f:new t(e,f),n instanceof r?n:new r(e,n))}catch(e){throw Qc.error("Failed to decode key or value:",e.message),e}}),i}function ea(e,t,r,n){const i=Te(e,t),f=Te(e,r);if(!n)return new Map;if(Object(Oe.a)(n)||Object(Me.a)(n))return function(e,t,r,n){const i=new Map,[f,c]=Ef(n),a=[];for(let e=0;e<c.toNumber();e++)a.push(t,r);const o=Ie(e,n.subarray(f),a);for(let e=0;e<o.length;e+=2)i.set(o[e],o[e+1]);return i}(e,i,f,Object(ge.a)(n));if(n instanceof Map)return $c(e,i,f,n);if(Object(xe.a)(n))return $c(e,i,f,new Map(Object.entries(n)));throw new Error("Map: cannot decode type")}var ta=j("KeyClass"),ra=j("ValClass"),na=j("type");class ia extends Map{constructor(e,t,r,n,i="HashMap"){super(ea(e,t,r,n)),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,ta,{writable:!0,value:void 0}),Object.defineProperty(this,ra,{writable:!0,value:void 0}),Object.defineProperty(this,na,{writable:!0,value:void 0}),this.registry=e,S(this,ta)[ta]=Te(e,t),S(this,ra)[ra]=Te(e,r),S(this,na)[na]=i}get encodedLength(){let e=mf(this.size).length;return this.forEach((t,r)=>{e+=t.encodedLength+r.encodedLength}),e}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.size}eq(e){return Ce(this,e)}toHex(){return Object(ve.a)(this.toU8a())}toHuman(e){const t={};return this.forEach((r,n)=>{t[n.toString()]=r.toHuman(e)}),t}toJSON(){const e={};return this.forEach((t,r)=>{e[r.toString()]=t.toJSON()}),e}toRawType(){return`${S(this,na)[na]}<${this.registry.getClassName(S(this,ta)[ta])||new(S(this,ta)[ta])(this.registry).toRawType()},${this.registry.getClassName(S(this,ra)[ra])||new(S(this,ra)[ra])(this.registry).toRawType()}>`}toString(){return H(this.toJSON())}toU8a(e){const t=new Array;return e||t.push(mf(this.size)),this.forEach((r,n)=>{t.push(n.toU8a(e),r.toU8a(e))}),Ae(...t)}}class fa extends ia{static with(e,t){return class extends fa{constructor(r,n){super(r,e,t,n,"BTreeMap")}}}}function ca(e,t){return e.size===t.length&&!t.some(t=>!e.has(t))}const aa=Object(E.a)("BTreeSet");function oa(e,t,r){if(!r)return new Set;const n=Te(e,t);if(Object(Me.a)(r)||Object(Oe.a)(r))return function(e,t,r){const n=new Set,[i,f]=Ef(r),c=[];for(let e=0;e<f.toNumber();e++)c.push(t);const a=Ie(e,r.subarray(i),c);for(let e=0;e<a.length;e++)n.add(a[e]);return n}(e,n,Object(ge.a)(r));if(Array.isArray(r)||r instanceof Set)return function(e,t,r){const n=new Set;return r.forEach(r=>{try{n.add(r instanceof t?r:new t(e,r))}catch(e){throw aa.error("Failed to decode key or value:",e.message),e}}),n}(e,n,r);throw new Error("BTreeSet: cannot decode type")}var sa=j("ValClass");class da extends Set{constructor(e,t,r){super(oa(e,t,r)),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,sa,{writable:!0,value:void 0}),this.registry=e,S(this,sa)[sa]=Te(e,t)}static with(e){return class extends da{constructor(t,r){super(t,e,r)}}}get encodedLength(){let e=mf(this.size).length;return this.forEach(t=>{e+=t.encodedLength}),e}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.size}eq(e){return t=this,r=e,Array.isArray(r)?ca(t,r):r instanceof Set?ca(t,[...r.values()]):!!Object(xe.a)(r)&&ca(t,Object.values(r));var t,r}toHex(){return Object(ve.a)(this.toU8a())}toHuman(e){const t=[];return this.forEach(r=>{t.push(r.toHuman(e))}),t}toJSON(){const e=[];return this.forEach(t=>{e.push(t.toJSON())}),e}toRawType(){return`BTreeSet<${this.registry.getClassName(S(this,sa)[sa])||new(S(this,sa)[sa])(this.registry).toRawType()}>`}toString(){return H(this.toJSON())}toU8a(e){const t=new Array;return e||t.push(mf(this.size)),this.forEach(r=>{t.push(r.toU8a(e))}),Ae(...t)}}var ua=j("Type"),ha=j("raw");class la{constructor(e,t,r=0){this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,ua,{writable:!0,value:void 0}),Object.defineProperty(this,ha,{writable:!0,value:void 0}),this.registry=e,S(this,ua)[ua]=Te(e,t),S(this,ha)[ha]=la.decodeCompact(e,S(this,ua)[ua],r)}static with(e){return class extends la{constructor(t,r){super(t,e,r)}}}static decodeCompact(e,t,r){return r instanceof la?new t(e,S(r,ha)[ha]):Object(C.a)(r)||D(r)||Object(Tc.a)(r)||B(r)?new t(e,r):new t(e,Ef(r)[1])}get encodedLength(){return this.toU8a().length}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return S(this,ha)[ha].isEmpty}bitLength(){return S(this,ha)[ha].bitLength()}eq(e){return S(this,ha)[ha].eq(e instanceof la?S(e,ha)[ha]:e)}toBigInt(){return S(this,ha)[ha].toBigInt()}toBn(){return S(this,ha)[ha].toBn()}toHex(e){return S(this,ha)[ha].toHex(e)}toHuman(e){return S(this,ha)[ha].toHuman(e)}toJSON(){return S(this,ha)[ha].toJSON()}toNumber(){return S(this,ha)[ha].toNumber()}toRawType(){return`Compact<${this.registry.getClassName(S(this,ua)[ua])||S(this,ha)[ha].toRawType()}>`}toString(){return S(this,ha)[ha].toString()}toU8a(e){return mf(S(this,ha)[ha].toBn())}unwrap(){return S(this,ha)[ha]}}class pa extends ia{static with(e,t){return class extends pa{constructor(r,n){super(r,e,t,n)}}}}class ba extends Ar{constructor(e,t=0,r){super(e,t,r,!0)}static with(e,t){return class extends ba{constructor(t,r){super(t,r,e)}toRawType(){return t||super.toRawType()}}}}function ma(e,t,r){if(R(r)||Object(I.a)(r)||r instanceof wf)return new wf(e);const n=Te(e,t);return r instanceof va?ma(e,n,r.value):r instanceof n?r:Object(Oe.a)(r)?function(e,t,r){return r.length&&0!==r[0]?new t(e,r.subarray(1)):new wf(e)}(e,n,r):new n(e,r)}var ya=j("Type"),ga=j("raw");class va{constructor(e,t,r){this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,ya,{writable:!0,value:void 0}),Object.defineProperty(this,ga,{writable:!0,value:void 0}),this.registry=e,S(this,ya)[ya]=Te(e,t),S(this,ga)[ga]=ma(e,t,r)}static with(e){return class extends va{constructor(t,r){super(t,e,r)}}}get encodedLength(){return 1+S(this,ga)[ga].encodedLength}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return this.isNone}get isNone(){return S(this,ga)[ga]instanceof wf}get isSome(){return!this.isNone}get value(){return S(this,ga)[ga]}eq(e){return e instanceof va?this.isSome===e.isSome&&this.value.eq(e.value):this.value.eq(e)}toHex(){return this.isNone?"0x":Object(ve.a)(this.toU8a().subarray(1))}toHuman(e){return S(this,ga)[ga].toHuman(e)}toJSON(){return S(this,ga)[ga].toJSON()}toRawType(e){const t=this.registry.getClassName(S(this,ya)[ya])||new(S(this,ya)[ya])(this.registry).toRawType();return e?t:`Option<${t}>`}toString(){return S(this,ga)[ga].toString()}toU8a(e){if(e)return S(this,ga)[ga].toU8a(!0);const t=new Uint8Array(this.encodedLength);return this.isSome&&(t.set([1]),t.set(S(this,ga)[ga].toU8a(),1)),t}unwrap(){return Object(T.a)(this.isSome,"Option: unwrapping a None value"),S(this,ga)[ga]}unwrapOr(e){return this.isSome?this.unwrap():e}unwrapOrDefault(){return this.isSome?this.unwrap():new(S(this,ya)[ya])(this.registry)}}class wa extends Gf{constructor(e,t,r,n){super(e,{Ok:t,Err:r},n)}static with(e){return class extends wa{constructor(t,r){super(t,e.Ok,e.Err,r)}}}get asErr(){return Object(T.a)(this.isErr,"Cannot extract Err value from Ok result, check isErr first"),this.value}get asError(){return this.asErr}get asOk(){return Object(T.a)(this.isOk,"Cannot extract Ok value from Err result, check isOk first"),this.value}get isEmpty(){return this.isOk&&this.value.isEmpty}get isErr(){return!this.isOk}get isError(){return this.isErr}get isOk(){return 0===this.index}toRawType(){const e=this._toRawStruct();return`Result<${e.Ok},${e.Err}>`}}function Ma(e,t){return t.reduce((t,r)=>t.or(tt(e[r]||0)),new Je.a(0))}function Oa(e,t){const r=tt(t),n=Object.keys(e).reduce((t,n)=>(r.and(tt(e[n])).eq(tt(e[n]))&&t.push(n),t),[]),i=Ma(e,n);return Object(T.a)(r.eq(i),()=>`Set: Mismatch decoding '${r.toString()}', computed as '${i.toString()}' with ${n.join(", ")}`),n}function xa(e,t=0,r){Object(T.a)(r%8==0,()=>"Expected valid bitLength, power of 8, found "+r);const n=r/8;if(Object(C.a)(t))return xa(e,Object(ge.a)(t),n);if(Object(Oe.a)(t))return 0===t.length?[]:Oa(e,or(t.subarray(0,n),{isLe:!0}));if(t instanceof Set||Array.isArray(t)){return function(e,t){return t.reduce((t,r)=>(Object(T.a)(!Object(I.a)(e[r]),()=>`Set: Invalid key '${r}' passed to Set, allowed ${Object.keys(e).join(", ")}`),t.push(r),t),[])}(e,Array.isArray(t)?t:[...t.values()])}return Oa(e,t)}var Sa=j("allowed"),ka=j("byteLength");class ja extends Set{constructor(e,t,r,n=8){super(xa(t,r,n)),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,Sa,{writable:!0,value:void 0}),Object.defineProperty(this,ka,{writable:!0,value:void 0}),this.add=e=>(Object(T.a)(Object(I.a)(S(this,Sa)[Sa])||!Object(I.a)(S(this,Sa)[Sa][e]),()=>`Set: Invalid key '${e}' on add`),super.add(e),this),this.registry=e,S(this,Sa)[Sa]=t,S(this,ka)[ka]=n/8}static with(e,t){return class extends ja{constructor(r,n){super(r,e,n,t),Object.keys(e).forEach(e=>{const t="is"+Df(je(e));Object(I.a)(this[t])&&Object.defineProperty(this,t,{enumerable:!0,get:()=>this.strings.includes(e)})})}}}get encodedLength(){return S(this,ka)[ka]}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.size}get strings(){return[...super.values()]}get valueEncoded(){return Ma(S(this,Sa)[Sa],this.strings)}eq(e){return Array.isArray(e)?yf(this.strings.sort(),e.sort()):e instanceof Set?this.eq([...e.values()]):!(!D(e)&&!Object(Tc.a)(e))&&this.valueEncoded.eq(tt(e))}toHex(){return Object(ve.a)(this.toU8a())}toHuman(){return this.toJSON()}toJSON(){return this.strings}toNumber(){return this.valueEncoded.toNumber()}toRawType(){return H({_set:S(this,Sa)[Sa]})}toString(){return`[${this.strings.join(", ")}]`}toU8a(e){return dr(this.valueEncoded,{bitLength:8*S(this,ka)[ka],isLe:!0})}}const Pa=Object(E.a)("Vec");class Aa extends gf{constructor(e,t,r=[]){const n=Te(e,t);super(e,...Aa.decodeVec(e,n,r)),this._Type=void 0,this._Type=n}static decodeVec(e,t,r){if(Array.isArray(r))return r.map((r,n)=>{try{return r instanceof t?r:new t(e,r)}catch(e){throw Pa.error("Unable to decode on index "+n,e.message),e}});const n=Object(ge.a)(r),[i,f]=Ef(n);return Object(T.a)(f.lten(65536),()=>`Vec length ${f.toString()} exceeds 65536`),Ie(e,n.subarray(i),new Array(f.toNumber()).fill(t))}static with(e){return class extends Aa{constructor(t,r){super(t,e,r)}}}get Type(){return this._Type.name}indexOf(e){const t=e instanceof this._Type?e:new this._Type(this.registry,e);for(let e=0;e<this.length;e++)if(t.eq(this[e]))return e;return-1}toRawType(){return`Vec<${this.registry.getClassName(this._Type)||new this._Type(this.registry).toRawType()}>`}}class Ea extends gf{constructor(e,t,r,n=[]){const i=Te(e,t);super(e,...function(e,t,r,n){const i=Aa.decodeVec(e,t,Object(Oe.a)(n)||Object(Me.a)(n)?Ae(mf(r),n):n);for(;i.length<r;)i.push(new t(e));return Object(T.a)(i.length===r,()=>`Expected a length of exactly ${r} entries`),i}(e,i,r,n)),this._Type=void 0,this._Type=i}static with(e,t){return class extends Ea{constructor(r,n){super(r,e,t,n)}}}get Type(){return new this._Type(this.registry).toRawType()}get encodedLength(){return this.reduce((e,t)=>e+t.encodedLength,0)}toU8a(){const e=this.map(e=>e.toU8a());return e.length?Ae(...e):new Uint8Array([])}toRawType(){return`[${this.Type};${this.length}]`}}class Ia extends wf{constructor(e,t="DoNotConstruct"){throw super(e),new Error("Cannot construct unknown type "+t)}static with(e){return class extends Ia{constructor(t){super(t,e)}}}}function Ta(e,t){return La(e,fn(t))}function Ra(e){return Object(T.a)(e.sub&&Array.isArray(e.sub),()=>"Expected subtype as TypeDef[] in "+H(e)),e.sub}function Na(e){return function(e){return Object(T.a)(e.sub&&!Array.isArray(e.sub),()=>"Expected subtype as TypeDef in "+H(e)),e.sub}(e).type}function _a(e){return Ra(e).reduce((e,t)=>(e[t.name]=t.type,e),{})}function Ca(e){return Ra(e).map(({type:e})=>e)}function Ba({displayName:e,length:t},r){return Object(T.a)(D(t),()=>`Expected bitLength information for ${e||r.constructor.name}<bitLength>`),r.with(t,e)}function Ha(e,t){const[r,n]=Ca(e);return t.with(r,n)}const Da={[Wr.BTreeMap]:(e,t)=>Ha(t,fa),[Wr.BTreeSet]:(e,t)=>da.with(Na(t)),[Wr.Compact]:(e,t)=>la.with(Na(t)),[Wr.DoNotConstruct]:(e,t)=>Ia.with(t.displayName),[Wr.Enum]:(e,t)=>{const r=Ra(t);return Gf.with(r.every(({type:e})=>"Null"===e)?r.reduce((e,{index:t,name:r},n)=>(e[r]=t||n,e),{}):_a(t))},[Wr.HashMap]:(e,t)=>Ha(t,pa),[Wr.Int]:(e,t)=>Ba(t,ba),[Wr.Linkage]:(e,t)=>{const r=`Option<${Na(t)}>`,n=Le.with({previous:r,next:r});return n.prototype.toRawType=function(){return`Linkage<${this.next.toRawType(!0)}>`},n},[Wr.Null]:(e,t)=>Ta(e,"Null"),[Wr.Option]:(e,t)=>va.with(Na(t)),[Wr.Plain]:(e,t)=>e.getOrUnknown(t.type),[Wr.Result]:(e,t)=>{const[r,n]=Ca(t);return wa.with({Err:n,Ok:r})},[Wr.Set]:(e,t)=>ja.with(Ra(t).reduce((e,{index:t,name:r})=>(e[r]=t,e),{}),t.length),[Wr.Struct]:(e,t)=>Le.with(_a(t),t.alias),[Wr.Tuple]:(e,t)=>vf.with(Ca(t)),[Wr.UInt]:(e,t)=>Ba(t,Er),[Wr.Vec]:(e,t)=>{const r=Na(t);return"u8"===r?Ta(e,"Bytes"):Aa.with(r)},[Wr.VecFixed]:(e,{displayName:t,length:r,sub:n})=>(Object(T.a)(D(r)&&!Object(I.a)(n),"Expected length & type information for fixed vector"),"u8"===n.type?Ac.with(8*r,t):Ea.with(n.type,r))};function La(e,t){let r=e.get(t.type);if(r)return r;const n=Da[t.info];return Object(T.a)(n,()=>"Unable to construct class from "+H(t)),r=n(e,t),!r.__fallbackType&&t.fallbackType&&(r.__fallbackType=t.fallbackType),r}function za(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 Va(e,t){return Fa.filterOrigin(t).reduce((t,{name:r,type:n})=>{const i=La(e,fn(n));return t[r.toString()]=i,t},{})}function qa(e,t=new Uint8Array,r){if(Object(Me.a)(t)||Object(Oe.a)(t))return function(e,t,r){const n=new Uint8Array(2);n.set(t.subarray(0,2),0);const i=r||e.findMetaCall(n).meta;return{args:t.subarray(2),argsDef:Va(e,i),callIndex:n,meta:i}}(e,Object(ge.a)(t),r);if(Object(xe.a)(t)&&t.callIndex&&t.args)return function(e,t,r){const{args:n,callIndex:i}=t,f=i instanceof Ua?i.toU8a():i,c=r||e.findMetaCall(f).meta;return{args:n,argsDef:Va(e,c),callIndex:i,meta:c}}(e,t,r);throw new Error(`Call: Cannot decode value '${t}' of type ${typeof t}`)}class Ua extends Ac{constructor(e,t){super(e,t,16)}}class Fa extends Le{constructor(e,t,r){const n=qa(e,t,r);try{super(e,{callIndex:Ua,args:Le.with(n.argsDef)},n),this._meta=void 0}catch(t){let r="unknown.unknown";try{const t=e.findMetaCall(n.callIndex);r=`${t.section}.${t.method}`}catch(e){}throw new Error(`Call: failed decoding ${r}:: ${t.message}`)}this._meta=n.meta}static filterOrigin(e){return e?e.args.filter(({type:e})=>"Origin"!==e.toString()):[]}get args(){return[...this.get("args").values()]}get argsDef(){return Va(this.registry,this.meta)}get callIndex(){return this.get("callIndex").toU8a()}get data(){return this.get("args").toU8a()}get meta(){return this._meta}get method(){return this.registry.findMetaCall(this.callIndex).method}get section(){return this.registry.findMetaCall(this.callIndex).section}is(e){return e.callIndex[0]===this.callIndex[0]&&e.callIndex[1]===this.callIndex[1]}toHuman(e){var t,r;let n;try{n=this.registry.findMetaCall(this.callIndex)}catch(e){}return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?za(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({args:this.args.map(t=>t.toHuman(e)),method:null===(t=n)||void 0===t?void 0:t.method,section:null===(r=n)||void 0===r?void 0:r.section},e&&n?{documentation:n.meta.documentation.map(e=>e.toString())}:{})}toRawType(){return"Call"}}function Wa(e,t,r,n=!0){return r&&Object(be.a)(r.unwrapOrDefault)?r:e.createType(t,n?R(r)||Object(I.a)(r)?null:Array.isArray(r)?r:[r]:r)}function Ka(e,t){return(t&&Object(be.a)(t.entries)?[...t.entries()]:Object.entries(t||{})).reduce((t,[r,n])=>(t[r]=function(e,t,r){return"ss58Format"===t?Wa(e,"Option<u32>",r,!1):"tokenDecimals"===t?Wa(e,"Option<Vec<u32>>",r):"tokenSymbol"===t?Wa(e,"Option<Vec<Text>>",r):r}(e,r,n),t),{ss58Format:e.createType("Option<u32>"),tokenDecimals:e.createType("Option<Vec<u32>>"),tokenSymbol:e.createType("Option<Vec<Text>>")})}class Xa extends ef{constructor(e,t){super(e,Ka(e,t))}get ss58Format(){return this.get("ss58Format")}get tokenDecimals(){return this.get("tokenDecimals")}get tokenSymbol(){return this.get("tokenSymbol")}}const Za=Object(ni.a)("aura"),Ga=Object(ni.a)("BABE"),Ya=Object(ni.a)("FRNK"),Ja=Object(ni.a)("pow_");class Qa extends Ac{constructor(e,t){super(e,D(t)?dr(t,{isLe:!1}):t,32)}get isAura(){return this.eq(Za)}get isBabe(){return this.eq(Ga)}get isGrandpa(){return this.eq(Ya)}get isPow(){return this.eq(Ja)}_getAuraAuthor(e,t){return t[this.registry.createType("RawAuraPreDigest",e.toU8a(!0)).slotNumber.mod(new Je.a(t.length)).toNumber()]}_getBabeAuthor(e,t){return t[this.registry.createType("RawBabePreDigestCompat",e.toU8a(!0)).value.toNumber()]}_getBytesAsAuthor(e){return this.registry.createType("AccountId",e)}extractAuthor(e,t){if(null!=t&&t.length){if(this.isAura)return this._getAuraAuthor(e,t);if(this.isBabe)return this._getBabeAuthor(e,t)}if(this.isPow||20===e.length)return this._getBytesAsAuthor(e)}toHuman(){return this.toString()}toRawType(){return"ConsensusEngineId"}toString(){return this.isAscii?ri(this):Object(ve.a)(this)}}const $a=new Uint8Array([255]);class eo extends Tf{constructor(e,t=new Uint8Array){super(e,eo._decodeAddress(e,t))}static _decodeAddress(e,t){return t instanceof eo?t._raw:t instanceof Yc||t instanceof Kc?t:Object(Tc.a)(t)||D(t)||B(t)?e.createType("AccountIndex",t):Array.isArray(t)||Object(Me.a)(t)||Object(Oe.a)(t)?function(e,t){if(32===t.length)return e.createType("AccountId",t);if(255===t[0])return e.createType("AccountId",t.subarray(1));const[r,n]=Kc.readLength(t);return e.createType("AccountIndex",or(t.subarray(r,r+n),!0))}(e,Object(ge.a)(t)):function(e,t){const r=Vc(t);return 32===r.length?e.createType("AccountId",r):e.createType("AccountIndex",or(r,!0))}(e,t)}get encodedLength(){const e=this._rawLength;return e+(e>1?1:0)}get _rawLength(){return this._raw instanceof Kc?Kc.calcLength(this._raw):this._raw.encodedLength}toHex(){return Object(ve.a)(this.toU8a())}toRawType(){return"Address"}toU8a(e){const t=this._raw.toU8a().subarray(0,this._rawLength);return e?t:Ae(this._raw instanceof Kc?Kc.writeLength(t):$a,t)}}function to(e,t){return[0,32].includes(t.length)?{Id:t}:20===t.length?{Address20:t}:t.length<=8?{Index:e.createType("AccountIndex",t).toNumber()}:t}class ro extends Gf{constructor(e,t){super(e,{Id:"AccountId",Index:"Compact<AccountIndex>",Raw:"Bytes",Address32:"H256",Address20:"H160"},function(e,t){return t instanceof ro?t:t instanceof Yc?{Id:t}:t instanceof Kc||Object(Tc.a)(t)||D(t)?{Index:D(t)?t:t.toNumber()}:Object(C.a)(t)?to(e,Vc(t.toString())):Object(Oe.a)(t)?to(e,t):t}(e,t))}toString(){return this.value.toString()}}class no extends Boolean{constructor(e,t=!1){super(function(e){return e instanceof Boolean?e.valueOf():Object(Oe.a)(e)?1===e[0]:!!e}(t)),this.registry=void 0,this.createdAtHash=void 0,this.registry=e}get encodedLength(){return 1}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return this.isFalse}get isFalse(){return!this.isTrue}get isTrue(){return this.valueOf()}eq(e){return this.valueOf()===(e instanceof Boolean?e.valueOf():e)}toHex(){return Object(ve.a)(this.toU8a())}toHuman(){return this.toJSON()}toJSON(){return this.valueOf()}toRawType(){return"bool"}toString(){return this.toJSON().toString()}toU8a(e){return new Uint8Array([this.valueOf()?1:0])}}function io(e){return e?new Uint8Array([128]):new Uint8Array([0])}function fo(e,t){return Object(I.a)(t)||t instanceof Boolean||Ee(t)?io(new no(e,t).isTrue):D(t)?io(t<0):Object(Oe.a)(t)?function(e){return e.length?e.subarray(0,1):new Uint8Array([0])}(t):function(e,t){const r=new no(e,t.aye).isTrue?128:0,n=e.createType("Conviction",t.conviction||0);return new Uint8Array([r|n.index])}(e,t)}class co extends Ac{constructor(e,t){const r=fo(e,t);super(e,r,8),this._aye=void 0,this._conviction=void 0,this._aye=128==(128&r[0]),this._conviction=this.registry.createType("Conviction",127&r[0])}get conviction(){return this._conviction}get isAye(){return this._aye}get isNay(){return!this.isAye}toHuman(e){return{conviction:this.conviction.toHuman(e),vote:this.isAye?"Aye":"Nay"}}toRawType(){return"Vote"}}function ao(e){if(Array.isArray(e)||Object(C.a)(e)){const t=Object(ge.a)(e);return[t.length/8,t]}return function(e){if(!e||!e.length)return[0,new Uint8Array];const[t,r]=Ef(e),n=t+Math.ceil(r.toNumber()/8);return Object(T.a)(n<=e.length,()=>`BitVec: required length less than remainder, expected at least ${n}, found ${e.length}`),[r.toNumber(),e.subarray(t,n)]}(e)}class oo extends rf{constructor(e,t){const[r,n]=ao(t);super(e,n),this._decodedLength=void 0,this._decodedLength=r}get encodedLength(){return this.length+mf(this._decodedLength).length}toHuman(){return"0b"+[...this.toU8a(!0)].map(e=>("00000000"+e.toString(2)).slice(-8)).join("_")}toRawType(){return"BitVec"}toU8a(e){const t=super.toU8a();return e?t:Ae(mf(this._decodedLength),t)}}function so(e){return Array.isArray(e)||Object(C.a)(e)?Object(ge.a)(e):e instanceof rf||!Object(Oe.a)(e)?e:function(e){if(!e.length)return new Uint8Array;const[t,r]=Ef(e),n=t+r.toNumber();return Object(T.a)(r.lten(10485760),()=>`Bytes length ${r.toString()} exceeds 10485760`),Object(T.a)(n<=e.length,()=>`Bytes: required length less than remainder, expected at least ${n}, found ${e.length}`),e.subarray(t,n)}(e)}class uo extends rf{constructor(e,t){super(e,so(t))}get encodedLength(){return this.length+mf(this.length).length}toRawType(){return"Bytes"}toU8a(e){return e?super.toU8a(e):If(this)}}function ho(e,t){return t?Object(Oe.a)(t)||Object(C.a)(t)?function(e,t){const r=t[0];if(!r)return[void 0,void 0];if(r>=1&&r<=33){const n=r-1,i=t.subarray(1,n+1);return[e.createType("Raw",i),1]}if(r>=34&&r<=37)return[t.subarray(1,33),r-32];throw new Error("Unable to decode Data, invalid indicator byte "+r)}(e,Object(ge.a)(t)):[t,void 0]:[void 0,void 0]}class lo extends Gf{constructor(e,t){super(e,{None:"Null",Raw:"Bytes",BlakeTwo256:"H256",Sha256:"H256",Keccak256:"H256",ShaThree256:"H256"},...ho(e,t)),Object(T.a)(!this.isRaw||this.asRaw.length<=32,"Data.Raw values are limited to a maximum length of 32 bytes")}get asBlakeTwo256(){return this.value}get asKeccak256(){return this.value}get asRaw(){return this.value}get asSha256(){return this.value}get asShaThree256(){return this.value}get isBlakeTwo256(){return 2===this.index}get isKeccak256(){return 4===this.index}get isNone(){return 0===this.index}get isRaw(){return 1===this.index}get isSha256(){return 3===this.index}get isShaThree256(){return 5===this.index}get encodedLength(){return this.toU8a().length}toU8a(){if(0===this.index)return new Uint8Array(1);if(1===this.index){const e=this.value.toU8a(!0),t=Math.min(e.length,32),r=new Uint8Array(t+1);return r.set([t+1],0),r.set(e.subarray(0,t),1),r}const e=new Uint8Array(33);return e.set([this.index+32],0),e.set(this.value.toU8a(),1),e}}class po extends(ba.with(8)){}class bo extends(ba.with(16)){}class mo extends(ba.with(32)){}class yo extends(ba.with(64)){}class go extends(ba.with(128)){}class vo extends(ba.with(256)){}const wo={Blake2_128:[16,!1],Blake2_128Concat:[16,!0],Blake2_256:[32,!1],Identity:[0,!0],Twox128:[16,!1],Twox256:[32,!1],Twox64Concat:[8,!0]};function Mo(e,t){const r=e.isPlain?e.asPlain.toString():e.isMap?e.asMap.value.toString():e.isDoubleMap?e.asDoubleMap.value.toString():e.asNMap.value.toString();return t?`Option<${r}>`:r}function Oo(e,t,r){let n=32;return r.reduce((r,[i,f])=>{const[c,a]=wo[i.type],o=a?e.createType(f,t.subarray(n+c)):e.createType("Raw",t.subarray(n,n+c));return n+=c+(a?o.encodedLength:0),r.push(o),r},[])}class xo extends uo{constructor(e,t,r={}){const{key:n,method:i,section:f}=function(e){if(e instanceof xo)return{key:e,method:e.method,section:e.section};if(!e||Object(C.a)(e)||Object(Oe.a)(e))return{key:e};if(Object(be.a)(e))return{key:e(),method:e.method,section:e.section};if(Array.isArray(e)){const[t,r]=e;return Object(T.a)(Object(be.a)(t),"Expected function input for key construction"),{key:t(r),method:t.method,section:t.section}}throw new Error(`Unable to convert input ${e} to StorageKey`)}(t);super(e,n),this._args=void 0,this._meta=void 0,this._outputType=void 0,this._method=void 0,this._section=void 0,this._outputType=function(e){if(e instanceof xo)return e.outputType;if(Object(be.a)(e))return Mo(e.meta.type);if(Array.isArray(e)){const[t]=e;if(t.meta)return Mo(t.meta.type)}return"Raw"}(t),this.setMeta(function(e){if(e instanceof xo)return e.meta;if(Object(be.a)(e))return e.meta;if(Array.isArray(e)){const[t]=e;return t.meta}}(t),r.section||f,r.method||i)}get args(){return this._args}get meta(){return this._meta}get method(){return this._method}get outputType(){return this._outputType}get section(){return this._section}is(e){return e.section===this.section&&e.method===this.method}setMeta(e,t,r){this._meta=e,this._method=r||this._method,this._section=t||this._section,e&&(this._outputType=Mo(e.type));try{this._args=function(e,t,r){if(!r||!(r.type.isMap||r.type.isDoubleMap||r.type.isNMap))return[];if(r.type.isMap){const n=r.type.asMap;return Oo(e,t,[[n.hasher,n.key.toString()]])}if(r.type.isDoubleMap){const n=r.type.asDoubleMap;return Oo(e,t,[[n.hasher,n.key1.toString()],[n.key2Hasher,n.key2.toString()]])}const n=r.type.asNMap;return Oo(e,t,n.hashers.map((e,t)=>[e,n.keyVec[t].toString()]))}(this.registry,this.toU8a(!0),this.meta)}catch(e){}return this}toHuman(){return this._args.length?this._args.map(e=>e.toHuman()):super.toHuman()}toRawType(){return"StorageKey"}}var So=j("override");class ko extends String{constructor(e,t){super(function(e){if(Object(Me.a)(e))return ri(Object(Pe.a)(e));if(e instanceof Uint8Array){if(!e.length)return"";if(e instanceof rf)return ri(e);const[t,r]=Ef(e),n=t+r.toNumber();return Object(T.a)(r.lten(131072),()=>`Text: length ${r.toString()} exceeds 131072`),Object(T.a)(n<=e.length,()=>`Text: required length less than remainder, expected at least ${n}, found ${e.length}`),ri(e.subarray(t,n))}return e?e.toString():""}(t)),this.registry=void 0,this.createdAtHash=void 0,Object.defineProperty(this,So,{writable:!0,value:null}),this.registry=e}get encodedLength(){return this.toU8a().length}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.length}get length(){return super.length}eq(e){return!!Object(C.a)(e)&&this.toString()===e.toString()}setOverride(e){S(this,So)[So]=e}toHex(){return Object(ve.a)(this.toU8a(!0))}toHuman(){return this.toJSON()}toJSON(){return this.toString()}toRawType(){return"Text"}toString(){return S(this,So)[So]||super.toString()}toU8a(e){const t=Object(ni.a)(super.toString());return e?t:If(t)}}class jo extends ko{constructor(e,t=""){super(e,t),this.setOverride(Fr(this.toString()))}toRawType(){return"Type"}}class Po extends(Er.with(8)){}class Ao extends(Er.with(16)){}class Eo extends(Er.with(128)){}class Io extends(Er.with(256)){}class To extends Ir{constructor(e,t){throw super(e,t),new Error("The `usize` type should not be used. Since it is platform-specific, it creates incompatibilities between native (generally u64) and WASM (always u32) code. Use one of the `u32` or `u64` types explicitly.")}}function Ro(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 No(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ro(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ro(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _o={rpc:{},types:No(No({},{Fixed64:"Int<64, Fixed64>",FixedI64:"Int<64, FixedI64>",FixedU64:"UInt<64, FixedU64>",Fixed128:"Int<128, Fixed128>",FixedI128:"Int<128, FixedI128>",FixedU128:"UInt<128, FixedU128>",I32F32:"Int<64, I32F32>",U32F32:"UInt<64, U32F32>",PerU16:"UInt<16, PerU16>",Perbill:"UInt<32, Perbill>",Percent:"UInt<8, Percent>",Permill:"UInt<32, Permill>",Perquintill:"UInt<64, Perquintill>"}),{},{AccountId:"GenericAccountId",AccountIdOf:"AccountId",AccountIndex:"GenericAccountIndex",Address:"MultiAddress",AssetId:"u32",Balance:"UInt<128, Balance>",BalanceOf:"Balance",Block:"GenericBlock",BlockNumber:"u32",Call:"GenericCall",CallHash:"Hash",CallHashOf:"CallHash",ChangesTrieConfiguration:{digestInterval:"u32",digestLevels:"u32"},ChangesTrieSignal:{_enum:{NewConfiguration:"Option<ChangesTrieConfiguration>"}},ConsensusEngineId:"GenericConsensusEngineId",CodecHash:"Hash",Digest:{logs:"Vec<DigestItem>"},DigestItem:{_enum:{Other:"Bytes",AuthoritiesChange:"Vec<AuthorityId>",ChangesTrieRoot:"Hash",SealV0:"SealV0",Consensus:"Consensus",Seal:"Seal",PreRuntime:"PreRuntime",ChangesTrieSignal:"ChangesTrieSignal"}},ExtrinsicsWeight:{normal:"Weight",operational:"Weight"},H32:"[u8; 4; H32]",H64:"[u8; 8; H64]",H128:"[u8; 16; H128]",H160:"[u8; 20; H160]",H256:"[u8; 32; H256]",H512:"[u8; 64; H512]",H1024:"[u8; 128; H1024]",H2048:"[u8; 256; H2048]",Hash:"H256",Header:{parentHash:"Hash",number:"Compact<BlockNumber>",stateRoot:"Hash",extrinsicsRoot:"Hash",digest:"Digest"},HeaderPartial:{parentHash:"Hash",number:"BlockNumber"},IndicesLookupSource:"GenericLookupSource",Index:"u32",Justification:"(ConsensusEngineId, EncodedJustification)",EncodedJustification:"Bytes",Justifications:"Vec<Justification>",KeyValue:"(StorageKey, StorageData)",KeyTypeId:"u32",LockIdentifier:"[u8; 8]",LookupSource:"MultiAddress",LookupTarget:"AccountId",ModuleId:"LockIdentifier",MultiAddress:"GenericMultiAddress",MultiSigner:{_enum:{Ed25519:"[u8; 32]",Sr25519:"[u8; 32]",Ecdsa:"[u8; 33]"}},Moment:"UInt<64, Moment>",OpaqueCall:"Bytes",Origin:"DoNotConstruct<Origin>",OriginCaller:{_enum:{System:"SystemOrigin"}},PalletId:"LockIdentifier",PalletsOrigin:"OriginCaller",PalletVersion:{major:"u16",minor:"u8",patch:"u8"},Pays:{_enum:["Yes","No"]},Phantom:"Null",PhantomData:"Null",Releases:{_enum:["V1","V2","V3","V4","V5","V6","V7","V8","V9","V10"]},RuntimeDbWeight:{read:"Weight",write:"Weight"},SignedBlock:"SignedBlockWithJustifications",SignedBlockWithJustification:{block:"Block",justification:"Option<EncodedJustification>"},SignedBlockWithJustifications:{block:"Block",justifications:"Option<Justifications>"},Slot:"u64",StorageData:"Bytes",StorageProof:{trieNodes:"Vec<Bytes>"},TransactionPriority:"u64",TransactionInfo:{_alias:{dataSize:"size"},chunkRoot:"H256",contentHash:"H256",dataSize:"u32",blockChunks:"u32"},TransactionStorageProof:{chunk:"Vec<u8>",proof:"Vec<Vec<u8>>"},ValidatorId:"AccountId",ValidatorIdOf:"ValidatorId",Weight:"u64",WeightMultiplier:"Fixed64",PreRuntime:"(ConsensusEngineId, Bytes)",SealV0:"(u64, Signature)",Seal:"(ConsensusEngineId, Bytes)",Consensus:"(ConsensusEngineId, Bytes)"})},Co={rpc:{},types:{AssetApprovalKey:{owner:"AccountId",delegate:"AccountId"},AssetApproval:{amount:"TAssetBalance",deposit:"TAssetDepositBalance"},AssetBalance:{balance:"TAssetBalance",isFrozen:"bool",isSufficient:"bool"},AssetDestroyWitness:{accounts:"Compact<u32>",sufficients:"Compact<u32>",approvals:"Compact<u32>"},AssetDetails:{owner:"AccountId",issuer:"AccountId",admin:"AccountId",freezer:"AccountId",supply:"TAssetBalance",deposit:"TAssetDepositBalance",minBalance:"TAssetBalance",isSufficient:"bool",accounts:"u32",sufficients:"u32",approvals:"u32",isFrozen:"bool"},AssetMetadata:{deposit:"TAssetDepositBalance",name:"Vec<u8>",symbol:"Vec<u8>",decimals:"u8",isFrozen:"bool"},TAssetBalance:"u64",TAssetDepositBalance:"BalanceOf"}},Bo={rpc:{},types:{UncleEntryItem:{_enum:{InclusionHeight:"BlockNumber",Uncle:"(Hash, Option<AccountId>)"}}}},Ho={rpc:{},types:{RawAuraPreDigest:{slotNumber:"u64"}}},Do={rpc:{epochAuthorship:{description:"Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore",params:[],type:"HashMap<AuthorityId, EpochAuthorship>"}},types:{AllowedSlots:{_enum:["PrimarySlots","PrimaryAndSecondaryPlainSlots","PrimaryAndSecondaryVRFSlots"]},BabeAuthorityWeight:"u64",BabeEpochConfiguration:{c:"(u64, u64)",allowedSlots:"AllowedSlots"},BabeBlockWeight:"u32",BabeEquivocationProof:{offender:"AuthorityId",slotNumber:"SlotNumber",firstHeader:"Header",secondHeader:"Header"},BabeWeight:"u64",MaybeRandomness:"Option<Randomness>",MaybeVrf:"Option<VrfData>",EpochAuthorship:{primary:"Vec<u64>",secondary:"Vec<u64>",secondary_vrf:"Vec<u64>"},NextConfigDescriptor:{_enum:{V0:"Null",V1:"NextConfigDescriptorV1"}},NextConfigDescriptorV1:{c:"(u64, u64)",allowedSlots:"AllowedSlots"},Randomness:"Hash",RawBabePreDigest:{_enum:{Phantom:"Null",Primary:"RawBabePreDigestPrimary",SecondaryPlain:"RawBabePreDigestSecondaryPlain",SecondaryVRF:"RawBabePreDigestSecondaryVRF"}},RawBabePreDigestPrimary:{authorityIndex:"u32",slotNumber:"SlotNumber",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestSecondaryPlain:{authorityIndex:"u32",slotNumber:"SlotNumber"},RawBabePreDigestSecondaryVRF:{authorityIndex:"u32",slotNumber:"SlotNumber",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestTo159:{_enum:{Primary:"RawBabePreDigestPrimaryTo159",Secondary:"RawBabePreDigestSecondaryTo159"}},RawBabePreDigestPrimaryTo159:{authorityIndex:"u32",slotNumber:"SlotNumber",weight:"BabeBlockWeight",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestSecondaryTo159:{authorityIndex:"u32",slotNumber:"SlotNumber",weight:"BabeBlockWeight"},RawBabePreDigestCompat:{_enum:{Zero:"u32",One:"u32",Two:"u32",Three:"u32"}},SlotNumber:"u64",VrfData:"[u8; 32]",VrfOutput:"[u8; 32]",VrfProof:"[u8; 64]"}},Lo={rpc:{},types:{AccountData:{free:"Balance",reserved:"Balance",miscFrozen:"Balance",feeFrozen:"Balance"},BalanceLockTo212:{id:"LockIdentifier",amount:"Balance",until:"BlockNumber",reasons:"WithdrawReasons"},BalanceLock:{id:"LockIdentifier",amount:"Balance",reasons:"Reasons"},BalanceStatus:{_enum:["Free","Reserved"]},Reasons:{_enum:["Fee","Misc","All"]},ReserveData:{id:"ReserveIdentifier",amount:"Balance"},ReserveIdentifier:"[u8; 8]",VestingSchedule:{offset:"Balance",perBlock:"Balance",startingBlock:"BlockNumber"},WithdrawReasons:{_set:{TransactionPayment:1,Transfer:2,Reserve:4,Fee:8,Tip:16}}}},zo={rpc:{subscribeJustifications:{description:"Returns the block most recently finalized by BEEFY, alongside side its justification.",params:[],pubsub:["justifications","subscribeJustifications","unsubscribeJustifications"],type:"BeefySignedCommitment"}},types:{BeefyCommitment:{payload:"BeefyPayload",blockNumber:"BlockNumber",validatorSetId:"ValidatorSetId"},BeefyId:"[u8; 33]",BeefySignedCommitment:{commitment:"BeefyCommitment",signatures:"Vec<Option<Signature>>"},BeefyNextAuthoritySet:{id:"u64",len:"u32",root:"H256"},BeefyPayload:"MmrRootHash",MmrRootHash:"H256",ValidatorSetId:"u64"}},Vo={rpc:{},types:{CollectiveOrigin:{_enum:{Members:"(MemberCount, MemberCount)",Member:"AccountId"}},MemberCount:"u32",ProposalIndex:"u32",VotesTo230:{index:"ProposalIndex",threshold:"MemberCount",ayes:"Vec<AccountId>",nays:"Vec<AccountId>"},Votes:{index:"ProposalIndex",threshold:"MemberCount",ayes:"Vec<AccountId>",nays:"Vec<AccountId>",end:"BlockNumber"}}},qo={rpc:{},types:{AuthorityId:"AccountId",RawVRFOutput:"[u8; 32]"}},Uo={rpc:{call:{description:"Executes a call to a contract",params:[{name:"callRequest",type:"ContractCallRequest"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ContractExecResult"},instantiate:{description:"Instantiate a new contract",params:[{name:"request",type:"InstantiateRequest"},{name:"at",type:"BlockHash",isHstoric:!0,isOptional:!0}],type:"ContractInstantiateResult"},getStorage:{description:"Returns the value under a specified storage key in a contract",params:[{name:"address",type:"AccountId"},{name:"key",type:"H256"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Option<Bytes>"},rentProjection:{description:"Returns the projected time a given contract will be able to sustain paying its rent",params:[{name:"address",type:"AccountId"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Option<BlockNumber>"}},types:{AliveContractInfo:{trieId:"TrieId",storageSize:"u32",pairCount:"u32",codeHash:"CodeHash",rentAllowance:"Balance",rentPaid:"Balance",deductBlock:"BlockNumber",lastWrite:"Option<BlockNumber>",_reserved:"Option<Null>"},CodeHash:"Hash",ContractCallRequest:{origin:"AccountId",dest:"AccountId",value:"Balance",gasLimit:"u64",inputData:"Bytes"},ContractExecResultSuccessTo255:{status:"u8",data:"Raw"},ContractExecResultTo255:{_enum:{Success:"ContractExecResultSuccessTo255",Error:"Null"}},ContractExecResultSuccessTo260:{flags:"u32",data:"Bytes",gasConsumed:"u64"},ContractExecResultTo260:{_enum:{Success:"ContractExecResultSuccessTo260",Error:"Null"}},ContractExecResultErrModule:{index:"u8",error:"u8",message:"Option<Text>"},ContractExecResultErr:{_enum:{Other:"Text",CannotLookup:"Null",BadOrigin:"Null",Module:"ContractExecResultErrModule"}},ContractExecResultOk:{flags:"u32",data:"Bytes"},ContractExecResultResult:{_enum:{Ok:"ContractExecResultOk",Err:"ContractExecResultErr"}},ContractExecResult:{gasConsumed:"u64",debugMessage:"Text",result:"ContractExecResultResult"},ContractInfo:{_enum:{Alive:"AliveContractInfo",Tombstone:"TombstoneContractInfo"}},ContractStorageKey:"[u8; 32]",DeletedContract:{pairCount:"u32",trieId:"TrieId"},ExecReturnValue:{flags:"u32",data:"Bytes"},Gas:"u64",HostFnWeightsTo264:{caller:"Weight",address:"Weight",gasLeft:"Weight",balance:"Weight",valueTransferred:"Weight",minimumBalance:"Weight",tombstoneDeposit:"Weight",rentAllowance:"Weight",blockNumber:"Weight",now:"Weight",weightToFee:"Weight",gas:"Weight",input:"Weight",inputPerByte:"Weight",return:"Weight",returnPerByte:"Weight",terminate:"Weight",restoreTo:"Weight",restoreToPerDelta:"Weight",random:"Weight",depositEvent:"Weight",depositEventPerTopic:"Weight",depositEventPerByte:"Weight",setRentAllowance:"Weight",setStorage:"Weight",setStoragePerByte:"Weight",clearStorage:"Weight",getStorage:"Weight",getStoragePerByte:"Weight",transfer:"Weight",call:"Weight",callTransferSurcharge:"Weight",callPerInputByte:"Weight",callPerOutputByte:"Weight",instantiate:"Weight",instantiatePerInputByte:"Weight",instantiatePerOutputByte:"Weight",hashSha2256:"Weight",hashSha2256PerByte:"Weight",hashKeccak256:"Weight",hashKeccak256PerByte:"Weight",hashBlake2256:"Weight",hashBlake2256PerByte:"Weight",hashBlake2128:"Weight",hashBlake2128PerByte:"Weight"},HostFnWeights:{caller:"Weight",address:"Weight",gasLeft:"Weight",balance:"Weight",valueTransferred:"Weight",minimumBalance:"Weight",tombstoneDeposit:"Weight",rentAllowance:"Weight",blockNumber:"Weight",now:"Weight",weightToFee:"Weight",gas:"Weight",input:"Weight",inputPerByte:"Weight",return:"Weight",returnPerByte:"Weight",terminate:"Weight",terminatePerCodeByte:"Weight",restoreTo:"Weight",restoreToPerCallerCodeByte:"Weight",restoreToPerTombstoneCodeByte:"Weight",restoreToPerDelta:"Weight",random:"Weight",depositEvent:"Weight",depositEventPerTopic:"Weight",depositEventPerByte:"Weight",setRentAllowance:"Weight",setStorage:"Weight",setStoragePerByte:"Weight",clearStorage:"Weight",getStorage:"Weight",getStoragePerByte:"Weight",transfer:"Weight",call:"Weight",callPerCodeByte:"Weight",callTransferSurcharge:"Weight",callPerInputByte:"Weight",callPerOutputByte:"Weight",instantiate:"Weight",instantiatePerCodeByte:"Weight",instantiatePerInputByte:"Weight",instantiatePerOutputByte:"Weight",instantiatePerSaltByte:"Weight",hashSha2256:"Weight",hashSha2256PerByte:"Weight",hashKeccak256:"Weight",hashKeccak256PerByte:"Weight",hashBlake2256:"Weight",hashBlake2256PerByte:"Weight",hashBlake2128:"Weight",hashBlake2128PerByte:"Weight",rentParams:"Weight"},InstantiateRequest:{origin:"AccountId",endowment:"Balance",gasLimit:"Gas",code:"Bytes",data:"Bytes",salt:"Bytes"},ContractInstantiateResult:{_enum:{Ok:"InstantiateReturnValue",Err:"Null"}},InstantiateReturnValue:{result:"ExecReturnValue",accountId:"AccountId",rentProjection:"Option<RentProjection>"},InstructionWeights:{i64const:"u32",i64load:"u32",i64store:"u32",select:"u32",rIf:"u32",br:"u32",brIf:"u32",brIable:"u32",brIablePerEntry:"u32",call:"u32",callIndirect:"u32",callIndirectPerParam:"u32",localGet:"u32",localSet:"u32",local_tee:"u32",globalGet:"u32",globalSet:"u32",memoryCurrent:"u32",memoryGrow:"u32",i64clz:"u32",i64ctz:"u32",i64popcnt:"u32",i64eqz:"u32",i64extendsi32:"u32",i64extendui32:"u32",i32wrapi64:"u32",i64eq:"u32",i64ne:"u32",i64lts:"u32",i64ltu:"u32",i64gts:"u32",i64gtu:"u32",i64les:"u32",i64leu:"u32",i64ges:"u32",i64geu:"u32",i64add:"u32",i64sub:"u32",i64mul:"u32",i64divs:"u32",i64divu:"u32",i64rems:"u32",i64remu:"u32",i64and:"u32",i64or:"u32",i64xor:"u32",i64shl:"u32",i64shrs:"u32",i64shru:"u32",i64rotl:"u32",i64rotr:"u32"},LimitsTo264:{eventTopics:"u32",stackHeight:"u32",globals:"u32",parameters:"u32",memoryPages:"u32",tableSize:"u32",brTableSize:"u32",subjectLen:"u32",codeSize:"u32"},Limits:{eventTopics:"u32",stackHeight:"u32",globals:"u32",parameters:"u32",memoryPages:"u32",tableSize:"u32",brTableSize:"u32",subjectLen:"u32"},PrefabWasmModule:{scheduleVersion:"Compact<u32>",initial:"Compact<u32>",maximum:"Compact<u32>",refcount:"Compact<u64>",_reserved:"Option<Null>",code:"Bytes",originalCodeLen:"u32"},RentProjection:{_enum:{EvictionAt:"BlockNumber",NoEviction:"Null"}},ScheduleTo212:{version:"u32",putCodePerByteCost:"Gas",growMemCost:"Gas",regularOpCost:"Gas",returnDataPerByteCost:"Gas",eventDataPerByteCost:"Gas",eventPerTopicCost:"Gas",eventBaseCost:"Gas",sandboxDataReadCost:"Gas",sandboxDataWriteCost:"Gas",maxEventTopics:"u32",maxStackHeight:"u32",maxMemoryPages:"u32",enablePrintln:"bool",maxSubjectLen:"u32"},ScheduleTo258:{version:"u32",putCodePerByteCost:"Gas",growMemCost:"Gas",regularOpCost:"Gas",returnDataPerByteCost:"Gas",eventDataPerByteCost:"Gas",eventPerTopicCost:"Gas",eventBaseCost:"Gas",sandboxDataReadCost:"Gas",sandboxDataWriteCost:"Gas",transferCost:"Gas",maxEventTopics:"u32",maxStackHeight:"u32",maxMemoryPages:"u32",enablePrintln:"bool",maxSubjectLen:"u32"},ScheduleTo264:{version:"u32",enablePrintln:"bool",limits:"LimitsTo264",instructionWeights:"InstructionWeights",hostFnWeights:"HostFnWeightsTo264"},Schedule:{version:"u32",enablePrintln:"bool",limits:"Limits",instructionWeights:"InstructionWeights",hostFnWeights:"HostFnWeights"},SeedOf:"Hash",TombstoneContractInfo:"Hash",TrieId:"Bytes"}};var Fo={rpc:{},types:{AccountVote:{_enum:{Standard:"AccountVoteStandard",Split:"AccountVoteSplit"}},AccountVoteSplit:{aye:"Balance",nay:"Balance"},AccountVoteStandard:{vote:"Vote",balance:"Balance"},Conviction:{_enum:["None","Locked1x","Locked2x","Locked3x","Locked4x","Locked5x","Locked6x"]},Delegations:{votes:"Balance",capital:"Balance"},PreimageStatus:{_enum:{Missing:"BlockNumber",Available:"PreimageStatusAvailable"}},PreimageStatusAvailable:{data:"Bytes",provider:"AccountId",deposit:"Balance",since:"BlockNumber",expiry:"Option<BlockNumber>"},PriorLock:"(BlockNumber, Balance)",PropIndex:"u32",Proposal:"Call",ProxyState:{_enum:{Open:"AccountId",Active:"AccountId"}},ReferendumIndex:"u32",ReferendumInfoTo239:{end:"BlockNumber",proposalHash:"Hash",threshold:"VoteThreshold",delay:"BlockNumber"},ReferendumInfo:{_enum:{Ongoing:"ReferendumStatus",Finished:"ReferendumInfoFinished"}},ReferendumInfoFinished:{approved:"bool",end:"BlockNumber"},ReferendumStatus:{end:"BlockNumber",proposalHash:"Hash",threshold:"VoteThreshold",delay:"BlockNumber",tally:"Tally"},Tally:{ayes:"Balance",nays:"Balance",turnout:"Balance"},Voting:{_enum:{Direct:"VotingDirect",Delegating:"VotingDelegating"}},VotingDirect:{votes:"Vec<VotingDirectVote>",delegations:"Delegations",prior:"PriorLock"},VotingDirectVote:"(ReferendumIndex, AccountVote)",VotingDelegating:{balance:"Balance",target:"AccountId",conviction:"Conviction",delegations:"Delegations",prior:"PriorLock"}}},Wo={rpc:{},types:{ApprovalFlag:"u32",DefunctVoter:{who:"AccountId",voteCount:"Compact<u32>",candidateCount:"Compact<u32>"},Renouncing:{_enum:{Member:"Null",RunnerUp:"Null",Candidate:"Compact<u32>"}},SetIndex:"u32",Vote:"GenericVote",VoteIndex:"u32",VoterInfo:{lastActive:"VoteIndex",lastWin:"VoteIndex",pot:"Balance",stake:"Balance"},VoteThreshold:{_enum:["Super majority approval","Super majority rejection","Simple majority"]}}},Ko={rpc:{createBlock:{description:"Instructs the manual-seal authorship task to create a new block",params:[{name:"createEmpty",type:"bool"},{name:"finalize",type:"bool"},{name:"parentHash",type:"BlockHash",isOptional:!0}],type:"CreatedBlock"},finalizeBlock:{description:"Instructs the manual-seal authorship task to finalize a block",params:[{name:"hash",type:"BlockHash"},{name:"justification",type:"Justification",isOptional:!0}],type:"bool"}},types:{CreatedBlock:{hash:"BlockHash",aux:"ImportedAux"},ImportedAux:{headerOnly:"bool",clearJustificationRequests:"bool",needsJustification:"bool",badJustification:"bool",needsFinalityProof:"bool",isNewBest:"bool"}}},Xo={rpc:{},types:{EvmAccount:{nonce:"u256",balance:"u256"},EvmLog:{address:"H160",topics:"Vec<H256>",data:"Bytes"},EvmVicinity:{gasPrice:"u256",origin:"H160"},ExitError:{_enum:{StackUnderflow:"Null",StackOverflow:"Null",InvalidJump:"Null",InvalidRange:"Null",DesignatedInvalid:"Null",CallTooDeep:"Null",CreateCollision:"Null",CreateContractLimit:"Null",OutOfOffset:"Null",OutOfGas:"Null",OutOfFund:"Null",PCUnderflow:"Null",CreateEmpty:"Null",Other:"Text"}},ExitFatal:{_enum:{NotSupported:"Null",UnhandledInterrupt:"Null",CallErrorAsFatal:"ExitError",Other:"Text"}},ExitReason:{_enum:{Succeed:"ExitSucceed",Error:"ExitError",Revert:"ExitRevert",Fatal:"ExitFatal"}},ExitRevert:{_enum:["Reverted"]},ExitSucceed:{_enum:["Stopped","Returned","Suicided"]}}},Zo={rpc:{},types:{Extrinsic:"GenericExtrinsic",ExtrinsicEra:"GenericExtrinsicEra",ExtrinsicPayload:"GenericExtrinsicPayload",ExtrinsicSignature:"MultiSignature",ExtrinsicV4:"GenericExtrinsicV4",ExtrinsicPayloadV4:"GenericExtrinsicPayloadV4",ExtrinsicSignatureV4:"GenericExtrinsicSignatureV4",ExtrinsicUnknown:"GenericExtrinsicUnknown",ExtrinsicPayloadUnknown:"GenericExtrinsicPayloadUnknown",ImmortalEra:"GenericImmortalEra",MortalEra:"GenericMortalEra",AnySignature:"H512",MultiSignature:{_enum:{Ed25519:"Ed25519Signature",Sr25519:"Sr25519Signature",Ecdsa:"EcdsaSignature"}},Signature:"H512",SignerPayload:"GenericSignerPayload",EcdsaSignature:"[u8; 65]",Ed25519Signature:"H512",Sr25519Signature:"H512"}},Go={rpc:{},types:{AssetOptions:{initalIssuance:"Compact<Balance>",permissions:"PermissionLatest"},Owner:{_enum:{None:"Null",Address:"AccountId"}},PermissionsV1:{update:"Owner",mint:"Owner",burn:"Owner"},PermissionVersions:{_enum:{V1:"PermissionsV1"}},PermissionLatest:"PermissionsV1"}},Yo={rpc:{},types:{ActiveGilt:{proportion:"Perquintill",amount:"Balance",who:"AccountId",expiry:"BlockNumber"},ActiveGiltsTotal:{frozen:"Balance",proportion:"Perquintill",index:"ActiveIndex",target:"Perquintill"},ActiveIndex:"u32",GiltBid:{amount:"Balance",who:"AccountId"}}},Jo={rpc:{proveFinality:{description:"Prove finality for the range (begin; end] hash.",params:[{name:"begin",type:"BlockHash"},{name:"end",type:"BlockHash"},{name:"authoritiesSetId",type:"u64",isOptional:!0}],type:"Option<EncodedFinalityProofs>"},roundState:{description:"Returns the state of the current best round state as well as the ongoing background rounds",params:[],type:"ReportedRoundStates"},subscribeJustifications:{description:"Subscribes to grandpa justifications",params:[],pubsub:["justifications","subscribeJustifications","unsubscribeJustifications"],type:"JustificationNotification"}},types:{AuthorityIndex:"u64",AuthorityList:"Vec<NextAuthority>",AuthoritySet:{currentAuthorities:"AuthorityList",setId:"u64",pendingStandardChanges:"ForkTreePendingChange",pendingForcedChanges:"Vec<PendingChange>",authoritySetChanges:"AuthoritySetChanges"},ForkTreePendingChange:{roots:"Vec<ForkTreePendingChangeNode>",bestFinalizedNumber:"Option<BlockNumber>"},ForkTreePendingChangeNode:{hash:"BlockHash",number:"BlockNumber",data:"PendingChange",children:"Vec<ForkTreePendingChangeNode>"},AuthoritySetChange:"(U64, BlockNumber)",AuthoritySetChanges:"Vec<AuthoritySetChange>",AuthorityWeight:"u64",DelayKind:{_enum:{Finalized:"Null",Best:"DelayKindBest"}},DelayKindBest:{medianLastFinalized:"BlockNumber"},EncodedFinalityProofs:"Bytes",GrandpaEquivocation:{_enum:{Prevote:"GrandpaEquivocationValue",Precommit:"GrandpaEquivocationValue"}},GrandpaEquivocationProof:{setId:"SetId",equivocation:"GrandpaEquivocation"},GrandpaEquivocationValue:{roundNumber:"u64",identity:"AuthorityId",first:"(GrandpaPrevote, AuthoritySignature)",second:"(GrandpaPrevote, AuthoritySignature)"},GrandpaPrevote:{targetHash:"Hash",targetNumber:"BlockNumber"},GrandpaCommit:{targetHash:"BlockHash",targetNumber:"BlockNumber",precommits:"Vec<GrandpaSignedPrecommit>"},GrandpaPrecommit:{targetHash:"BlockHash",targetNumber:"BlockNumber"},GrandpaSignedPrecommit:{precommit:"GrandpaPrecommit",signature:"AuthoritySignature",id:"AuthorityId"},GrandpaJustification:{round:"u64",commit:"GrandpaCommit",votesAncestries:"Vec<Header>"},JustificationNotification:"Bytes",KeyOwnerProof:"MembershipProof",NextAuthority:"(AuthorityId, AuthorityWeight)",PendingChange:{nextAuthorities:"AuthorityList",delay:"BlockNumber",canonHeight:"BlockNumber",canonHash:"BlockHash",delayKind:"DelayKind"},PendingPause:{scheduledAt:"BlockNumber",delay:"BlockNumber"},PendingResume:{scheduledAt:"BlockNumber",delay:"BlockNumber"},Precommits:{currentWeight:"u32",missing:"BTreeSet<AuthorityId>"},Prevotes:{currentWeight:"u32",missing:"BTreeSet<AuthorityId>"},ReportedRoundStates:{setId:"u32",best:"RoundState",background:"Vec<RoundState>"},RoundState:{round:"u32",totalWeight:"u32",thresholdWeight:"u32",prevotes:"Prevotes",precommits:"Precommits"},SetId:"u64",StoredPendingChange:{scheduledAt:"BlockNumber",delay:"BlockNumber",nextAuthorities:"AuthorityList"},StoredState:{_enum:{Live:"Null",PendingPause:"PendingPause",Paused:"Null",PendingResume:"PendingResume"}}}},Qo={rpc:{},types:{IdentityFields:{_set:{_bitLength:64,Display:1,Legal:2,Web:4,Riot:8,Email:16,PgpFingerprint:32,Image:64,Twitter:128}},IdentityInfoAdditional:"(Data, Data)",IdentityInfo:{additional:"Vec<IdentityInfoAdditional>",display:"Data",legal:"Data",web:"Data",riot:"Data",email:"Data",pgpFingerprint:"Option<H160>",image:"Data",twitter:"Data"},IdentityJudgement:{_enum:{Unknown:"Null",FeePaid:"Balance",Reasonable:"Null",KnownGood:"Null",OutOfDate:"Null",LowQuality:"Null",Erroneous:"Null"}},RegistrationJudgement:"(RegistrarIndex, IdentityJudgement)",Registration:{judgements:"Vec<RegistrationJudgement>",deposit:"Balance",info:"IdentityInfo"},RegistrarIndex:"u32",RegistrarInfo:{account:"AccountId",fee:"Balance",fields:"IdentityFields"}}},$o={rpc:{},types:{AuthIndex:"u32",AuthoritySignature:"Signature",Heartbeat:{blockNumber:"BlockNumber",networkState:"OpaqueNetworkState",sessionIndex:"SessionIndex",authorityIndex:"AuthIndex",validatorsLen:"u32"},HeartbeatTo244:{blockNumber:"BlockNumber",networkState:"OpaqueNetworkState",sessionIndex:"SessionIndex",authorityIndex:"AuthIndex"},OpaqueMultiaddr:"Bytes",OpaquePeerId:"Bytes",OpaqueNetworkState:{peerId:"OpaquePeerId",externalAddresses:"Vec<OpaqueMultiaddr>"}}},es={rpc:{},types:{CallIndex:"(u8, u8)",LotteryConfig:{price:"Balance",start:"BlockNumber",length:"BlockNumber",delay:"BlockNumber",repeat:"bool"}}},ts={rpc:{generateProof:{description:"Generate MMR proof for given leaf index.",params:[{name:"leafIndex",type:"u64"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"MmrLeafProof"}},types:{MmrLeafProof:{blockHash:"BlockHash",leaf:"Bytes",proof:"Bytes"}}},rs={rpc:{},types:{DeferredOffenceOf:"(Vec<OffenceDetails>, Vec<Perbill>, SessionIndex)",Kind:"[u8; 16]",OffenceDetails:{offender:"Offender",reporters:"Vec<Reporter>"},Offender:"IdentificationTuple",OpaqueTimeSlot:"Bytes",ReportIdOf:"Hash",Reporter:"AccountId"}},ns={rpc:{},types:{ProxyDefinition:{delegate:"AccountId",proxyType:"ProxyType",delay:"BlockNumber"},ProxyType:{_enum:["Any","NonTransfer","Governance","Staking"]},ProxyAnnouncement:{real:"AccountId",callHash:"Hash",height:"BlockNumber"}}},is={rpc:{},types:{ActiveRecovery:{created:"BlockNumber",deposit:"Balance",friends:"Vec<AccountId>"},RecoveryConfig:{delayPeriod:"BlockNumber",deposit:"Balance",friends:"Vec<AccountId>",threshold:"u16"}}},fs={rpc:{},types:{Period:"(BlockNumber, u32)",Priority:"u8",SchedulePeriod:"Period",SchedulePriority:"Priority",Scheduled:{maybeId:"Option<Bytes>",priority:"SchedulePriority",call:"Call",maybePeriodic:"Option<SchedulePeriod>",origin:"PalletsOrigin"},ScheduledTo254:{maybeId:"Option<Bytes>",priority:"SchedulePriority",call:"Call",maybePeriodic:"Option<SchedulePeriod>"},TaskAddress:"(BlockNumber, u32)"}};function cs(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 as(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cs(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var os={rpc:{},types:as(as({},{BeefyKey:"[u8; 33]",Keys:"SessionKeys4",SessionKeys1:"(AccountId)",SessionKeys2:"(AccountId, AccountId)",SessionKeys3:"(AccountId, AccountId, AccountId)",SessionKeys4:"(AccountId, AccountId, AccountId, AccountId)",SessionKeys5:"(AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys6:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys6B:"(AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys7:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys7B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys8:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys8B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys9:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys9B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys10:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys10B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)"}),{},{FullIdentification:"Exposure",IdentificationTuple:"(ValidatorId, FullIdentification)",MembershipProof:{session:"SessionIndex",trieNodes:"Vec<Vec<u8>>",validatorCount:"ValidatorCount"},SessionIndex:"u32",ValidatorCount:"u32"})},ss={rpc:{},types:{Bid:{who:"AccountId",kind:"BidKind",value:"Balance"},BidKind:{_enum:{Deposit:"Balance",Vouch:"(AccountId, Balance)"}},SocietyJudgement:{_enum:["Rebid","Reject","Approve"]},SocietyVote:{_enum:["Skeptic","Reject","Approve"]},StrikeCount:"u32",VouchingStatus:{_enum:["Vouching","Banned"]}}};function ds(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 us(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ds(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ds(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hs={rpc:{},types:us(us(us({},{Points:"u32",EraPoints:{total:"Points",individual:"Vec<Points>"}}),{CompactAssignments:"CompactAssignmentsWith16",CompactAssignmentsWith16:{votes1:"Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",votes2:"Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",votes3:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",votes4:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",votes5:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",votes6:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",votes7:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",votes8:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",votes9:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",votes10:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",votes11:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",votes12:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",votes13:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",votes14:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",votes15:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",votes16:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>"},CompactAssignmentsWith24:{votes1:"Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",votes2:"Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",votes3:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",votes4:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",votes5:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",votes6:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",votes7:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",votes8:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",votes9:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",votes10:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",votes11:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",votes12:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",votes13:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",votes14:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",votes15:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",votes16:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>",votes17:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 16], ValidatorIndexCompact)>",votes18:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 17], ValidatorIndexCompact)>",votes19:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 18], ValidatorIndexCompact)>",votes20:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 19], ValidatorIndexCompact)>",votes21:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 20], ValidatorIndexCompact)>",votes22:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 21], ValidatorIndexCompact)>",votes23:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 22], ValidatorIndexCompact)>",votes24:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 23], ValidatorIndexCompact)>"},CompactAssignmentsTo265:"CompactAssignmentsWith16",CompactAssignmentsTo257:{votes1:"Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>",votes2:"Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>",votes3:"Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>",votes4:"Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>",votes5:"Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>",votes6:"Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>",votes7:"Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>",votes8:"Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>",votes9:"Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>",votes10:"Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>",votes11:"Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>",votes12:"Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>",votes13:"Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>",votes14:"Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>",votes15:"Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>",votes16:"Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>"},CompactScore:"(ValidatorIndex, OffchainAccuracy)",CompactScoreCompact:"(ValidatorIndexCompact, OffchainAccuracyCompact)",ElectionCompute:{_enum:["OnChain","Signed","Unsigned"]},ElectionPhase:{_enum:{Off:null,Signed:null,Unsigned:"(bool, BlockNumber)",Emergency:null}},ElectionResult:{compute:"ElectionCompute",slotStake:"Balance",electedStashes:"Vec<AccountId>",exposures:"Vec<(AccountId, Exposure)>"},ElectionScore:"[u128; 3]",ElectionSize:{validators:"Compact<ValidatorIndex>",nominators:"Compact<NominatorIndex>"},ElectionStatus:{_enum:{Close:"Null",Open:"BlockNumber"}},ExtendedBalance:"u128",RawSolution:"RawSolutionWith16",RawSolutionWith16:{compact:"CompactAssignmentsWith16",score:"ElectionScore",round:"u32"},RawSolutionWith24:{compact:"CompactAssignmentsWith24",score:"ElectionScore",round:"u32"},RawSolutionTo265:"RawSolutionWith16",ReadySolution:{supports:"SolutionSupports",score:"ElectionScore",compute:"ElectionCompute"},RoundSnapshot:{voters:"Vec<(AccountId, VoteWeight, Vec<AccountId>)>",targets:"Vec<AccountId>"},SeatHolder:{who:"AccountId",stake:"Balance",deposit:"Balance"},SignedSubmission:{who:"AccountId",deposit:"Balance",solution:"RawSolution"},SignedSubmissionOf:"SignedSubmission",SolutionOrSnapshotSize:{voters:"Compact<u32>",targets:"Compact<u32>"},SolutionSupport:{total:"ExtendedBalance",voters:"Vec<(AccountId, ExtendedBalance)>"},SolutionSupports:"Vec<(AccountId, SolutionSupport)>",SubmissionIndicesOf:"BTreeMap<ElectionScore, u32>",Voter:{votes:"Vec<AccountId>",stake:"Balance",deposit:"Balance"},VoteWeight:"u64"}),{},{ActiveEraInfo:{index:"EraIndex",start:"Option<Moment>"},EraIndex:"u32",EraRewardPoints:{total:"RewardPoint",individual:"BTreeMap<AccountId, RewardPoint>"},EraRewards:{total:"u32",rewards:"Vec<u32>"},Exposure:{total:"Compact<Balance>",own:"Compact<Balance>",others:"Vec<IndividualExposure>"},Forcing:{_enum:["NotForcing","ForceNew","ForceNone","ForceAlways"]},IndividualExposure:{who:"AccountId",value:"Compact<Balance>"},KeyType:"AccountId",MomentOf:"Moment",Nominations:{targets:"Vec<AccountId>",submittedIn:"EraIndex",suppressed:"bool"},NominatorIndex:"u32",NominatorIndexCompact:"Compact<NominatorIndex>",OffchainAccuracy:"PerU16",OffchainAccuracyCompact:"Compact<OffchainAccuracy>",PhragmenScore:"[u128; 3]",Points:"u32",RewardDestination:{_enum:{Staked:"Null",Stash:"Null",Controller:"Null",Account:"AccountId",None:"Null"}},RewardPoint:"u32",SlashJournalEntry:{who:"AccountId",amount:"Balance",ownSlash:"Balance"},SlashingSpansTo204:{spanIndex:"SpanIndex",lastStart:"EraIndex",prior:"Vec<EraIndex>"},SlashingSpans:{spanIndex:"SpanIndex",lastStart:"EraIndex",lastNonzeroSlash:"EraIndex",prior:"Vec<EraIndex>"},SpanIndex:"u32",SpanRecord:{slashed:"Balance",paidOut:"Balance"},StakingLedgerTo223:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>"},StakingLedgerTo240:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>",lastReward:"Option<EraIndex>"},StakingLedger:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>",claimedRewards:"Vec<EraIndex>"},UnappliedSlashOther:"(AccountId, Balance)",UnappliedSlash:{validator:"AccountId",own:"Balance",others:"Vec<UnappliedSlashOther>",reporters:"Vec<AccountId>",payout:"Balance"},UnlockChunk:{value:"Compact<Balance>",era:"Compact<BlockNumber>"},ValidatorIndex:"u16",ValidatorIndexCompact:"Compact<ValidatorIndex>",ValidatorPrefs:"ValidatorPrefsWithBlocked",ValidatorPrefsWithCommission:{commission:"Compact<Perbill>"},ValidatorPrefsWithBlocked:{commission:"Compact<Perbill>",blocked:"bool"},ValidatorPrefsTo196:{validatorPayment:"Compact<Balance>"},ValidatorPrefsTo145:{unstakeThreshold:"Compact<u32>",validatorPayment:"Compact<Balance>"}})},ls={rpc:{},types:{WeightToFeeCoefficient:{coeffInteger:"Balance",coeffFrac:"Perbill",negative:"bool",degree:"u8"}}},ps={rpc:{genSyncSpec:{endpoint:"sync_state_genSyncSpec",description:"Returns the json-serialized chainspec running the node, with a sync state.",params:[{name:"raw",type:"bool"}],type:"Json"}},types:{}},bs={rpc:{accountNextIndex:{alias:["account_nextIndex"],description:"Retrieves the next accountIndex as available on the node",params:[{name:"accountId",type:"AccountId"}],type:"Index"},dryRun:{alias:["system_dryRunAt"],description:"Dry run an extrinsic at a given block",params:[{name:"extrinsic",type:"Bytes"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ApplyExtrinsicResult"},name:{description:"Retrieves the node name",params:[],type:"Text"},version:{description:"Retrieves the version of the node",params:[],type:"Text"},chain:{description:"Retrieves the chain",params:[],type:"Text"},chainType:{description:"Retrieves the chain type",params:[],type:"ChainType"},properties:{description:"Get a custom set of properties as a JSON object, defined in the chain spec",params:[],type:"ChainProperties"},health:{description:"Return health status of the node",params:[],type:"Health"},localPeerId:{description:"Returns the base58-encoded PeerId of the node",params:[],type:"Text"},localListenAddresses:{description:"The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example",params:[],type:"Vec<Text>"},peers:{description:"Returns the currently connected peers",params:[],type:"Vec<PeerInfo>"},networkState:{alias:["system_unstable_networkState"],description:"Returns current state of the network",params:[],type:"NetworkState"},addReservedPeer:{description:"Adds a reserved peer",params:[{name:"peer",type:"Text"}],type:"Text"},removeReservedPeer:{description:"Remove a reserved peer",params:[{name:"peerId",type:"Text"}],type:"Text"},reservedPeers:{description:"Returns the list of reserved peers",params:[],type:"Vec<Text>"},nodeRoles:{description:"Returns the roles the node is running as",params:[],type:"Vec<NodeRole>"},syncState:{description:"Returns the state of the syncing of the node",params:[],type:"SyncState"},addLogFilter:{description:"Adds the supplied directives to the current log filter",params:[{name:"directives",type:"Text"}],type:"Null"},resetLogFilter:{description:"Resets the log filter to Substrate defaults",params:[],type:"Null"}},types:{AccountInfo:"AccountInfoWithTripleRefCount",AccountInfoWithRefCountU8:{nonce:"Index",refcount:"u8",data:"AccountData"},AccountInfoWithRefCount:{_fallback:"AccountInfoWithRefCountU8",nonce:"Index",refcount:"RefCount",data:"AccountData"},AccountInfoWithDualRefCount:{_fallback:"AccountInfoWithRefCount",nonce:"Index",consumers:"RefCount",providers:"RefCount",data:"AccountData"},AccountInfoWithProviders:"AccountInfoWithDualRefCount",AccountInfoWithTripleRefCount:{_fallback:"AccountInfoWithDualRefCount",nonce:"Index",consumers:"RefCount",providers:"RefCount",sufficients:"RefCount",data:"AccountData"},ApplyExtrinsicResult:"Result<DispatchOutcome, TransactionValidityError>",ArithmeticError:{_enum:["Underflow","Overflow","DivisionByZero"]},BlockLength:{max:"PerDispatchClassU32"},BlockWeights:{baseBlock:"Weight",maxBlock:"Weight",perClass:"PerDispatchClassWeightsPerClass"},ChainProperties:"GenericChainProperties",ChainType:{_enum:{Development:"Null",Local:"Null",Live:"Null",Custom:"Text"}},ConsumedWeight:"PerDispatchClassWeight",DigestOf:"Digest",DispatchClass:{_enum:["Normal","Operational","Mandatory"]},DispatchError:{_enum:{Other:"Null",CannotLookup:"Null",BadOrigin:"Null",Module:"DispatchErrorModule",ConsumerRemaining:"Null",NoProviders:"Null",Token:"TokenError",Arithmetic:"ArithmeticError"}},DispatchErrorModule:{index:"u8",error:"u8"},DispatchErrorTo198:{module:"Option<u8>",error:"u8"},DispatchInfo:{weight:"Weight",class:"DispatchClass",paysFee:"Pays"},DispatchInfoTo190:{weight:"Weight",class:"DispatchClass"},DispatchInfoTo244:{weight:"Weight",class:"DispatchClass",paysFee:"bool"},DispatchOutcome:"Result<(), DispatchError>",DispatchResult:"Result<(), DispatchError>",DispatchResultOf:"DispatchResult",DispatchResultTo198:"Result<(), Text>",Event:"GenericEvent",EventId:"[u8; 2]",EventIndex:"u32",EventRecord:{phase:"Phase",event:"Event",topics:"Vec<Hash>"},Health:{peers:"u64",isSyncing:"bool",shouldHavePeers:"bool"},InvalidTransaction:{_enum:{Call:"Null",Payment:"Null",Future:"Null",Stale:"Null",BadProof:"Null",AncientBirthBlock:"Null",ExhaustsResources:"Null",Custom:"u8",BadMandatory:"Null",MandatoryDispatch:"Null"}},Key:"Bytes",LastRuntimeUpgradeInfo:{specVersion:"Compact<u32>",specName:"Text"},NetworkState:{peerId:"Text",listenedAddresses:"Vec<Text>",externalAddresses:"Vec<Text>",connectedPeers:"HashMap<Text, Peer>",notConnectedPeers:"HashMap<Text, NotConnectedPeer>",averageDownloadPerSec:"u64",averageUploadPerSec:"u64",peerset:"NetworkStatePeerset"},NetworkStatePeerset:{messageQueue:"u64",nodes:"HashMap<Text, NetworkStatePeersetInfo>"},NetworkStatePeersetInfo:{connected:"bool",reputation:"i32"},NodeRole:{_enum:{Full:"Null",LightClient:"Null",Authority:"Null",UnknownRole:"u8"}},NotConnectedPeer:{knownAddresses:"Vec<Text>",latestPingTime:"Option<PeerPing>",versionString:"Option<Text>"},Peer:{enabled:"bool",endpoint:"PeerEndpoint",knownAddresses:"Vec<Text>",latestPingTime:"PeerPing",open:"bool",versionString:"Text"},PeerEndpoint:{listening:"PeerEndpointAddr"},PeerEndpointAddr:{_alias:{localAddr:"local_addr",sendBackAddr:"send_back_addr"},localAddr:"Text",sendBackAddr:"Text"},PeerPing:{nanos:"u64",secs:"u64"},PeerInfo:{peerId:"Text",roles:"Text",protocolVersion:"u32",bestHash:"Hash",bestNumber:"BlockNumber"},PerDispatchClassU32:{normal:"u32",operational:"u32",mandatory:"u32"},PerDispatchClassWeight:{normal:"Weight",operational:"Weight",mandatory:"Weight"},PerDispatchClassWeightsPerClass:{normal:"WeightPerClass",operational:"WeightPerClass",mandatory:"WeightPerClass"},Phase:{_enum:{ApplyExtrinsic:"u32",Finalization:"Null",Initialization:"Null"}},RawOrigin:{_enum:{Root:"Null",Signed:"AccountId",None:"Null"}},RefCount:"u32",RefCountTo259:"u8",SyncState:{startingBlock:"BlockNumber",currentBlock:"BlockNumber",highestBlock:"Option<BlockNumber>"},SystemOrigin:"RawOrigin",TokenError:{_enum:["NoFunds","WouldDie","BelowMinimum","CannotCreate","UnknownAsset","Frozen","Underflow","Overflow"]},TransactionValidityError:{_enum:{Invalid:"InvalidTransaction",Unknown:"UnknownTransaction"}},UnknownTransaction:{_enum:{CannotLookup:"Null",NoUnsignedValidator:"Null",Custom:"u8"}},WeightPerClass:{baseExtrinsic:"Weight",maxExtrinsic:"Weight",maxTotal:"Option<Weight>",reserved:"Option<Weight>"}}},ms={rpc:{},types:{Bounty:{proposer:"AccountId",value:"Balance",fee:"Balance",curatorDeposit:"Balance",bond:"Balance",status:"BountyStatus"},BountyIndex:"u32",BountyStatus:{_enum:{Proposed:"Null",Approved:"Null",Funded:"Null",CuratorProposed:"BountyStatusCuratorProposed",Active:"BountyStatusActive",PendingPayout:"BountyStatusPendingPayout"}},BountyStatusActive:{curator:"AccountId",updateDue:"BlockNumber"},BountyStatusCuratorProposed:{curator:"AccountId"},BountyStatusPendingPayout:{curator:"AccountId",beneficiary:"AccountId",unlockAt:"BlockNumber"},OpenTip:{reason:"Hash",who:"AccountId",finder:"AccountId",deposit:"Balance",closes:"Option<BlockNumber>",tips:"Vec<OpenTipTip>",findersFee:"bool"},OpenTipTo225:{reason:"Hash",who:"AccountId",finder:"Option<OpenTipFinderTo225>",closes:"Option<BlockNumber>",tips:"Vec<OpenTipTip>"},OpenTipFinderTo225:"(AccountId, Balance)",OpenTipTip:"(AccountId, Balance)",TreasuryProposal:{proposer:"AccountId",value:"Balance",beneficiary:"AccountId",bond:"Balance"}}},ys={rpc:{},types:{Multiplier:"Fixed128"}},gs={rpc:{},types:{ClassId:"u32",InstanceId:"u32",DepositBalance:"Balance",DepositBalanceOf:"Balance",ClassDetails:{owner:"AccountId",issuer:"AccountId",admin:"AccountId",freezer:"AccountId",totalDeposit:"DepositBalance",freeHolding:"bool",instances:"u32",instanceMetadatas:"u32",attributes:"u32",isFrozen:"bool"},DestroyWitness:{instances:"Compact<u32>",instanceMetadatas:"Compact<u32>",attributes:"Compact<u32>"},InstanceDetails:{owner:"AccountId",approved:"Option<AccountId>",isFrozen:"bool",deposit:"DepositBalance"},ClassMetadata:{deposit:"DepositBalance",data:"Vec<u8>",isFrozen:"bool"},InstanceMetadata:{deposit:"DepositBalance",data:"Vec<u8>",isFrozen:"bool"}}},vs={rpc:{},types:{Multisig:{when:"Timepoint",deposit:"Balance",depositor:"AccountId",approvals:"Vec<AccountId>"},Timepoint:{height:"BlockNumber",index:"u32"}}},ws={rpc:{},types:{VestingInfo:{locked:"Balance",perBlock:"Balance",startingBlock:"BlockNumber"}}},Ms={rpc:{},types:{BlockAttestations:{receipt:"CandidateReceipt",valid:"Vec<AccountId>",invalid:"Vec<AccountId>"},IncludedBlocks:{actualNumber:"BlockNumber",session:"SessionIndex",randomSeed:"H256",activeParachains:"Vec<ParaId>",paraBlocks:"Vec<Hash>"},MoreAttestations:{}}},Os={rpc:{},types:{BridgedBlockHash:"H256",BridgedBlockNumber:"BlockNumber",BridgedHeader:"Header",InitializationData:{header:"Header",authorityList:"AuthorityList",setId:"SetId",isHalted:"bool"}}},xs={rpc:{},types:{EthereumAddress:"H160",StatementKind:{_enum:["Regular","Saft"]}}},Ss={rpc:{},types:{FundIndex:"u32",LastContribution:{_enum:{Never:"Null",PreEnding:"u32",Ending:"BlockNumber"}},FundInfo:{depositor:"AccountId",verifier:"Option<MultiSigner>",deposit:"Balance",raised:"Balance",end:"BlockNumber",cap:"Balance",lastContribution:"LastContribution",firstPeriod:"LeasePeriod",lastPeriod:"LeasePeriod",trieIndex:"TrieIndex"},TrieIndex:"u32"}};function ks(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}var js={rpc:{},types:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ks(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ks(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},{ConfigData:{maxIndividual:"Weight"},MessageId:"[u8; 32]",OverweightIndex:"u64",PageCounter:"u32",PageIndexData:{beginUsed:"PageCounter",endUsed:"PageCounter",overweightCount:"OverweightIndex"}})};function Ps(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 As(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ps(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ps(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Es=As(As({},{Bidder:{_enum:{New:"NewBidder",Existing:"ParaId"}},IncomingParachain:{_enum:{Unset:"NewBidder",Fixed:"IncomingParachainFixed",Deploy:"IncomingParachainDeploy"}},IncomingParachainDeploy:{code:"ValidationCode",initialHeadData:"HeadData"},IncomingParachainFixed:{codeHash:"Hash",codeSize:"u32",initialHeadData:"HeadData"},NewBidder:{who:"AccountId",sub:"SubId"},SubId:"u32"}),{},{AuctionIndex:"u32",LeasePeriod:"BlockNumber",LeasePeriodOf:"BlockNumber",SlotRange:{_enum:["ZeroZero","ZeroOne","ZeroTwo","ZeroThree","OneOne","OneTwo","OneThree","TwoTwo","TwoThree","ThreeThree"]},WinningData:"[WinningDataEntry; 10]",WinningDataEntry:"Option<(AccountId, ParaId, BalanceOf)>",WinnersData:"Vec<WinnersDataTuple>",WinnersDataTuple:"(AccountId, ParaId, BalanceOf, SlotRange)"});function Is(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 Ts(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rs={rpc:{},types:Ts(Ts(Ts(Ts(Ts({},{ServiceQuality:{_enum:["Ordered","Fast"]}}),{HrmpChannel:{maxCapacity:"u32",maxTotalSize:"u32",maxMessageSize:"u32",msgCount:"u32",totalSize:"u32",mqcHead:"Option<Hash>",senderDeposit:"Balance",recipientDeposit:"Balance"},HrmpChannelId:{sender:"u32",receiver:"u32"},HrmpOpenChannelRequest:{confirmed:"bool",age:"SessionIndex",senderDeposit:"Balance",maxMessageSize:"u32",maxCapacity:"u32",maxTotalSize:"u32"}}),{ParachainProposal:{proposer:"AccountId",genesisHead:"HeadData",validators:"Vec<ValidatorId>",name:"Bytes",balance:"Balance"},RegisteredParachainInfo:{validators:"Vec<ValidatorId>",proposer:"AccountId"}}),Es),{},{AbridgedCandidateReceipt:{parachainIndex:"ParaId",relayParent:"Hash",headData:"HeadData",collator:"CollatorId",signature:"CollatorSignature",povBlockHash:"Hash",commitments:"CandidateCommitments"},AbridgedHostConfiguration:{maxCodeSize:"u32",maxHeadDataSize:"u32",maxUpwardQueueCount:"u32",maxUpwardQueueSize:"u32",maxUpwardMessageSize:"u32",maxUpwardMessageNumPerCandidate:"u32",hrmpMaxMessageNumPerCandidate:"u32",validationUpgradeFrequency:"BlockNumber",validationUpgradeDelay:"BlockNumber"},AbridgedHrmpChannel:{maxCapacity:"u32",maxTotalSize:"u32",maxMessageSize:"u32",msgCount:"u32",totalSize:"u32",mqcHead:"Option<Hash>"},AssignmentId:"AccountId",AssignmentKind:{_enum:{Parachain:"Null",Parathread:"(CollatorId, u32)"}},AttestedCandidate:{candidate:"AbridgedCandidateReceipt",validityVotes:"Vec<ValidityAttestation>",validatorIndices:"BitVec"},AuthorityDiscoveryId:"AccountId",AvailabilityBitfield:"BitVec",AvailabilityBitfieldRecord:{bitfield:"AvailabilityBitfield",submittedTt:"BlockNumber"},BackedCandidate:{candidate:"CommittedCandidateReceipt",validityVotes:"Vec<ValidityAttestation>",validatorIndices:"BitVec"},BufferedSessionChange:{applyAt:"BlockNumber",validators:"Vec<ValidatorId>",queued:"Vec<ValidatorId>",sessionIndex:"SessionIndex"},CandidateCommitments:{upwardMessages:"Vec<UpwardMessage>",horizontalMessages:"Vec<OutboundHrmpMessage>",newValidationCode:"Option<ValidationCode>",headData:"HeadData",processedDownwardMessages:"u32",hrmpWatermark:"BlockNumber"},CandidateDescriptor:{paraId:"ParaId",relayParent:"RelayChainHash",collatorId:"CollatorId",persistedValidationDataHash:"Hash",povHash:"Hash",erasureRoot:"Hash",signature:"CollatorSignature",paraHead:"Hash",validationCodeHash:"ValidationCodeHash"},CandidateHash:"Hash",CandidateInfo:{who:"AccountId",deposit:"Balance"},CandidatePendingAvailability:{core:"CoreIndex",hash:"CandidateHash",descriptor:"CandidateDescriptor",availabilityVotes:"BitVec",backers:"BitVec",relayParentNumber:"BlockNumber",backedInNumber:"BlockNumber",backingGroup:"GroupIndex"},CandidateReceipt:{descriptor:"CandidateDescriptor",commitmentsHash:"Hash"},GlobalValidationData:{maxCodeSize:"u32",maxHeadDataSize:"u32",blockNumber:"BlockNumber"},CollatorId:"H256",CollatorSignature:"Signature",CommittedCandidateReceipt:{descriptor:"CandidateDescriptor",commitments:"CandidateCommitments"},CoreAssignment:{core:"CoreIndex",paraId:"ParaId",kind:"AssignmentKind",groupIdx:"GroupIndex"},CoreIndex:"u32",CoreOccupied:{_enum:{Parathread:"ParathreadEntry",Parachain:"Null"}},DisputeStatementSet:{candidateHash:"CandidateHash",session:"SessionIndex",statements:"Vec<(DisputeStatement, ValidatorIndex, ValidatorSignature)>"},MultiDisputeStatementSet:"Vec<DisputeStatementSet>",DisputeStatement:{_enum:{Valid:"ValidDisputeStatementKind",Invalid:"InvalidDisputeStatementKind"}},ValidDisputeStatementKind:{_enum:["Explicit","BackingSeconded","BackingValid","ApprovalChecking"]},InvalidDisputeStatementKind:{_enum:["Explicit"]},ExplicitDisputeStatement:{valid:"bool",candidateHash:"CandidateHash",session:"SessionIndex"},DoubleVoteReport:{identity:"ValidatorId",first:"(Statement, ValidatorSignature)",second:"(Statement, ValidatorSignature)",proof:"MembershipProof",signingContext:"SigningContext"},DownwardMessage:"Bytes",GroupIndex:"u32",GlobalValidationSchedule:{maxCodeSize:"u32",maxHeadDataSize:"u32",blockNumber:"BlockNumber"},HeadData:"Bytes",HostConfiguration:{maxCodeSize:"u32",maxHeadDataSize:"u32",maxUpwardQueueCount:"u32",maxUpwardQueueSize:"u32",maxUpwardMessageSize:"u32",maxUpwardMessageNumPerCandidate:"u32",hrmpMaxMessageNumPerCandidate:"u32",validationUpgradeFrequency:"BlockNumber",validationUpgradeDelay:"BlockNumber",maxPovSize:"u32",maxDownwardMessageSize:"u32",preferredDispatchableUpwardMessagesStepWeight:"Weight",hrmpMaxParachainOutboundChannels:"u32",hrmpMaxParathreadOutboundChannels:"u32",hrmpOpenRequestTtl:"u32",hrmpSenderDeposit:"Balance",hrmpRecipientDeposit:"Balance",hrmpChannelMaxCapacity:"u32",hrmpChannelMaxTotalSize:"u32",hrmpMaxParachainInboundChannels:"u32",hrmpMaxParathreadInboundChannels:"u32",hrmpChannelMaxMessageSize:"u32",codeRetentionPeriod:"BlockNumber",parathreadCores:"u32",parathreadRetries:"u32",groupRotationFrequency:"BlockNumber",chainAvailabilityPeriod:"BlockNumber",threadAvailabilityPeriod:"BlockNumber",schedulingLookahead:"u32",maxValidatorsPerCore:"Option<u32>",maxValidators:"Option<u32>",disputePeriod:"SessionIndex",disputePostConclusionAcceptancePeriod:"BlockNumber",disputeMaxSpamSlots:"u32",disputeConclusionByTimeOutPeriod:"BlockNumber",noShowSlots:"u32",nDelayTranches:"u32",zerothDelayTrancheWidth:"u32",neededApprovals:"u32",relayVrfModuloSamples:"u32"},InboundDownwardMessage:{pubSentAt:"BlockNumber",pubMsg:"DownwardMessage"},InboundHrmpMessage:{sentAt:"BlockNumber",data:"Bytes"},InboundHrmpMessages:"Vec<InboundHrmpMessage>",LocalValidationData:{parentHead:"HeadData",balance:"Balance",codeUpgradeAllowed:"Option<BlockNumber>"},MessageIngestionType:{downwardMessages:"Vec<InboundDownwardMessage>",horizontalMessages:"BTreeMap<ParaId, InboundHrmpMessages>"},MessageQueueChain:"RelayChainHash",OutboundHrmpMessage:{recipient:"u32",data:"Bytes"},ParachainDispatchOrigin:{_enum:["Signed","Parachain","Root"]},ParachainInherentData:{validationData:"PersistedValidationData",relayChainState:"StorageProof",downwardMessages:"Vec<InboundDownwardMessage>",horizontalMessages:"BTreeMap<ParaId, VecInboundHrmpMessage>"},ParachainsInherentData:{bitfields:"SignedAvailabilityBitfields",backedCandidates:"Vec<BackedCandidate>",disputes:"MultiDisputeStatementSet",parentHeader:"Header"},ParaGenesisArgs:{genesisHead:"Bytes",validationCode:"Bytes",parachain:"bool"},ParaId:"u32",ParaInfo:{manager:"AccountId",deposit:"Balance",locked:"bool"},ParaLifecycle:{_enum:["Onboarding","Parathread","Parachain","UpgradingToParachain","DowngradingToParathread","OutgoingParathread","OutgoingParachain"]},ParaPastCodeMeta:{upgradeTimes:"Vec<BlockNumber>",lastPruned:"Option<BlockNumber>"},ParaScheduling:{_enum:["Always","Dynamic"]},ParathreadClaim:"(ParaId, CollatorId)",ParathreadClaimQueue:{queue:"Vec<QueuedParathread>",nextCoreOffset:"u32"},ParathreadEntry:{claim:"ParathreadClaim",retries:"u32"},ParaValidatorIndex:"u32",PersistedValidationData:{parentHead:"HeadData",relayParentNumber:"RelayChainBlockNumber",relayParentStorageRoot:"Hash",maxPovSize:"u32"},RelayBlockNumber:"u32",RelayChainBlockNumber:"RelayBlockNumber",RelayHash:"Hash",RelayChainHash:"RelayHash",QueuedParathread:{claim:"ParathreadEntry",coreOffset:"u32"},Remark:"[u8; 32]",Retriable:{_enum:{Never:"Null",WithRetries:"u32"}},Scheduling:{_enum:["Always","Dynamic"]},SessionInfo:{validators:"Vec<ValidatorId>",discoveryKeys:"Vec<AuthorityDiscoveryId>",assignmentKeys:"Vec<AssignmentId>",validatorGroups:"Vec<SessionInfoValidatorGroup>",nCores:"u32",zerothDelayTrancheWidth:"u32",relayVrfModuloSamples:"u32",nDelayTranches:"u32",noShowSlots:"u32",neededApprovals:"u32"},SessionInfoValidatorGroup:"Vec<ParaValidatorIndex>",SignedAvailabilityBitfield:{payload:"BitVec",validatorIndex:"ParaValidatorIndex",signature:"ValidatorSignature"},SignedAvailabilityBitfields:"Vec<SignedAvailabilityBitfield>",SigningContext:{sessionIndex:"SessionIndex",parentHash:"Hash"},Statement:{_enum:{Never:"Null",Candidate:"Hash",Valid:"Hash",Invalid:"Hash"}},TransientValidationData:{maxCodeSize:"u32",maxHeadDataSize:"u32",balance:"Balance",codeUpgradeAllowed:"Option<BlockNumber>",dmqLength:"u32"},UpwardMessage:"Bytes",ValidationFunctionParams:{maxCodeSize:"u32",relayChainHeight:"RelayChainBlockNumber",codeUpgradeAllowed:"Option<RelayChainBlockNumber>"},ValidationCode:"Bytes",ValidationCodeHash:"Hash",ValidationData:{persisted:"PersistedValidationData",transient:"TransientValidationData"},ValidationDataType:{validationData:"ValidationData",relayChainState:"Vec<Bytes>"},ValidatorSignature:"Signature",ValidityAttestation:{_enum:{Never:"Null",Implicit:"ValidatorSignature",Explicit:"ValidatorSignature"}},MessagingStateSnapshot:{relayDispatchQueueSize:"(u32, u32)",egressChannels:"Vec<MessagingStateSnapshotEgressEntry>"},MessagingStateSnapshotEgressEntry:"(ParaId, AbridgedHrmpChannel)",SystemInherentData:"ParachainInherentData",VecInboundHrmpMessage:"Vec<InboundHrmpMessage>"})},Ns={rpc:{},types:{Approvals:"[bool; 4]"}},_s={rpc:{},types:{AccountStatus:{validity:"AccountValidity",freeBalance:"Balance",lockedBalance:"Balance",signature:"Vec<u8>",vat:"Permill"},AccountValidity:{_enum:["Invalid","Initiated","Pending","ValidLow","ValidHigh","Completed"]}}};function Cs(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 Bs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cs(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Hs={rpc:{},types:Bs(Bs(Bs(Bs(Bs({},{BodyId:{_enum:{Unit:"Null",Named:"Vec<u8>",Index:"Compact<u32>",Executive:"Null",Technical:"Null",Legislative:"Null",Judicial:"Null"}},BodyPart:{_enum:{Voice:"Null",Members:"Compact<u32>",Fraction:"BodyPartFraction",AtLeastProportion:"BodyPartAtLeastProportion",MoreThanProportion:"BodyPartMoreThanProportion"}},BodyPartFraction:{nom:"Compact<u32>",denom:"Compact<u32>"},BodyPartAtLeastProportion:{nom:"Compact<u32>",denom:"Compact<u32>"},BodyPartMoreThanProportion:{nom:"Compact<u32>",denom:"Compact<u32>"},AccountId32Junction:{network:"NetworkId",id:"AccountId"},AccountIndex64Junction:{network:"NetworkId",index:"Compact<u64>"},AccountKey20Junction:{network:"NetworkId",index:"[u8; 20]"},PluralityJunction:{id:"BodyId",part:"BodyPart"},Junction:{_enum:{Parent:"Null",Parachain:"Compact<u32>",AccountId32:"AccountId32Junction",AccountIndex64:"AccountIndex64Junction",AccountKey20:"AccountKey20Junction",PalletInstance:"u8",GeneralIndex:"Compact<u128>",GeneralKey:"Vec<u8>",OnlyChild:"Null",Plurality:"PluralityJunction"}},NetworkId:{_enum:{Any:"Null",Named:"Vec<u8>",Polkadot:"Null",Kusama:"Null"}}}),{InboundStatus:{_enum:["Ok","Suspended"]},OutboundStatus:{_enum:["Ok","Suspended"]},MultiAssetAbstractFungible:{id:"Vec<u8>",instance:"Compact<u128>"},MultiAssetAbstractNonFungible:{class:"Vec<u8>",instance:"AssetInstance"},MultiAssetConcreteFungible:{id:"MultiLocation",amount:"Compact<u128>"},MultiAssetConcreteNonFungible:{class:"MultiLocation",instance:"AssetInstance"},MultiAsset:{_enum:{None:"Null",All:"Null",AllFungible:"Null",AllNonFungible:"Null",AllAbstractFungible:"Vec<u8>",AllAbstractNonFungible:"Vec<u8>",AllConcreteFungible:"MultiLocation",AllConcreteNonFungible:"MultiLocation",AbstractFungible:"MultiAssetAbstractFungible",AbstractNonFungible:"MultiAssetAbstractNonFungible",ConcreteFungible:"MultiAssetConcreteFungible",ConcreteNonFungible:"MultiAssetConcreteNonFungible"}},VersionedMultiAsset:{_enum:{V0:"MultiAsset"}}}),{XcmAssetEffects:{assets:"Vec<MultiAsset>",effects:"Vec<XcmOrder>"},XcmWithdrawAsset:"XcmAssetEffects",XcmReserveAssetDeposit:"XcmAssetEffects",XcmTeleportAsset:"XcmAssetEffects",XcmQueryResponse:{queryId:"Compact<u64>",response:"XcmResponse"},XcmTransferAsset:{assets:"Vec<MultiAsset>",dest:"MultiLocation"},XcmTransferReserveAsset:{assets:"Vec<MultiAsset>",dest:"MultiLocation",effects:"Vec<XcmOrder>"},XcmTransact:{originType:"XcmOriginKind",requireWeightAtMost:"u64",call:"DoubleEncodedCall"},XcmHrmpNewChannelOpenRequest:{sender:"Compact<u32>",maxMessageSize:"Compact<u32>",maxCapacity:"Compact<u32>"},XcmHrmpChannelAccepted:{recipient:"Compact<u32>"},XcmHrmpChannelClosing:{initiator:"Compact<u32>",sender:"Compact<u32>",recipient:"Compact<u32>"},XcmRelayedFrom:{who:"MultiLocation",message:"Xcm"},XcmOrigin:{_enum:{Xcm:"MultiLocation"}},Xcm:{_enum:{WithdrawAsset:"XcmWithdrawAsset",ReserveAssetDeposit:"XcmReserveAssetDeposit",TeleportAsset:"XcmTeleportAsset",QueryResponse:"XcmQueryResponse",TransferAsset:"XcmTransferAsset",TransferReserveAsset:"XcmTransferReserveAsset",Transact:"XcmTransact",HrmpNewChannelOpenRequest:"XcmHrmpNewChannelOpenRequest",HrmpChannelAccepted:"XcmHrmpChannelAccepted",HrmpChannelClosing:"XcmHrmpChannelClosing",RelayedFrom:"XcmRelayedFrom"}},XcmpMessageFormat:{_enum:["ConcatenatedVersionedXcm","ConcatenatedEncodedBlob","Signals"]},VersionedXcm:{_enum:{V0:"Xcm"}}}),{XcmOrderDepositAsset:{assets:"Vec<MultiAsset>",dest:"MultiLocation"},XcmOrderDepositReserveAsset:{assets:"Vec<MultiAsset>",dest:"MultiLocation",effects:"Vec<XcmOrder>"},XcmOrderExchangeAsset:{give:"Vec<MultiAsset>",receive:"Vec<MultiAsset>"},XcmOrderInitiateReserveWithdraw:{assets:"Vec<MultiAsset>",reserve:"MultiLocation",effects:"Vec<XcmOrder>"},XcmOrderInitiateTeleport:{assets:"Vec<MultiAsset>",dest:"MultiLocation",effects:"Vec<XcmOrder>"},XcmOrderQueryHolding:{queryId:"Compact<u64>",dest:"MultiLocation",assets:"Vec<MultiAsset>"},XcmOrderBuyExecution:{fees:"MultiAsset",weight:"u64",debt:"u64",haltOnError:"bool",xcm:"Vec<Xcm>"},XcmOrder:{_enum:{Null:"Null",DepositAsset:"XcmOrderDepositAsset",DepositReserveAsset:"XcmOrderDepositReserveAsset",ExchangeAsset:"XcmOrderExchangeAsset",InitiateReserveWithdraw:"XcmOrderInitiateReserveWithdraw",InitiateTeleport:"XcmOrderInitiateTeleport",QueryHolding:"XcmOrderQueryHolding",BuyExecution:"XcmOrderBuyExecution"}}}),{},{DoubleEncodedCall:{encoded:"Vec<u8>"},XcmOriginKind:{_enum:["Native","SovereignAccount","Superuser","Xcm"]},XcmResponse:{_enum:{Assets:"Vec<MultiAsset>"}},XcmError:{_enum:{Undefined:"Null",Overflow:"Null",Unimplemented:"Null",UnhandledXcmVersion:"Null",UnhandledXcmMessage:"Null",UnhandledEffect:"Null",EscalationOfPrivilege:"Null",UntrustedReserveLocation:"Null",UntrustedTeleportLocation:"Null",DestinationBufferOverflow:"Null",SendFailed:"Null",CannotReachDestination:"(MultiLocation, Xcm)",MultiLocationFull:"Null",FailedToDecode:"Null",BadOrigin:"Null",ExceedsMaxMessageSize:"Null",FailedToTransactAsset:"Null",WeightLimitReached:"Weight",Wildcard:"Null",TooMuchWeightRequired:"Null",NotHoldingFees:"Null",WeightNotComputable:"Null",Barrier:"Null",NotWithdrawable:"Null",LocationCannotHold:"Null",TooExpensive:"Null"}},MultiLocation:{_enum:{Null:"Null",X1:"Junction",X2:"(Junction, Junction)",X3:"(Junction, Junction, Junction)",X4:"(Junction, Junction, Junction, Junction)",X5:"(Junction, Junction, Junction, Junction, Junction)",X6:"(Junction, Junction, Junction, Junction, Junction, Junction)",X7:"(Junction, Junction, Junction, Junction, Junction, Junction, Junction)",X8:"(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction)"}},Outcome:{_enum:{Complete:"Weight",Incomplete:"(Weight, XcmError)",Error:"XcmError"}},QueueConfigData:{suspendThreshold:"u32",dropThreshold:"u32",resumeThreshold:"u32",thresholdWeight:"Weight",weightRestrictDecay:"Weight"},VersionedMultiLocation:{_enum:{V0:"MultiLocation"}},AssetInstance:{_enum:{Undefined:"Null",Index8:"u8",Index16:"Compact<u16>",Index32:"Compact<u32>",Index64:"Compact<u64>",Index128:"Compact<u128>",Array4:"[u8; 4]",Array8:"[u8; 8]",Array16:"[u8; 16]",Array32:"[u8; 32]",Blob:"Vec<u8>"}}})};function Ds(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 Ls(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ds(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ds(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zs={rpc:{},types:Ls(Ls(Ls({},{ContractCryptoHasher:{_enum:["Blake2x256","Sha2x256","Keccak256"]},ContractDiscriminant:"u32",ContractLayoutArray:{offset:"ContractLayoutKey",len:"u32",cellsPerElem:"u64",layout:"ContractStorageLayout"},ContractLayoutCell:{key:"ContractLayoutKey",ty:"SiLookupTypeId"},ContractLayoutEnum:{dispatchKey:"ContractLayoutKey",variants:"BTreeMap<ContractDiscriminant, ContractLayoutStruct>"},ContractLayoutHash:{offset:"ContractLayoutKey",strategy:"ContractLayoutHashingStrategy",layout:"ContractStorageLayout"},ContractLayoutHashingStrategy:{hasher:"ContractCryptoHasher",postfix:"Vec<u8>",prefix:"Vec<u8>"},ContractLayoutKey:"[u8; 32]",ContractLayoutStruct:{fields:"Vec<ContractLayoutStructField>"},ContractLayoutStructField:{layout:"ContractStorageLayout",name:"Text"},ContractStorageLayout:{_enum:{Cell:"ContractLayoutCell",Hash:"ContractLayoutHash",Array:"ContractLayoutArray",Struct:"ContractLayoutStruct",Enum:"ContractLayoutEnum"}}}),{ContractConstructorSpec:{name:"Text",selector:"ContractSelector",args:"Vec<ContractMessageParamSpec>",docs:"Vec<Text>"},ContractContractSpec:{constructors:"Vec<ContractConstructorSpec>",messages:"Vec<ContractMessageSpec>",events:"Vec<ContractEventSpec>",docs:"Vec<Text>"},ContractDisplayName:"SiPath",ContractEventParamSpec:{name:"Text",indexed:"bool",type:"ContractTypeSpec",docs:"Vec<Text>"},ContractEventSpec:{name:"Text",args:"Vec<ContractEventParamSpec>",docs:"Vec<Text>"},ContractMessageParamSpec:{name:"Text",type:"ContractTypeSpec"},ContractMessageSpec:{name:"Text",selector:"ContractSelector",mutates:"bool",payable:"bool",args:"Vec<ContractMessageParamSpec>",returnType:"Option<ContractTypeSpec>",docs:"Vec<Text>"},ContractSelector:"[u8; 4]",ContractTypeSpec:{type:"SiLookupTypeId",displayName:"ContractDisplayName"}}),{},{ContractProject:{metadataVersion:"Text",source:"ContractProjectSource",contract:"ContractProjectContract",types:"Vec<SiType>",spec:"ContractContractSpec"},ContractProjectContract:{name:"Text",version:"Text",authors:"Vec<Text>",description:"Option<Text>",documentation:"Option<Text>",repository:"Option<Text>",homepage:"Option<Text>",license:"Option<Text>"},ContractProjectSource:{_alias:{wasmHash:"hash"},wasmHash:"[u8; 32]",language:"Text",compiler:"Text",wasm:"Raw"}})},Vs={rpc:{},types:{SiField:{name:"Option<Text>",type:"SiLookupTypeId"},SiLookupTypeId:"u32",SiPath:"Vec<Text>",SiType:{path:"SiPath",params:"Vec<SiLookupTypeId>",def:"SiTypeDef"},SiTypeDef:{_enum:{Composite:"SiTypeDefComposite",Variant:"SiTypeDefVariant",Sequence:"SiTypeDefSequence",Array:"SiTypeDefArray",Tuple:"SiTypeDefTuple",Primitive:"SiTypeDefPrimitive"}},SiTypeDefArray:{len:"u16",type:"SiLookupTypeId"},SiTypeDefComposite:{fields:"Vec<SiField>"},SiTypeDefVariant:{variants:"Vec<SiVariant>"},SiTypeDefPrimitive:{_enum:["Bool","Char","Str","U8","U16","U32","U64","U128","U256","I8","I16","I32","I64","I128","I256"]},SiTypeDefSequence:{type:"SiLookupTypeId"},SiTypeDefTuple:"Vec<SiLookupTypeId>",SiVariant:{name:"Text",fields:"Vec<SiField>",discriminant:"Option<u64>"}}};function qs(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 Us(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qs(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fs={rpc:Us(Us(Us({},{listening:{aliasSection:"net",description:"Returns true if client is actively listening for network connections. Otherwise false.",params:[],type:"bool"},peerCount:{aliasSection:"net",description:"Returns number of peers connected to node.",params:[],type:"String"},version:{aliasSection:"net",description:"Returns protocol version.",params:[],type:"String"}}),{clientVersion:{aliasSection:"web3",description:"Returns current client version.",params:[],type:"String"},sha3:{aliasSection:"web3",description:"Returns sha3 of the given data",params:[{name:"data",type:"Bytes"}],type:"H256"}}),{},{accounts:{description:"Returns accounts list.",params:[],type:"Vec<H160>"},blockNumber:{description:"Returns the blockNumber",params:[],type:"U256"},call:{description:"Call contract, returning the output data.",params:[{name:"request",type:"EthCallRequest"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"Bytes"},chainId:{description:"Returns the chain ID used for transaction signing at the current best block. None is returned if not available.",params:[],type:"U64"},coinbase:{description:"Returns block author.",params:[],type:"H160"},estimateGas:{description:"Estimate gas needed for execution of given contract.",params:[{name:"request",type:"EthCallRequest"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"U256"},gasPrice:{description:"Returns current gas price.",params:[],type:"U256"},getBalance:{description:"Returns balance of the given account.",params:[{name:"address",type:"H160"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"U256"},getBlockByHash:{description:"Returns block with given hash.",params:[{name:"hash",type:"H256"},{name:"full",type:"bool"}],type:"Option<EthRichBlock>"},getBlockByNumber:{description:"Returns block with given number.",params:[{name:"block",type:"BlockNumber"},{name:"full",type:"bool"}],type:"Option<EthRichBlock>"},getBlockTransactionCountByHash:{description:"Returns the number of transactions in a block with given hash.",params:[{name:"hash",type:"H256"}],type:"U256"},getBlockTransactionCountByNumber:{description:"Returns the number of transactions in a block with given block number.",params:[{name:"block",type:"BlockNumber"}],type:"U256"},getCode:{description:"Returns the code at given address at given time (block number).",params:[{name:"address",type:"H160"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"Bytes"},getFilterChanges:{description:"Returns filter changes since last poll.",params:[{name:"index",type:"U256"}],type:"EthFilterChanges"},getFilterLogs:{description:"Returns all logs matching given filter (in a range 'from' - 'to').",params:[{name:"index",type:"U256"}],type:"Vec<EthLog>"},getLogs:{description:"Returns logs matching given filter object.",params:[{name:"filter",type:"EthFilter"}],type:"Vec<EthLog>"},getProof:{description:"Returns proof for account and storage.",params:[{name:"address",type:"H160"},{name:"storageKeys",type:"Vec<H256>"},{name:"number",type:"BlockNumber"}],type:"EthAccount"},getStorageAt:{description:"Returns content of the storage at given address.",params:[{name:"address",type:"H160"},{name:"index",type:"U256"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"H256"},getTransactionByBlockHashAndIndex:{description:"Returns transaction at given block hash and index.",params:[{name:"hash",type:"H256"},{name:"index",type:"U256"}],type:"EthTransaction"},getTransactionByBlockNumberAndIndex:{description:"Returns transaction by given block number and index.",params:[{name:"number",type:"BlockNumber"},{name:"index",type:"U256"}],type:"EthTransaction"},getTransactionByHash:{description:"Get transaction by its hash.",params:[{name:"hash",type:"H256"}],type:"EthTransaction"},getTransactionCount:{description:"Returns the number of transactions sent from given address at given time (block number).",params:[{name:"hash",type:"H256"},{isOptional:!0,name:"number",type:"BlockNumber"}],type:"U256"},getTransactionReceipt:{description:"Returns transaction receipt by transaction hash.",params:[{name:"hash",type:"H256"}],type:"EthReceipt"},getUncleByBlockHashAndIndex:{description:"Returns an uncles at given block and index.",params:[{name:"hash",type:"H256"},{name:"index",type:"U256"}],type:"EthRichBlock"},getUncleByBlockNumberAndIndex:{description:"Returns an uncles at given block and index.",params:[{name:"number",type:"BlockNumber"},{name:"index",type:"U256"}],type:"EthRichBlock"},getUncleCountByBlockHash:{description:"Returns the number of uncles in a block with given hash.",params:[{name:"hash",type:"H256"}],type:"U256"},getUncleCountByBlockNumber:{description:"Returns the number of uncles in a block with given block number.",params:[{name:"number",type:"BlockNumber"}],type:"U256"},getWork:{description:"Returns the hash of the current block, the seedHash, and the boundary condition to be met.",params:[],type:"EthWork"},hashrate:{description:"Returns the number of hashes per second that the node is mining with.",params:[],type:"U256"},mining:{description:"Returns true if client is actively mining new blocks.",params:[],type:"bool"},newBlockFilter:{description:"Returns id of new block filter.",params:[],type:"U256"},newFilter:{description:"Returns id of new filter.",params:[{name:"filter",type:"EthFilter"}],type:"U256"},newPendingTransactionFilter:{description:"Returns id of new block filter.",params:[],type:"U256"},protocolVersion:{description:"Returns protocol version encoded as a string (quotes are necessary).",params:[],type:"u64"},sendRawTransaction:{description:"Sends signed transaction, returning its hash.",params:[{name:"bytes",type:"Bytes"}],type:"H256"},sendTransaction:{description:"Sends transaction; will block waiting for signer to return the transaction hash",params:[{name:"tx",type:"EthTransactionRequest"}],type:"H256"},submitHashrate:{description:"Used for submitting mining hashrate.",params:[{name:"index",type:"U256"},{name:"hash",type:"H256"}],type:"bool"},submitWork:{description:"Used for submitting a proof-of-work solution.",params:[{name:"nonce",type:"H64"},{name:"headerHash",type:"H256"},{name:"mixDigest",type:"H256"}],type:"bool"},subscribe:{description:"Subscribe to Eth subscription.",params:[{name:"kind",type:"EthSubKind"},{isOptional:!0,name:"params",type:"EthSubParams"}],pubsub:["subscription","subscribe","unsubscribe"],type:"Null"},syncing:{description:"Returns an object with data about the sync status or false.",params:[],type:"EthSyncStatus"},uninstallFilter:{description:"Uninstalls filter.",params:[{name:"index",type:"U256"}],type:"bool"}}),types:{EthereumAccountId:"GenericEthereumAccountId",EthereumLookupSource:"GenericEthereumLookupSource",EthereumSignature:"[u8; 65]",EthAccount:{address:"H160",balance:"U256",nonce:"U256",codeHash:"H256",storageHash:"H256",accountProof:"Vec<Bytes>",storageProof:"Vec<EthStorageProof>"},EthBlock:{header:"EthHeader",transactions:"Vec<EthTransaction>",ommers:"Vec<EthHeader>"},EthHeader:{parentHash:"H256",ommersHash:"H256",beneficiary:"H160",stateRoot:"H256",transactionsRoot:"H256",receiptsRoot:"H256",logsBloom:"EthBloom",difficulty:"U256",number:"U256",gasLimit:"U256",gasUsed:"U256",timestamp:"u64",extraData:"Bytes",mixMash:"H256",nonce:"H64"},EthRichBlock:{_alias:{blockHash:"hash",blockSize:"size"},blockHash:"Option<H256>",parentHash:"H256",sha3Uncles:"H256",author:"H160",miner:"H160",stateRoot:"H256",transactionsRoot:"H256",receiptsRoot:"H256",number:"Option<U256>",gasUsed:"U256",gasLimit:"U256",extraData:"Bytes",logsBloom:"EthBloom",timestamp:"U256",difficulty:"U256",totalDifficulty:"Option<U256>",sealFields:"Vec<Bytes>",uncles:"Vec<H256>",transactions:"Vec<EthTransaction>",blockSize:"Option<U256>"},EthBloom:"H2048",EthCallRequest:{from:"Option<H160>",to:"Option<H160>",gasPrice:"Option<U256>",gas:"Option<U256>",value:"Option<U256>",data:"Option<Bytes>",nonce:"Option<U256>"},EthFilter:{fromBlock:"Option<BlockNumber>",toBlock:"Option<BlockNumber>",blockHash:"Option<H256>",address:"Option<EthFilterAddress>",topics:"Option<EthFilterTopic>"},EthFilterAddress:{_enum:{Single:"H160",Multiple:"Vec<H160>",Null:"Null"}},EthFilterChanges:{_enum:{Logs:"Vec<EthLog>",Hashes:"Vec<H256>",Empty:"Null"}},EthFilterTopic:{_enum:{Single:"EthFilterTopicInner",Multiple:"Vec<EthFilterTopicInner>",Null:"Null"}},EthFilterTopicEntry:"Option<H256>",EthFilterTopicInner:{_enum:{Single:"EthFilterTopicEntry",Multiple:"Vec<EthFilterTopicEntry>",Null:"Null"}},EthRichHeader:{_alias:{blockHash:"hash",blockSize:"size"},blockHash:"Option<H256>",parentHash:"H256",sha3Uncles:"H256",author:"H160",miner:"H160",stateRoot:"H256",transactionsRoot:"H256",receiptsRoot:"H256",number:"Option<U256>",gasUsed:"U256",gasLimit:"U256",extraData:"Bytes",logsBloom:"EthBloom",timestamp:"U256",difficulty:"U256",sealFields:"Vec<Bytes>",blockSize:"Option<U256>"},EthLog:{address:"H160",topics:"Vec<H256>",data:"Bytes",blockHash:"Option<H256>",blockNumber:"Option<U256>",transactionHash:"Option<H256>",transactionIndex:"Option<U256>",logIndex:"Option<U256>",transactionLogIndex:"Option<U256>",removed:"bool"},EthReceipt:{transactionHash:"Option<H256>",transactionIndex:"Option<U256>",blockHash:"Option<H256>",from:"Option<H160>",to:"Option<H160>",blockNumber:"Option<U256>",cumulativeGasUsed:"U256",gasUsed:"Option<U256>",contractAddress:"Option<H160>",logs:"Vec<EthLog>",root:"Option<H256>",logsBloom:"EthBloom",statusCode:"Option<U64>"},EthStorageProof:{key:"U256",value:"U256",proof:"Vec<Bytes>"},EthSubKind:{_enum:["newHeads","logs","newPendingTransactions","syncing"]},EthSubParams:{_enum:{None:"Null",Logs:"EthFilter"}},EthSubResult:{_enum:{Header:"EthRichHeader",Log:"EthLog",TransactionHash:"H256",SyncState:"EthSyncStatus"}},EthSyncInfo:{startingBlock:"U256",currentBlock:"U256",highestBlock:"U256",warpChunksAmount:"Option<U256>",warpChunksProcessed:"Option<U256>"},EthSyncStatus:{_enum:{Info:"EthSyncInfo",None:"Null"}},EthTransaction:{nonce:"U256",gasPrice:"U256",gasLimit:"U256",action:"EthTransactionAction",value:"U256",input:"Bytes",signature:"EthTransactionSignature"},EthTransactionSignature:{v:"u64",r:"H256",s:"H256"},EthTransactionAction:{_enum:{Call:"H160",Create:"Null"}},EthTransactionCondition:{_enum:{block:"u64",time:"u64"}},EthTransactionRequest:{from:"Option<H160>",to:"Option<H160>",gasPrice:"Option<U256>",gas:"Option<U256>",value:"Option<U256>",data:"Option<Bytes>",nonce:"Option<U256>"},EthTransactionStatus:{transactionHash:"H256",transactionIndex:"u32",from:"H160",to:"Option<H160>",contractAddress:"Option<H160>",logs:"Vec<EthLog>",logsBloom:"EthBloom"},EthWork:{powHash:"H256",seedHash:"H256",target:"H256",number:"Option<u64>"}}};var Ws={rpc:{},types:{DoubleMapTypeV9:{hasher:"StorageHasherV9",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV9"},ErrorMetadataV9:{name:"Text",documentation:"Vec<Text>"},EventMetadataV9:{name:"Text",args:"Vec<Type>",documentation:"Vec<Text>"},FunctionArgumentMetadataV9:{name:"Text",type:"Type"},FunctionMetadataV9:{name:"Text",args:"Vec<FunctionArgumentMetadataV9>",documentation:"Vec<Text>"},MapTypeV9:{hasher:"StorageHasherV9",key:"Type",value:"Type",linked:"bool"},MetadataV9:{modules:"Vec<ModuleMetadataV9>"},ModuleConstantMetadataV9:{name:"Text",type:"Type",value:"Bytes",documentation:"Vec<Text>"},ModuleMetadataV9:{name:"Text",storage:"Option<StorageMetadataV9>",calls:"Option<Vec<FunctionMetadataV9>>",events:"Option<Vec<EventMetadataV9>>",constants:"Vec<ModuleConstantMetadataV9>",errors:"Vec<ErrorMetadataV9>"},StorageEntryMetadataV9:{name:"Text",modifier:"StorageEntryModifierV9",type:"StorageEntryTypeV9",fallback:"Bytes",documentation:"Vec<Text>"},StorageEntryModifierV9:{_enum:["Optional","Default","Required"]},StorageEntryTypeV9:{_enum:{Plain:"Type",Map:"MapTypeV9",DoubleMap:"DoubleMapTypeV9"}},StorageHasherV9:{_enum:{Blake2_128:null,Blake2_256:null,Twox128:null,Twox256:null,Twox64Concat:null}},StorageMetadataV9:{prefix:"Text",items:"Vec<StorageEntryMetadataV9>"},DoubleMapTypeV10:{hasher:"StorageHasherV10",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV10"},ErrorMetadataV10:"ErrorMetadataV9",EventMetadataV10:"EventMetadataV9",FunctionArgumentMetadataV10:"FunctionArgumentMetadataV9",FunctionMetadataV10:"FunctionMetadataV9",MapTypeV10:{hasher:"StorageHasherV10",key:"Type",value:"Type",linked:"bool"},MetadataV10:{modules:"Vec<ModuleMetadataV10>"},ModuleConstantMetadataV10:"ModuleConstantMetadataV9",ModuleMetadataV10:{name:"Text",storage:"Option<StorageMetadataV10>",calls:"Option<Vec<FunctionMetadataV10>>",events:"Option<Vec<EventMetadataV10>>",constants:"Vec<ModuleConstantMetadataV10>",errors:"Vec<ErrorMetadataV10>"},StorageEntryModifierV10:"StorageEntryModifierV9",StorageEntryMetadataV10:{name:"Text",modifier:"StorageEntryModifierV10",type:"StorageEntryTypeV10",fallback:"Bytes",documentation:"Vec<Text>"},StorageEntryTypeV10:{_enum:{Plain:"Type",Map:"MapTypeV10",DoubleMap:"DoubleMapTypeV10"}},StorageMetadataV10:{prefix:"Text",items:"Vec<StorageEntryMetadataV10>"},StorageHasherV10:{_enum:{Blake2_128:null,Blake2_256:null,Blake2_128Concat:null,Twox128:null,Twox256:null,Twox64Concat:null}},DoubleMapTypeV11:{hasher:"StorageHasherV11",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV11"},ErrorMetadataV11:"ErrorMetadataV10",EventMetadataV11:"EventMetadataV10",ExtrinsicMetadataV11:{version:"u8",signedExtensions:"Vec<Text>"},FunctionArgumentMetadataV11:"FunctionArgumentMetadataV10",FunctionMetadataV11:"FunctionMetadataV10",MapTypeV11:{hasher:"StorageHasherV11",key:"Type",value:"Type",linked:"bool"},MetadataV11:{modules:"Vec<ModuleMetadataV11>",extrinsic:"ExtrinsicMetadataV11"},ModuleConstantMetadataV11:"ModuleConstantMetadataV10",ModuleMetadataV11:{name:"Text",storage:"Option<StorageMetadataV11>",calls:"Option<Vec<FunctionMetadataV11>>",events:"Option<Vec<EventMetadataV11>>",constants:"Vec<ModuleConstantMetadataV11>",errors:"Vec<ErrorMetadataV11>"},StorageEntryModifierV11:"StorageEntryModifierV10",StorageEntryMetadataV11:{name:"Text",modifier:"StorageEntryModifierV11",type:"StorageEntryTypeV11",fallback:"Bytes",documentation:"Vec<Text>"},StorageEntryTypeV11:{_enum:{Plain:"Type",Map:"MapTypeV11",DoubleMap:"DoubleMapTypeV11"}},StorageMetadataV11:{prefix:"Text",items:"Vec<StorageEntryMetadataV11>"},StorageHasherV11:{_enum:{Blake2_128:null,Blake2_256:null,Blake2_128Concat:null,Twox128:null,Twox256:null,Twox64Concat:null,Identity:null}},DoubleMapTypeV12:"DoubleMapTypeV11",ErrorMetadataV12:"ErrorMetadataV11",EventMetadataV12:"EventMetadataV11",ExtrinsicMetadataV12:"ExtrinsicMetadataV11",FunctionArgumentMetadataV12:"FunctionArgumentMetadataV11",FunctionMetadataV12:"FunctionMetadataV11",MapTypeV12:"MapTypeV11",MetadataV12:{modules:"Vec<ModuleMetadataV12>",extrinsic:"ExtrinsicMetadataV12"},ModuleConstantMetadataV12:"ModuleConstantMetadataV11",ModuleMetadataV12:{name:"Text",storage:"Option<StorageMetadataV12>",calls:"Option<Vec<FunctionMetadataV12>>",events:"Option<Vec<EventMetadataV12>>",constants:"Vec<ModuleConstantMetadataV12>",errors:"Vec<ErrorMetadataV12>",index:"u8"},StorageEntryModifierV12:"StorageEntryModifierV11",StorageEntryMetadataV12:"StorageEntryMetadataV11",StorageEntryTypeV12:"StorageEntryTypeV11",StorageMetadataV12:"StorageMetadataV11",StorageHasherV12:"StorageHasherV11",DoubleMapTypeV13:"DoubleMapTypeV12",ErrorMetadataV13:"ErrorMetadataV12",EventMetadataV13:"EventMetadataV12",ExtrinsicMetadataV13:"ExtrinsicMetadataV12",FunctionArgumentMetadataV13:"FunctionArgumentMetadataV12",FunctionMetadataV13:"FunctionMetadataV12",MapTypeV13:"MapTypeV12",MetadataV13:{modules:"Vec<ModuleMetadataV13>",extrinsic:"ExtrinsicMetadataV13"},ModuleConstantMetadataV13:"ModuleConstantMetadataV12",ModuleMetadataV13:{name:"Text",storage:"Option<StorageMetadataV13>",calls:"Option<Vec<FunctionMetadataV13>>",events:"Option<Vec<EventMetadataV13>>",constants:"Vec<ModuleConstantMetadataV13>",errors:"Vec<ErrorMetadataV13>",index:"u8"},NMapTypeV13:{keyVec:"Vec<Type>",hashers:"Vec<StorageHasherV13>",value:"Type"},StorageEntryModifierV13:"StorageEntryModifierV12",StorageEntryMetadataV13:{name:"Text",modifier:"StorageEntryModifierV13",type:"StorageEntryTypeV13",fallback:"Bytes",documentation:"Vec<Text>"},StorageEntryTypeV13:{_enum:{Plain:"Type",Map:"MapTypeV13",DoubleMap:"DoubleMapTypeV13",NMap:"NMapTypeV13"}},StorageMetadataV13:{prefix:"Text",items:"Vec<StorageEntryMetadataV13>"},StorageHasherV13:"StorageHasherV12",DoubleMapTypeLatest:"DoubleMapTypeV13",ErrorMetadataLatest:"ErrorMetadataV13",EventMetadataLatest:"EventMetadataV13",ExtrinsicMetadataLatest:"ExtrinsicMetadataV13",FunctionArgumentMetadataLatest:"FunctionArgumentMetadataV13",FunctionMetadataLatest:"FunctionMetadataV13",MapTypeLatest:"MapTypeV13",MetadataLatest:"MetadataV13",ModuleConstantMetadataLatest:"ModuleConstantMetadataV13",ModuleMetadataLatest:"ModuleMetadataV13",NMapTypeLatest:"NMapTypeV13",StorageEntryMetadataLatest:"StorageEntryMetadataV13",StorageEntryModifierLatest:"StorageEntryModifierV13",StorageEntryTypeLatest:"StorageEntryTypeV13",StorageMetadataLatest:"StorageMetadataV13",StorageHasher:"StorageHasherV13",MetadataAll:{_enum:{V0:"DoNotConstruct<MetadataV0>",V1:"DoNotConstruct<MetadataV1>",V2:"DoNotConstruct<MetadataV2>",V3:"DoNotConstruct<MetadataV3>",V4:"DoNotConstruct<MetadataV4>",V5:"DoNotConstruct<MetadataV5>",V6:"DoNotConstruct<MetadataV6>",V7:"DoNotConstruct<MetadataV7>",V8:"DoNotConstruct<MetadataV8>",V9:"MetadataV9",V10:"MetadataV10",V11:"MetadataV11",V12:"MetadataV12",V13:"MetadataV13"}}}},Ks={rpc:{methods:{description:"Retrieves the list of RPC methods that are exposed by the node",params:[],type:"RpcMethods"}},types:{RpcMethods:{version:"u32",methods:"Vec<Text>"}}},Xs={rpc:{hasKey:{description:"Returns true if the keystore has private keys for the given public key and key type.",params:[{name:"publicKey",type:"Bytes"},{name:"keyType",type:"Text"}],type:"bool"},hasSessionKeys:{description:"Returns true if the keystore has private keys for the given session public keys.",params:[{name:"sessionKeys",type:"Bytes"}],type:"bool"},removeExtrinsic:{description:"Remove given extrinsic from the pool and temporarily ban it to prevent reimporting",params:[{name:"bytesOrHash",type:"Vec<ExtrinsicOrHash>"}],type:"Vec<Hash>"},insertKey:{description:"Insert a key into the keystore.",params:[{name:"keyType",type:"Text"},{name:"suri",type:"Text"},{name:"publicKey",type:"Bytes"}],type:"Bytes"},rotateKeys:{description:"Generate new session keys and returns the corresponding public keys",params:[],type:"Bytes"},pendingExtrinsics:{description:"Returns all pending extrinsics, potentially grouped by sender",params:[],type:"Vec<Extrinsic>"},submitExtrinsic:{isSigned:!0,description:"Submit a fully formatted extrinsic for block inclusion",params:[{name:"extrinsic",type:"Extrinsic"}],type:"Hash"},submitAndWatchExtrinsic:{description:"Submit and subscribe to watch an extrinsic until unsubscribed",isSigned:!0,params:[{name:"extrinsic",type:"Extrinsic"}],pubsub:["extrinsicUpdate","submitAndWatchExtrinsic","unwatchExtrinsic"],type:"ExtrinsicStatus"}},types:{ExtrinsicOrHash:{_enum:{Hash:"Hash",Extrinsic:"Bytes"}},ExtrinsicStatus:{_enum:{Future:"Null",Ready:"Null",Broadcast:"Vec<Text>",InBlock:"Hash",Retracted:"Hash",FinalityTimeout:"Hash",Finalized:"Hash",Usurped:"Hash",Dropped:"Null",Invalid:"Null"}}}},Zs={rpc:{getHeader:{alias:["chain_getHead"],description:"Retrieves the header for a specific block",params:[{name:"hash",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Header"},getBlock:{description:"Get header and body of a relay chain block",params:[{name:"hash",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"SignedBlock"},getBlockHash:{description:"Get the block hash for a specific block",params:[{name:"blockNumber",type:"BlockNumber",isOptional:!0}],type:"BlockHash"},getFinalizedHead:{alias:["chain_getFinalisedHead"],description:"Get hash of the last finalized block in the canon chain",params:[],type:"BlockHash"},subscribeNewHeads:{alias:["chain_unsubscribeNewHeads","subscribe_newHead","unsubscribe_newHead"],description:"Retrieves the best header via subscription",params:[],pubsub:["newHead","subscribeNewHead","unsubscribeNewHead"],type:"Header"},subscribeFinalizedHeads:{alias:["chain_subscribeFinalisedHeads","chain_unsubscribeFinalisedHeads"],description:"Retrieves the best finalized header via subscription",params:[],pubsub:["finalizedHead","subscribeFinalizedHeads","unsubscribeFinalizedHeads"],type:"Header"},subscribeAllHeads:{description:"Retrieves the newest header via subscription",params:[],pubsub:["allHead","subscribeAllHeads","unsubscribeAllHeads"],type:"Header"}},types:{BlockHash:"Hash"}},Gs={rpc:{getKeys:{description:"Returns the keys with prefix from a child storage, leave empty to get all the keys",params:[{name:"childKey",type:"PrefixedStorageKey"},{name:"prefix",type:"StorageKey"},{name:"at",type:"Hash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageKey>"},getKeysPaged:{alias:["childstate_getKeysPagedAt"],description:"Returns the keys with prefix from a child storage with pagination support",params:[{name:"childKey",type:"PrefixedStorageKey"},{name:"prefix",type:"StorageKey"},{name:"count",type:"u32"},{name:"startKey",type:"StorageKey",isOptional:!0},{name:"at",type:"Hash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageKey>"},getStorage:{description:"Returns a child storage entry at a specific block state",params:[{name:"childKey",type:"PrefixedStorageKey"},{name:"key",type:"StorageKey"},{name:"at",type:"Hash",isHistoric:!0,isOptional:!0}],type:"Option<StorageData>"},getStorageHash:{description:"Returns the hash of a child storage entry at a block state",params:[{name:"childKey",type:"PrefixedStorageKey"},{name:"key",type:"StorageKey"},{name:"at",type:"Hash",isHistoric:!0,isOptional:!0}],type:"Option<Hash>"},getStorageSize:{description:"Returns the size of a child storage entry at a block state",params:[{name:"childKey",type:"PrefixedStorageKey"},{name:"key",type:"StorageKey"},{name:"at",type:"Hash",isHistoric:!0,isOptional:!0}],type:"Option<u64>"}},types:{PrefixedStorageKey:"StorageKey"}},Ys={rpc:{localStorageSet:{description:"Set offchain local storage under given key and prefix",params:[{name:"kind",type:"StorageKind"},{name:"key",type:"Bytes"},{name:"value",type:"Bytes"}],type:"Null"},localStorageGet:{description:"Get offchain local storage under given key and prefix",params:[{name:"kind",type:"StorageKind"},{name:"key",type:"Bytes"}],type:"Option<Bytes>"}},types:{StorageKind:{_enum:{PERSISTENT:1,LOCAL:2}}}};const Js=[{name:"extrinsic",type:"Bytes"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}];var Qs={rpc:{queryInfo:{description:"Retrieves the fee information for an encoded extrinsic",params:Js,type:"RuntimeDispatchInfo"},queryFeeDetails:{description:"Query the detailed fee of a given encoded extrinsic",params:Js,type:"FeeDetails"}},types:{FeeDetails:{inclusionFee:"Option<InclusionFee>"},InclusionFee:{baseFee:"Balance",lenFee:"Balance",adjustedWeightFee:"Balance"},RuntimeDispatchInfo:{weight:"Weight",class:"DispatchClass",partialFee:"Balance"}}},$s={rpc:{call:{alias:["state_callAt"],description:"Perform a call to a builtin on the chain",params:[{name:"method",type:"Text"},{name:"data",type:"Bytes"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Bytes"},getKeys:{description:"Retrieves the keys with a certain prefix",params:[{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageKey>"},getPairs:{description:"Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)",params:[{name:"prefix",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Vec<KeyValue>"},getKeysPaged:{alias:["state_getKeysPagedAt"],description:"Returns the keys with prefix with pagination support.",params:[{name:"key",type:"StorageKey"},{name:"count",type:"u32"},{name:"startKey",type:"StorageKey",isOptional:!0},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageKey>"},getStorage:{alias:["state_getStorageAt"],description:"Retrieves the storage for a key",params:[{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"StorageData"},getStorageHash:{alias:["state_getStorageHashAt"],description:"Retrieves the storage hash",params:[{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Hash"},getStorageSize:{alias:["state_getStorageSizeAt"],description:"Retrieves the storage size",params:[{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"u64"},getChildKeys:{description:"Retrieves the keys with prefix of a specific child storage",params:[{name:"childStorageKey",type:"StorageKey"},{name:"childDefinition",type:"StorageKey"},{name:"childType",type:"u32"},{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageKey>"},getChildStorage:{description:"Retrieves the child storage for a key",params:[{name:"childStorageKey",type:"StorageKey"},{name:"childDefinition",type:"StorageKey"},{name:"childType",type:"u32"},{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"StorageData"},getChildStorageHash:{description:"Retrieves the child storage hash",params:[{name:"childStorageKey",type:"StorageKey"},{name:"childDefinition",type:"StorageKey"},{name:"childType",type:"u32"},{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Hash"},getChildStorageSize:{description:"Retrieves the child storage size",params:[{name:"childStorageKey",type:"StorageKey"},{name:"childDefinition",type:"StorageKey"},{name:"childType",type:"u32"},{name:"key",type:"StorageKey"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"u64"},getMetadata:{description:"Returns the runtime metadata",params:[{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Metadata"},getRuntimeVersion:{alias:["chain_getRuntimeVersion"],description:"Get the runtime version",params:[{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"RuntimeVersion"},queryStorage:{description:"Query historical storage entries (by key) starting from a start block",params:[{name:"keys",type:"Vec<StorageKey>"},{name:"fromBlock",type:"Hash"},{name:"toBlock",type:"BlockHash",isOptional:!0}],type:"Vec<StorageChangeSet>"},queryStorageAt:{description:"Query storage entries (by key) starting at block hash given as the second parameter",params:[{name:"keys",type:"Vec<StorageKey>"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Vec<StorageChangeSet>"},getChildReadProof:{description:"Returns proof of storage for child key entries at a specific block state.",params:[{name:"childStorageKey",type:"PrefixedStorageKey"},{name:"keys",type:"Vec<StorageKey>"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ReadProof"},getReadProof:{description:"Returns proof of storage entries at a specific block state",params:[{name:"keys",type:"Vec<StorageKey>"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ReadProof"},subscribeRuntimeVersion:{alias:["chain_subscribeRuntimeVersion","chain_unsubscribeRuntimeVersion"],description:"Retrieves the runtime version via subscription",params:[],pubsub:["runtimeVersion","subscribeRuntimeVersion","unsubscribeRuntimeVersion"],type:"RuntimeVersion"},subscribeStorage:{description:"Subscribes to storage changes for the provided keys",params:[{name:"keys",type:"Vec<StorageKey>",isOptional:!0}],pubsub:["storage","subscribeStorage","unsubscribeStorage"],type:"StorageChangeSet"},traceBlock:{description:"Provides a way to trace the re-execution of a single block",params:[{name:"block",type:"Hash"},{name:"targets",type:"Option<Text>"},{name:"storageKeys",type:"Option<Text>"}],type:"TraceBlockResponse"}},types:{ApiId:"[u8; 8]",BlockTrace:{blockHash:"Text",parentHash:"Text",tracingTargets:"Text",storageKeys:"Text",spans:"Vec<BlockTraceSpan>",events:"Vec<BlockTraceEvent>"},BlockTraceEvent:{target:"Text",data:"BlockTraceEventData",parentId:"Option<u64>"},BlockTraceEventData:{stringValues:"HashMap<Text, Text>"},BlockTraceSpan:{id:"u64",parentId:"Option<u64>",name:"Text",target:"Text",wasm:"bool"},KeyValueOption:"(StorageKey, Option<StorageData>)",ReadProof:{at:"Hash",proof:"Vec<Bytes>"},RuntimeVersionApi:"(ApiId, u32)",RuntimeVersion:{specName:"Text",implName:"Text",authoringVersion:"u32",specVersion:"u32",implVersion:"u32",apis:"Vec<RuntimeVersionApi>",transactionVersion:"u32"},RuntimeVersionPartial:{specName:"Text",specVersion:"u32"},StorageChangeSet:{block:"Hash",changes:"Vec<KeyValueOption>"},TraceBlockResponse:{_enum:{TraceError:"TraceError",BlockTrace:"BlockTrace"}},TraceError:{error:"Text"}}};function ed(e,t){return e.length===t.length&&0===function(e,t){return function(e,t){let r=0;for(;;){const n=r>=e.length,i=r>=t.length;if(n&&i)return 0;if(n)return-1;if(i)return 1;if(e[r]!==t[r])return e[r]>t[r]?1:-1;r++}}(Object(ge.a)(e),Object(ge.a)(t))}(e,t)}function td(e,t){return ed(Object(ge.a)(e),Object(ge.a)(t))}function rd(e,t){const r=t.toU8a(),n=t.toRawType();Object(T.a)(td(e,r)||["Bytes","Text","Type"].includes(n)&&e.length===t.length,()=>`${n}:: Decoded input doesn't match input, received ${Object(ve.a)(e,512)} (${e.length} bytes), created ${Object(ve.a)(r,512)} (${r.length} bytes)`)}function nd(e,t,r=[],{blockHash:n,isPedantic:i}={}){const f=new t(e,...r),c=r[0];return i&&(Object(Oe.a)(c)?rd(c,f):Object(Me.a)(c)&&rd(Object(ge.a)(c),f)),n&&(f.createdAtHash=fd(e,"Hash",n)),f}function id(e,t,r=[],n={}){let i=null,f=null;try{return i=Ta(e,t),nd(e,i,r,n)}catch(e){f=new Error(`createType(${t}):: ${e.message}`)}if(i&&i.__fallbackType)try{return i=Ta(e,i.__fallbackType),nd(e,i,r,n)}catch{}throw f}function fd(e,t,...r){return id(e,t,r)}function cd(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}const ad=Object(E.a)("registry");var od=j("classes"),sd=j("definitions"),dd=j("metadataCalls"),ud=j("metadataErrors"),hd=j("metadataEvents"),ld=j("unknownTypes"),pd=j("chainProperties"),bd=j("hasher"),md=j("knownDefaults"),yd=j("knownDefinitions"),gd=j("knownTypes"),vd=j("signedExtensions"),wd=j("userExtensions");class Md{constructor(e){Object.defineProperty(this,od,{writable:!0,value:new Map}),Object.defineProperty(this,sd,{writable:!0,value:new Map}),Object.defineProperty(this,dd,{writable:!0,value:{}}),Object.defineProperty(this,ud,{writable:!0,value:{}}),Object.defineProperty(this,hd,{writable:!0,value:{}}),Object.defineProperty(this,ld,{writable:!0,value:new Map}),Object.defineProperty(this,pd,{writable:!0,value:void 0}),Object.defineProperty(this,bd,{writable:!0,value:$i}),Object.defineProperty(this,md,{writable:!0,value:void 0}),Object.defineProperty(this,yd,{writable:!0,value:void 0}),Object.defineProperty(this,gd,{writable:!0,value:{}}),Object.defineProperty(this,vd,{writable:!0,value:uf}),Object.defineProperty(this,wd,{writable:!0,value:void 0}),this.createdAtHash=void 0,S(this,md)[md]=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cd(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({Json:ef,Metadata:Mn,Raw:rf},i),S(this,yd)[yd]=f,this.init(),e&&(this.createdAtHash=this.createType("Hash",e))}init(){return S(this,od)[od]=new Map,S(this,sd)[sd]=new Map,S(this,ld)[ld]=new Map,S(this,gd)[gd]={},this.register(S(this,md)[md]),Object.values(S(this,yd)[yd]).forEach(({types:e})=>this.register(e)),this}get chainDecimals(){var e;if(null!==(e=S(this,pd)[pd])&&void 0!==e&&e.tokenDecimals.isSome){const e=S(this,pd)[pd].tokenDecimals.unwrap();if(e.length)return e.map(e=>e.toNumber())}return[12]}get chainSS58(){var e;return null!==(e=S(this,pd)[pd])&&void 0!==e&&e.ss58Format.isSome?S(this,pd)[pd].ss58Format.unwrap().toNumber():void 0}get chainTokens(){var e;if(null!==(e=S(this,pd)[pd])&&void 0!==e&&e.tokenSymbol.isSome){const e=S(this,pd)[pd].tokenSymbol.unwrap();if(e.length)return e.map(e=>e.toString())}return[Mr.getDefaults().unit]}get knownTypes(){return S(this,gd)[gd]}get unknownTypes(){return[...S(this,ld)[ld].keys()]}get signedExtensions(){return S(this,vd)[vd]}createClass(e){return Ta(this,e)}createType(e,...t){return fd(this,e,...t)}findMetaCall(e){const t=Object(ve.a)(e);return Object(T.b)(S(this,dd)[dd][t],`findMetaCall: Unable to find Call with index ${t}/[${e.toString()}]`)}findMetaError(e){const t=Object(ve.a)(Object(Oe.a)(e)?e:new Uint8Array([e.index.toNumber(),e.error.toNumber()]));return Object(T.b)(S(this,ud)[ud][t],`findMetaError: Unable to find Error with index ${t}/[${e.toString()}]`)}findMetaEvent(e){const t=Object(ve.a)(e);return Object(T.b)(S(this,hd)[hd][t],`findMetaEvent: Unable to find Event with index ${t}/[${e.toString()}]`)}get(e,t){let r=S(this,od)[od].get(e);if(!r){const n=S(this,sd)[sd].get(e);let i;n?i=Ta(this,n):t&&(ad.warn(`Unable to resolve type ${e}, it will fail on construction`),S(this,ld)[ld].set(e,!0),i=Ia.with(e)),i&&(r=class extends i{},S(this,od)[od].set(e,r))}return r}getChainProperties(){return S(this,pd)[pd]}getClassName(e){const t=[...S(this,od)[od].entries()].find(([,t])=>t===e);return t?t[0]:void 0}getDefinition(e){return S(this,sd)[sd].get(e)}getModuleInstances(e,t){var r,n,i,f,c;return null===(r=S(this,gd)[gd])||void 0===r||null===(n=r.typesBundle)||void 0===n||null===(i=n.spec)||void 0===i||null===(f=i[e])||void 0===f||null===(c=f.instances)||void 0===c?void 0:c[t]}getOrThrow(e,t){return Object(T.b)(this.get(e),t||`type ${e} not found`)}getOrUnknown(e){return this.get(e,!0)}getSignedExtensionExtra(){return hf(S(this,vd)[vd],"payload",S(this,wd)[wd])}getSignedExtensionTypes(){return hf(S(this,vd)[vd],"extrinsic",S(this,wd)[wd])}hasClass(e){return S(this,od)[od].has(e)}hasDef(e){return S(this,sd)[sd].has(e)}hasType(e){return!S(this,ld)[ld].get(e)&&(this.hasClass(e)||this.hasDef(e))}hash(e){return this.createType("CodecHash",S(this,bd)[bd](e))}register(e,t){Object(be.a)(e)?S(this,od)[od].set(e.name,e):Object(C.a)(e)?(Object(T.a)(Object(be.a)(t),()=>`Expected class definition passed to '${e}' registration`),Object(T.a)(e!==t.toString(),()=>`Unable to register circular ${e} === ${e}`),S(this,od)[od].set(e,t)):this._registerObject(e)}_registerObject(e){Object.entries(e).forEach(([e,t])=>{if(Object(be.a)(t))S(this,od)[od].set(e,t);else{const r=Object(C.a)(t)?t:H(t);Object(T.a)(e!==r,()=>`Unable to register circular ${e} === ${r}`),S(this,od)[od].has(e)&&S(this,od)[od].delete(e),S(this,sd)[sd].set(e,r)}})}setChainProperties(e){e&&(S(this,pd)[pd]=e)}setHasher(e){S(this,bd)[bd]=e||$i}setKnownTypes(e){S(this,gd)[gd]=e}setMetadata(e,t,r){!function(e,t,r){const n=On(e,t.asLatest,t.version);Object.values(n).forEach(e=>Object.values(e).forEach(e=>{r[Object(ve.a)(e.callIndex)]=e}))}(this,e,S(this,dd)[dd]),function(e,t,r){t.asLatest.modules.forEach((e,n)=>{const i=t.version>=12?e.index.toNumber():n,f=je(e.name);e.errors.forEach(({documentation:e,name:t},n)=>{const c=new Uint8Array([i,n]);r[Object(ve.a)(c)]={documentation:e.map(e=>e.toString()),index:n,method:t.toString(),name:t.toString(),section:f}})})}(0,e,S(this,ud)[ud]),function(e,t,r){t.asLatest.modules.filter(({events:e})=>e.isSome).forEach((n,i)=>{const f=t.version>=12?n.index.toNumber():i,c=je(n.name);n.events.unwrap().forEach((t,n)=>{const i=t.name.toString(),a=t.args.map(e=>fn(e));let o=null;const s=()=>(o||(o=a.map(t=>La(e,t))),o);r[Object(ve.a)(new Uint8Array([f,n]))]=class extends Pf{constructor(e,r){super(e,r,s(),a,t,c,i)}}})})}(this,e,S(this,hd)[hd]),this.setSignedExtensions(t||(e.asLatest.extrinsic.version.gt(Qt)?e.asLatest.extrinsic.signedExtensions.map(e=>e.toString()):uf),r),this.setChainProperties(function(e,t){var r;const n=e.getChainProperties(),i=null===(r=xn(e,t.asLatest,t.version).system)||void 0===r?void 0:r.ss58Prefix;if(!i)return n;const{tokenDecimals:f,tokenSymbol:c}=n||{};return e.createType("ChainProperties",{ss58Format:i,tokenDecimals:f,tokenSymbol:c})}(this,e))}setSignedExtensions(e=uf,t){S(this,vd)[vd]=e,S(this,wd)[wd]=t;const r=function(e,t={}){const r=[...Object.keys(df),...Object.keys(t)];return e.filter(e=>!r.includes(e))}(S(this,vd)[vd],S(this,wd)[wd]);r.length&&ad.warn(`Unknown signed extensions ${r.join(", ")} found, treating them as no-effect`)}}function Od(){return Ti.then(()=>Qi()).then(()=>!0).catch(e=>(console.error("Unable to initialize @polkadot/util-crypto",e),!1))}const xd=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"];function Sd(e){const t=e.map(e=>!!e);return{filtered:e.filter((e,r)=>t[r]),included:t,original:e}}function kd(e,t){let r=-1;return t.included.map(t=>t?e[++r]:null)}function jd(e,t){var r,n,i,f,c,a;const o=e.registry.createType("AccountId"),s=Sd([null===(r=e.consts.auctions)||void 0===r?void 0:r.leasePeriodsPerSlot,null===(n=e.consts.auctions)||void 0===n?void 0:n.slotRangeCount]),d=Sd([null===(i=e.query.staking)||void 0===i?void 0:i.storageVersion]),u=Sd([null===(f=e.query.session)||void 0===f?void 0:f.queuedKeys.key(),null===(c=e.query.system)||void 0===c||null===(a=c.account)||void 0===a?void 0:a.key(o)]);return Object(me.combineLatest)([s.filtered.length?t?Object(me.of)([]):Object(me.of)(s.filtered):Object(me.of)([]),d.filtered.length?t?Object(me.combineLatest)(d.filtered.map(e=>e.at(t))):e.queryMulti(d.filtered):Object(me.of)([]),u.filtered.length?t?Object(me.combineLatest)(u.filtered.map(r=>e.rpc.state.getStorage.raw(r,t))):Object(me.combineLatest)(u.filtered.map(t=>e.rpc.state.getStorage.raw(t))):Object(me.of)([])]).pipe(Object(ye.map)(([t,r,n])=>function({accountIdLength:e,refcount1Length:t,refcount2Length:r,refcount3Length:n},[i,f],[c],[a,o]){const s={};if(o){const e=o.length;e===t?s.AccountInfo="AccountInfoWithRefCount":e===r?s.AccountInfo="AccountInfoWithDualRefCount":e===n&&(s.AccountInfo="AccountInfoWithTripleRefCount")}if(c&&(c.index>=4?s.ValidatorPrefs="ValidatorPrefsWithBlocked":s.ValidatorPrefs="ValidatorPrefsWithCommission"),a)try{const[t,r]=Ef(a),n=(a.length-t)/r.toNumber(),i=n/e,f=Math.floor(i);Object(T.a)(i>=2&&i<=11,()=>`Detected ${i} in Keys, should be >= 2 and <= 11`),f!==i?(f-1)*e+33===n?s.Keys=`SessionKeys${f-1}B`:Object(T.a)(!1,()=>"Expected integer number of keys, found "+i.toFixed(2)):s.Keys="SessionKeys"+(i-1)}catch{}if(i&&f){const e=[];for(let t=0;i.gtn(t);t++)for(let r=t;i.gtn(r);r++)e.push(`${xd[t]}${xd[r]}`);s.SlotRange={_enum:e},s.WinningData=`[WinningDataEntry; ${f.toNumber()}]`}return s}({accountIdLength:o.encodedLength,refcount1Length:e.registry.createType("AccountInfoWithRefCount").encodedLength,refcount2Length:e.registry.createType("AccountInfoWithDualRefCount").encodedLength,refcount3Length:e.registry.createType("AccountInfoWithTripleRefCount").encodedLength},kd(t,s),kd(r,d),kd(n,u))),Object(ye.take)(1),Object(ye.catchError)(()=>Object(me.of)({})))}r(694);function Pd(e=1750){return t=>{let[r,n,i,f]=[0,0,me.Subscription.EMPTY,me.Subscription.EMPTY];return new me.Observable(c=>(t.subscribe(c),0==n++&&(1===r?f.unsubscribe():i=t.connect(),r=3),()=>{0==--n&&(2===r?(r=0,f.unsubscribe()):(r=1,f=me.asapScheduler.schedule(()=>{r=0,i.unsubscribe()},e)))}))}}const Ad=Object(E.a)("drr"),Ed=(e,t)=>H({t:e})===H({t:t}),Id=e=>{throw Ad.error(e.message),e},Td=()=>{},Rd=({delay:e,skipChange:t=!1,skipTimeout:r=!1}={})=>n=>n.pipe(Object(ye.catchError)(Id),t?Object(ye.tap)(Td):Object(ye.distinctUntilChanged)(Ed),Object(ye.publishReplay)(1),r?Object(ye.refCount)():Pd(e));function Nd(){return"none"}function _d(e,{getInstanceId:t=Nd}={}){const r={},n=(...n)=>{const i=H(n),f=t();return r[f]||(r[f]={}),Object(I.a)(r[f][i])&&(r[f][i]=e(...n)),r[f][i]};return n.unmemoize=(...e)=>{const n=H(e),i=t();r[i]&&!Object(I.a)(r[i][n])&&delete r[i][n]},n}function Cd(e,t){const r=_d((...e)=>new me.Observable(n=>{const i=t(...e).subscribe(n);return()=>{r.unmemoize(...e),i.unsubscribe()}}).pipe(Rd()),{getInstanceId:()=>e});return r}function Bd(e,t){return Cd(e,e=>function(e,t){const r=Object(Oe.a)(t)?t:Vc((t||"").toString());if(r.length>8)return Object(me.of)(e.registry.createType("AccountId",r));const n=e.registry.createType("AccountIndex",r);return e.derive.accounts.indexToId(n.toString()).pipe(Object(ye.map)(e=>Object(T.b)(e,"Unable to retrieve accountId")))}(t,e))}function Hd(e,t){return Cd(e,e=>{var r,n,i,f,c;const a=t.query.phragmenElection?"phragmenElection":t.query.electionsPhragmen?"electionsPhragmen":"elections";return Object(me.combineLatest)([e&&null!==(r=t.query[a])&&void 0!==r&&r.members?t.query[a].members():Object(me.of)(void 0),e&&null!==(n=t.query.council)&&void 0!==n&&n.members?t.query.council.members():Object(me.of)([]),e&&null!==(i=t.query.technicalCommittee)&&void 0!==i&&i.members?t.query.technicalCommittee.members():Object(me.of)([]),e&&null!==(f=t.query.society)&&void 0!==f&&f.members?t.query.society.members():Object(me.of)([]),e&&null!==(c=t.query.sudo)&&void 0!==c&&c.key?t.query.sudo.key():Object(me.of)(void 0)]).pipe(Object(ye.map)(t=>function(e,[t,r,n,i,f]){const c=t=>!!e&&t.toString()===e.toString();return{isCouncil:((null==t?void 0:t.map(([e])=>e))||r||[]).some(c),isSociety:(i||[]).some(c),isSudo:(null==f?void 0:f.toString())===(null==e?void 0:e.toString()),isTechCommittee:(n||[]).some(c)}}(e,t)))})}function Dd(e,t){return Cd(e,e=>function(e,t){try{const r=Object(Oe.a)(t)?t:Vc((t||"").toString());if(r.length>8){const t=e.registry.createType("AccountId",r);return e.derive.accounts.idToIndex(t).pipe(Object(ye.map)(e=>[t,e]))}const n=e.registry.createType("AccountIndex",r);return e.derive.accounts.indexToId(n.toString()).pipe(Object(ye.map)(e=>[e,n]))}catch(e){return Object(me.of)([void 0,void 0])}}(t,e))}function Ld(e,t){return Cd(e,e=>t.derive.accounts.indexes().pipe(Object(ye.map)(t=>(t||{})[e.toString()])))}const zd={toHex:()=>{}};function Vd(e){return e.isRaw?ri(e.asRaw.toU8a(!0)):e.isNone?void 0:e.toHex()}function qd(e,t){return Cd(e,e=>function(e,t){var r;return t&&null!==(r=e.query.identity)&&void 0!==r&&r.identityOf?e.queryMulti([[e.query.identity.identityOf,t],[e.query.identity.superOf,t]]):Object(me.of)([void 0,void 0])}(t,e).pipe(Object(ye.switchMap)(([e,r])=>function(e,t,r){if(null!=t&&t.isSome)return Object(me.of)([t,void 0]);if(null!=r&&r.isSome){const t=r.unwrap();return Object(me.combineLatest)([e.query.identity.identityOf(t[0]),Object(me.of)(t)])}return Object(me.of)([void 0,void 0])}(t,e,r)),Object(ye.map)(([e,t])=>function(e,t){if(null==e||!e.isSome)return{judgements:[]};const{info:r,judgements:n}=e.unwrap(),i=Vd(r.display);return{display:t&&Vd(t[1])||i,displayParent:t&&i,email:Vd(r.email),image:Vd(r.image),judgements:n,legal:Vd(r.legal),other:(f=r.additional,f.reduce((e,[t,r])=>{const n=Vd(t),i=Vd(r);return n&&i&&(e[n]=i),e},{})),parent:t&&t[0],pgp:r.pgpFingerprint.unwrapOr(zd).toHex(),riot:Vd(r.riot),twitter:Vd(r.twitter),web:Vd(r.web)};var f}(e,t))))}function Ud(e,t){return Cd(e,e=>t.derive.accounts.hasIdentityMulti([e]).pipe(Object(ye.map)(([e])=>e)))}function Fd(e,t){return Cd(e,e=>{var r;return null!==(r=t.query.identity)&&void 0!==r&&r.identityOf?Object(me.combineLatest)([t.query.identity.identityOf.multi(e),t.query.identity.superOf.multi(e)]).pipe(Object(ye.map)(([e,t])=>e.map((e,r)=>{const n=t[r],i=n&&n.isSome?n.unwrap()[0].toString():void 0;let f;if(e&&e.isSome){const t=Vd(e.unwrap().info.display);t&&!Object(Me.a)(t)&&(f=t)}return{display:f,hasIdentity:!(!f&&!i),parentId:i}}))):Object(me.of)(e.map(()=>({hasIdentity:!1})))})}function Wd(e,t){return Cd(e,e=>t.query.indices?t.query.indices.accounts(e).pipe(Object(ye.map)(e=>e.unwrapOr([])[0])):Object(me.of)(void 0))}let Kd=null;function Xd(e,t){return Cd(e,()=>Kd?Object(me.of)(Kd):(t.query.indices?function(e){return e.query.indices.accounts.entries().pipe(Object(ye.map)(e=>e.reduce((e,[t,r])=>(r.isSome&&(e[r.unwrap()[0].toString()]=t.args[0]),e),{})))}(t).pipe(Object(ye.startWith)({})):Object(me.of)({})).pipe(Object(ye.map)(e=>(Kd=e,e))))}function Zd(e,t){var r;return(t&&null!==(r=e.query.nicks)&&void 0!==r&&r.nameOf?e.query.nicks.nameOf(t):Object(me.of)(void 0)).pipe(Object(ye.map)(t=>null!=t&&t.isSome?ri(t.unwrap()[0]).substr(0,e.consts.nicks.maxLength.toNumber()):void 0))}function Gd(e,t){return Cd(e,e=>t.derive.accounts.idAndIndex(e).pipe(Object(ye.switchMap)(([e,r])=>Object(me.combineLatest)([Object(me.of)({accountId:e,accountIndex:r}),t.derive.accounts.identity(e),Zd(t,e)])),Object(ye.map)(([{accountId:e,accountIndex:t},r,n])=>({accountId:e,accountIndex:t,identity:r,nickname:n}))))}function Yd(...e){return function(e,t){return Object(T.a)(t.length>=1,"Must provide one or more BN arguments"),t.reduce((t,r)=>Je.a[e](t,r),t[0])}("max",e)}function Jd(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 Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jd(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $d(e,t,r,n){const{allLocked:i,lockedBalance:f,lockedBreakdown:c,vestingLocked:a}=function(e,t,r){let n=e.registry.createType("Balance"),i=[],f=e.registry.createType("Balance"),c=!1;if(Array.isArray(r)){i=r.filter(({until:e})=>!e||t&&e.gt(t)),c=i.some(({amount:e})=>e&&e.isMax()),f=e.registry.createType("Balance",i.filter(({id:e})=>e.eq("0x76657374696e6720")).reduce((e,{amount:t})=>e.iadd(t),new Je.a(0)));const a=i.filter(({amount:e})=>e&&!e.isMax());a.length&&(n=e.registry.createType("Balance",Yd(...a.map(({amount:e})=>e))))}return{allLocked:c,lockedBalance:n,lockedBreakdown:i,vestingLocked:f}}(e,t,n);return Qd(Qd({},r),{},{availableBalance:e.registry.createType("Balance",i?0:Yd(new Je.a(0),r.freeBalance.sub(f))),lockedBalance:f,lockedBreakdown:c,vestingLocked:a})}function eu(e,t){return e.queryMulti([[e.query.balances.locks,t],[e.query.balances.vesting,t]]).pipe(Object(ye.map)(([t,r])=>{let n=null;if(r.isSome){const{offset:t,perBlock:i,startingBlock:f}=r.unwrap();n=e.registry.createType("VestingInfo",{locked:t,perBlock:i,startingBlock:f})}return[n,[t]]}))}const tu=e=>!!e;function ru(e,t,r=["balances"]){var n;const i=r.map(t=>{var r,n;return(null===(r=e.derive[t])||void 0===r?void 0:r.customLocks)||(null===(n=e.query[t])||void 0===n?void 0:n.locks)}),f=i.map(e=>!e),c=i.filter(tu).map(e=>[e,t]);return(null!==(n=e.query.vesting)&&void 0!==n&&n.vesting?e.queryMulti([[e.query.vesting.vesting,t],...c]):c.length?e.queryMulti(c).pipe(Object(ye.map)(t=>[e.registry.createType("Option<VestingInfo>"),...t])):Object(me.of)([e.registry.createType("Option<VestingInfo>")])).pipe(Object(ye.map)(([t,...r])=>{let n=-1;return[t.unwrapOr(null),f.map(t=>t?e.registry.createType("Vec<BalanceLock>"):r[++n])]}))}function nu(e,t){const r=t.registry.getModuleInstances(t.runtimeVersion.specName.toString(),"balances");return Cd(e,e=>t.derive.balances.account(e).pipe(Object(ye.switchMap)(e=>{var n,i;return e.accountId.isEmpty?Object(me.of)([e,t.registry.createType("BlockNumber"),[null,[]]]):Object(me.combineLatest)([Object(me.of)(e),t.derive.chain.bestNumber(),Object(be.a)(null===(n=t.query.system)||void 0===n?void 0:n.account)||Object(be.a)(null===(i=t.query.balances)||void 0===i?void 0:i.account)?ru(t,e.accountId,r):eu(t,e.accountId)])}),Object(ye.map)(e=>function(e,[t,r,[n,i]]){const f=$d(e,r,t,i[0]),{locked:c,perBlock:a,startingBlock:o}=n||e.registry.createType("VestingInfo"),s=r.gt(o),d=s?a.mul(r.sub(o)):new Je.a(0),u=d.gt(c)?c:e.registry.createType("Balance",d),h=s&&!f.vestingLocked.isZero();return Qd(Qd({},f),{},{accountId:t.accountId,accountNonce:t.accountNonce,additional:i.filter((e,t)=>0!==t).map((n,i)=>$d(e,r,t.additional[i],n)),isVesting:h,vestedBalance:u,vestedClaimable:e.registry.createType("Balance",h?f.vestingLocked.sub(c.sub(u)):0),vestingEndBlock:e.registry.createType("BlockNumber",h?c.div(a).add(o):0),vestingPerBlock:a,vestingTotal:c})}(t,e))))}function iu(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 fu(e){return e.registry.createType("Balance")}function cu(e,[t,r,n,i]){const f=e.registry.createType("Balance",t.toBn());return{freeBalance:t,frozenFee:n,frozenMisc:i,reservedBalance:r,votingBalance:f}}function au(e,[t,[r,n]]){const i=n[0];return Object(T.a)(i,"No balances retrieved for account"),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iu(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({accountId:t,accountNonce:r,additional:n.filter((e,t)=>0!==t).map(t=>cu(e,t))},cu(e,i))}function ou(e,t){return e.queryMulti([[e.query.balances.freeBalance,t],[e.query.balances.reservedBalance,t],[e.query.system.accountNonce,t]]).pipe(Object(ye.map)(([t,r,n])=>[n,[[t,r,fu(e),fu(e)]]]))}function su(e,t){return e.query.system.accountNonce(t).pipe(Object(ye.map)(t=>[t,[[fu(e),fu(e),fu(e),fu(e)]]]))}function du(e,t,r=["balances"]){const n=r.map(r=>{var n;return[(null===(n=e.derive[r])||void 0===n?void 0:n.customAccount)||e.query[r].account,t]}),i=e=>e.map(({feeFrozen:e,free:t,miscFrozen:r,reserved:n})=>[t,n,e,r]);return Object(be.a)(e.query.system.account)?e.queryMulti([[e.query.system.account,t],...n]).pipe(Object(ye.map)(([{nonce:e},...t])=>[e,i(t)])):e.queryMulti([[e.query.system.accountNonce,t],...n]).pipe(Object(ye.map)(([e,...t])=>[e,i(t)]))}function uu(e,t){return e.query.system.account(t).pipe(Object(ye.map)(t=>{const r=t.nonce?t.data:t[1],n=t.nonce||t[0];if(!r||r.isEmpty)return[n,[[fu(e),fu(e),fu(e),fu(e)]]];const{feeFrozen:i,free:f,miscFrozen:c,reserved:a}=r;return[n,[[f,a,i,c]]]}))}function hu(e,t){const r=t.registry.getModuleInstances(t.runtimeVersion.specName.toString(),"balances"),n=[t.registry.createType("Index"),[[fu(t),fu(t),fu(t),fu(t)]]];return Cd(e,e=>t.derive.accounts.accountId(e).pipe(Object(ye.switchMap)(e=>{var i,f,c,a;return e?Object(me.combineLatest)([Object(me.of)(e),r?du(t,e,r):Object(be.a)(null===(i=t.query.system)||void 0===i?void 0:i.account)?uu(t,e):Object(be.a)(null===(f=t.query.balances)||void 0===f?void 0:f.account)?du(t,e):Object(be.a)(null===(c=t.query.balances)||void 0===c?void 0:c.freeBalance)?ou(t,e):Object(be.a)(null===(a=t.query.system)||void 0===a?void 0:a.accountNonce)?su(t,e):Object(me.of)(n)]):Object(me.of)([t.registry.createType("AccountId"),n])}),Object(ye.map)(e=>au(t,e))))}function lu(e,t){return Cd(e,()=>{var e,r,n,i,f;return Object(me.of)([(null===(e=t.consts.balances)||void 0===e?void 0:e.creationFee)||t.registry.createType("Balance"),(null===(r=t.consts.balances)||void 0===r?void 0:r.transferFee)||t.registry.createType("Balance"),(null===(n=t.consts.balances)||void 0===n?void 0:n.existentialDeposit)||t.registry.createType("Balance"),(null===(i=t.consts.transactionPayment)||void 0===i?void 0:i.transactionBaseFee)||t.registry.createType("Balance"),(null===(f=t.consts.transactionPayment)||void 0===f?void 0:f.transactionByteFee)||t.registry.createType("Balance")]).pipe(Object(ye.map)(([e,t,r,n,i])=>({creationFee:e,existentialDeposit:r,transactionBaseFee:n,transactionByteFee:i,transferFee:t})))})}function pu(e,t){return Cd(e,e=>e&&e.length?Object(me.combineLatest)(e.map(e=>t.derive.balances.account(e))):Object(me.of)([]))}const bu=nu;function mu(e,t){const r=e.tx.bounties?e.tx.bounties:e.tx.treasury,n=[r.approveBounty,r.closeBounty,r.proposeCurator,r.unassignCurator];return t.filter(e=>n.find(t=>t.is(e.proposal)))}function yu([e,t,r,n]){const i=[];return e.forEach((e,f)=>{e.isSome&&i.push({bounty:e.unwrap(),description:t[f].unwrapOrDefault().toUtf8(),index:r[f],proposals:n.filter(e=>r[f].eq(e.proposal.args[0]))})}),i}function gu(e,t){const r=t.query.bounties||t.query.treasury;return Cd(e,()=>Object(me.combineLatest)([r.bountyCount(),t.query.council?t.query.council.proposalCount():Object(me.of)(0)]).pipe(Object(ye.switchMap)(()=>Object(me.combineLatest)([r.bounties.keys(),t.derive.council?t.derive.council.proposals():Object(me.of)([])])),Object(ye.switchMap)(([e,n])=>{const i=e.map(({args:[e]})=>e);return Object(me.combineLatest)([r.bounties.multi(i),r.bountyDescriptions.multi(i),Object(me.of)(i),Object(me.of)(mu(t,n))])}),Object(ye.map)(yu)))}function vu(e,t){return Cd(e,()=>t.derive.chain.subscribeNewHeads().pipe(Object(ye.map)(e=>e.number.unwrap())))}function wu(e,t){return Cd(e,()=>t.rpc.chain.subscribeFinalizedHeads().pipe(Object(ye.map)(e=>e.number.unwrap())))}function Mu(e,t){return Cd(e,()=>Object(me.combineLatest)([t.derive.chain.bestNumber(),t.derive.chain.bestNumberFinalized()]).pipe(Object(ye.map)(([e,r])=>t.registry.createType("BlockNumber",e.sub(r)))))}function Ou(e,t=[]){const[r]=e.logs.filter(({type:e})=>"Consensus"===e),[n]=e.logs.filter(({type:e})=>"PreRuntime"===e),[i]=e.logs.filter(({type:e})=>"Seal"===e);let f;if(n)try{const[e,r]=n.asPreRuntime;f=e.extractAuthor(r,t)}catch{}if(!f&&r)try{const[e,n]=r.asConsensus;f=e.extractAuthor(n,t)}catch{}if(!f&&i)try{const[e,r]=i.asSeal;f=e.extractAuthor(r,t)}catch{}return f}function xu(e,t,r){const n=e.createClass("Header");var i=j("author"),f=j("validators");return new class extends n{constructor(e,t,r){super(e,t),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),S(this,i)[i]=Ou(this.digest,r),S(this,f)[f]=r,this.createdAtHash=null==t?void 0:t.createdAtHash}get author(){return S(this,i)[i]}get validators(){return S(this,f)[f]}}(e,t,r)}function Su(e,t){return Cd(e,e=>Object(me.combineLatest)([t.rpc.chain.getHeader(e),t.query.session?t.query.session.validators.at(e):Object(me.of)([])]).pipe(Object(ye.map)(([e,t])=>xu(e.registry,e,t)),Object(ye.catchError)(()=>Object(me.of)())))}function ku(e,t,r,n){const i=e.createClass("SignedBlock");var f=j("author"),c=j("events"),a=j("extrinsics");return new class extends i{constructor(e,t,r,n){var i,o;super(e,t),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),S(this,f)[f]=Ou(this.block.header.digest,n),S(this,c)[c]=r||[],S(this,a)[a]=(i=this.block.extrinsics,o=S(this,c)[c],i.map((e,t)=>{let r,n;const i=o.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eq(t)).map(({event:e})=>("system"===e.section&&("ExtrinsicSuccess"===e.method?n=e.data[0]:"ExtrinsicFailed"===e.method&&(r=e.data[0],n=e.data[1])),e));return{dispatchError:r,dispatchInfo:n,events:i,extrinsic:e}})),this.createdAtHash=null==t?void 0:t.createdAtHash}get author(){return S(this,f)[f]}get events(){return S(this,c)[c]}get extrinsics(){return S(this,a)[a]}}(e,t,r,n)}function ju(e,t){return Cd(e,e=>Object(me.combineLatest)([t.rpc.chain.getBlock(e),t.query.system.events.at(e),t.query.session?t.query.session.validators.at(e):Object(me.of)([])]).pipe(Object(ye.map)(([e,r,n])=>ku(t.registry,e,r,n)),Object(ye.catchError)(()=>Object(me.of)())))}function Pu(e,t){return Cd(e,()=>t.derive.chain.subscribeNewHeads().pipe(Object(ye.switchMap)(e=>{const r=e.createdAtHash||e.hash;return Object(me.combineLatest)(t.rpc.chain.getBlock(r),t.query.system.events.at(r),Object(me.of)(e))}),Object(ye.map)(([e,t,r])=>ku(e.registry,e,t,r.validators))))}function Au(e,t){return Cd(e,()=>Object(me.combineLatest)([t.rpc.chain.subscribeNewHeads(),t.query.session?t.query.session.validators():Object(me.of)(void 0)]).pipe(Object(ye.map)(([e,t])=>(e.createdAtHash=e.hash,xu(e.registry,e,t)))))}function Eu(e,t){return Cd(e,()=>function(e){return Object(me.of)([e.consts.contracts.callBaseFee||e.registry.createType("Balance"),e.consts.contracts.contractFee||e.registry.createType("Balance"),e.consts.contracts.creationFee||e.registry.createType("Balance"),e.consts.contracts.transactionBaseFee||e.registry.createType("Balance"),e.consts.contracts.transactionByteFee||e.registry.createType("Balance"),e.consts.contracts.transferFee||e.registry.createType("Balance"),e.consts.contracts.rentByteFee,e.consts.contracts.rentDepositOffset,e.consts.contracts.surchargeReward,e.consts.contracts.tombstoneDeposit])}(t).pipe(Object(ye.map)(([e,t,r,n,i,f,c,a,o,s])=>({callBaseFee:e,contractFee:t,creationFee:r,rentByteFee:c,rentDepositOffset:a,surchargeReward:o,tombstoneDeposit:s,transactionBaseFee:n,transactionByteFee:i,transferFee:f}))))}function Iu(e,t){const r=e.registry.getModuleInstances(e.runtimeVersion.specName.toString(),t);return r&&r.length?r[0]:t}function Tu(e,t,r){const n=Iu(t,r);return Cd(e,()=>{var e;return Object(be.a)(null===(e=t.query[n])||void 0===e?void 0:e.members)?t.query[n].members():Object(me.of)([])})}function Ru(e,t){return Cd(e,Tu(e,t,"council"))}function Nu(e,t,r){const n=Iu(t,r);return Cd(e,()=>{var e;return Object(be.a)(null===(e=t.query[n])||void 0===e?void 0:e.prime)?t.query[n].prime().pipe(Object(ye.map)(e=>e.unwrapOr(null))):Object(me.of)(null)})}function _u(e,t){return Cd(e,Nu(e,t,"council"))}function Cu(e,t,r){return Cd(e,e=>{var n;return(Object(be.a)(null===(n=t.query[r])||void 0===n?void 0:n.proposals)&&e.length?Object(me.combineLatest)([Object(me.of)(e),Object(me.combineLatest)(e.map(e=>t.query[r].proposalOf(e).pipe(Object(ye.catchError)(()=>Object(me.of)(null))))),t.query[r].voting.multi(e)]):Object(me.of)([[],[],[]])).pipe(Object(ye.map)(e=>function(e,[t,r,n]){return r.map((r,i)=>r&&r.isSome?{hash:e.registry.createType("Hash",t[i]),proposal:r.unwrap(),votes:n[i].unwrapOr(null)}:null).filter(e=>!!e)}(t,e)))})}function Bu(e,t,r){const n=Iu(t,r);return Cd(e,()=>{var e;return Object(me.of)(Object(be.a)(null===(e=t.query[n])||void 0===e?void 0:e.proposals))})}function Hu(e,t,r){const n=Iu(t,r);return Cd(e,()=>Object(be.a)(t.query[n].proposalCount)?t.query[n].proposalCount():Object(me.of)(null))}function Du(e,t,r){const n=Iu(t,r);return Cd(e,()=>{var e;return Object(be.a)(null===(e=t.query[n])||void 0===e?void 0:e.proposals)?t.query[n].proposals():Object(me.of)([])})}function Lu(e,t,r){const n=Cu(e,t,Iu(t,r)),i=Du(e,t,r);return Cd(e,()=>i().pipe(Object(ye.switchMap)(n)))}function zu(e,t,r){const n=Iu(t,r),i=Cu(e,t,n);return Cd(e,e=>{var r;return Object(be.a)(null===(r=t.query[n])||void 0===r?void 0:r.proposals)?i([e]).pipe(Object(ye.map)(([e])=>e)):Object(me.of)(null)})}function Vu(e,t){return Cd(e,Bu(e,t,"council"))}function qu(e,t){return Cd(e,zu(e,t,"council"))}function Uu(e,t){return Cd(e,Hu(e,t,"council"))}function Fu(e,t){return Cd(e,Du(e,t,"council"))}function Wu(e,t){return Cd(e,Lu(e,t,"council"))}function Ku(e){return!Array.isArray(e)}function Xu(e){return e.stakeOf.entries().pipe(Object(ye.map)(e=>e.map(([{args:[e]},t])=>[e,t])))}function Zu(e){return e.votesOf.entries().pipe(Object(ye.map)(e=>e.map(([{args:[e]},t])=>[e,t])))}function Gu(e,t){const r=t.query.phragmenElection||t.query.electionsPhragmen||t.query.elections;return Cd(e,()=>r?r.stakeOf?function(e,t){return Object(me.combineLatest)([Xu(t),Zu(t)]).pipe(Object(ye.map)(([t,r])=>{const n=[];return r.forEach(([t,r])=>{n.push([t,{stake:e.registry.createType("Balance"),votes:r}])}),t.forEach(([e,t])=>{const r=n.find(([t])=>t.eq(e));r?r[1].stake=t:n.push([e,{stake:t,votes:[]}])}),n}))}(t,r):function(e){return e.voting.entries().pipe(Object(ye.map)(e=>e.map(([{args:[e]},t])=>[e,Ku(t)?{stake:t.stake,votes:t.votes}:{stake:t[0],votes:t[1]}])))}(r):Object(me.of)([]))}function Yu(e,t){return Cd(e,e=>t.derive.council.votes().pipe(Object(ye.map)(r=>(r.find(([t])=>t.eq(e))||[null,{stake:t.registry.createType("Balance"),votes:[]}])[1])))}function Ju(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 Qu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ju(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const $u=(eh="democrac",Object(ve.a)(Object(ni.a)(eh)));var eh;function th(e){return function(e){return e.derive.democracy.referendumsFinished().pipe(Object(ye.switchMap)(()=>e.query.scheduler.agenda.keys()),Object(ye.switchMap)(t=>{const r=t.map(({args:[e]})=>e);return Object(me.combineLatest)([Object(me.of)(r),e.query.scheduler.agenda.multi(r)])}))}(e).pipe(Object(ye.switchMap)(([t,r])=>{const n=[];return t.forEach((t,i)=>{r[i].filter(e=>e.isSome).forEach(r=>{const i=r.unwrap();if(i.maybeId.isSome){const r=i.maybeId.unwrap().toHex();if(r.startsWith($u)){const[,f]=e.registry.createType("(u64, ReferendumIndex)",r),c=i.call.args[0];n.push({at:t,imageHash:c,index:f})}}})}),Object(me.combineLatest)([Object(me.of)(n),e.derive.democracy.preimages(n.map(({imageHash:e})=>e))])}),Object(ye.map)(([e,t])=>e.map((e,r)=>Qu(Qu({},e),{},{image:t[r]}))))}function rh(e,t){return Cd(e,()=>{var e;return Object(be.a)(null===(e=t.query.scheduler)||void 0===e?void 0:e.agenda)?th(t):t.query.democracy.dispatchQueue?function(e){return e.query.democracy.dispatchQueue().pipe(Object(ye.switchMap)(t=>Object(me.combineLatest)([Object(me.of)(t),e.derive.democracy.preimages(t.map(([,e])=>e))])),Object(ye.map)(([e,t])=>e.map(([e,r,n],i)=>({at:e,image:t[i],imageHash:r,index:n}))))}(t):Object(me.of)([])})}const nh=[0,1,2,4,8,16,32];function ih(e,[t,r],n){const{balance:i,vote:f}=r.asStandard,[c,a]=n.isFinished?function(e,t,{approved:r,end:n}){return[n,r.isTrue&&t.isAye||r.isFalse&&t.isNay?n.add(e.consts.democracy.enactmentPeriod.muln(nh[t.conviction.index])):Qt]}(e,f,n.asFinished):[Qt,Qt];return{balance:i,isDelegated:!1,isFinished:n.isFinished,referendumEnd:c,referendumId:t,unlockAt:a,vote:f}}function fh(e,t){return Cd(e,e=>t.query.democracy.votingOf?t.query.democracy.votingOf(e).pipe(Object(ye.switchMap)(e=>e.isDirect?function(e,{votes:t}){return t.length?e.query.democracy.referendumInfoOf.multi(t.map(([e])=>e)).pipe(Object(ye.map)(r=>t.map((e,t)=>[e,r[t].unwrapOr(null)]).filter(e=>!!e[1]&&Object(I.a)(e[1].end)&&e[0][1].isStandard).map(([t,r])=>ih(e,t,r)))):Object(me.of)([])}(t,e.asDirect):e.isDelegating?function(e,{balance:t,conviction:r,target:n}){return e.derive.democracy.locks(n).pipe(Object(ye.map)(n=>n.map(({isFinished:n,referendumEnd:i,referendumId:f,unlockAt:c,vote:a})=>({balance:t,isDelegated:!0,isFinished:n,referendumEnd:i,referendumId:f,unlockAt:c.isZero()?c:i.add(e.consts.democracy.enactmentPeriod.muln(nh[r.index])),vote:e.registry.createType("Vote",{aye:a.isAye,conviction:r})}))))}(t,e.asDelegating):Object(me.of)([]))):Object(me.of)([]))}function ch(e,t){return Cd(e,()=>{var e;return null!==(e=t.query.democracy)&&void 0!==e&&e.nextExternal?t.query.democracy.nextExternal().pipe(Object(ye.switchMap)(e=>function(e,t){if(t.isNone)return Object(me.of)(null);const[r,n]=t.unwrap();return e.derive.democracy.preimage(r).pipe(Object(ye.map)(e=>({image:e,imageHash:r,threshold:n})))}(t,e))):Object(me.of)(null)})}const ah=new Je.a(94906265);function oh(e){const t=tt(e);if(Object(T.a)(t.gte(Qt),"square root of negative numbers is not supported"),t.lte(ar))return new Je.a(Math.floor(Math.sqrt(t.toNumber())));let r=ah.clone();for(;;){const e=t.div(r).iadd(r).ishrn(1);if(r.eq(e)||r.eq(e.sub($t)))return r;r=e}}function sh(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 dh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sh(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uh(e,t,r,n){for(;;){const i=e.div(t),f=r.div(n);if(i.lt(f))return!0;if(f.lt(i))return!1;const c=e.mod(t),a=r.mod(n);if(a.isZero())return!1;if(c.isZero())return!0;e=n,r=t,t=a,n=c}}function hh(e,t,r){return e.isSimplemajority?r.votedAye.gt(r.votedNay):function(e,t,{votedAye:r,votedNay:n,votedTotal:i}){const f=oh(i);return!f.isZero()&&(e.isSupermajorityapproval?uh(n,f,r,t):uh(n,t,r,f))}(e,t,r)}function lh(e,t,r){const n=t.status.tally?function(e,t){const r=[],n=[];return t.forEach(e=>{e.vote.isAye?r.push(e):n.push(e)}),{allAye:r,allNay:n,voteCount:r.length+n.length,voteCountAye:r.length,voteCountNay:n.length,votedAye:e.ayes,votedNay:e.nays,votedTotal:e.turnout}}(t.status.tally,r):r.reduce((e,t)=>{const{balance:r,vote:n}=t,i=0===n.conviction.index,f=r.muln(i?1:n.conviction.index).divn(i?10:1);return n.isAye?(e.allAye.push(t),e.voteCountAye++,e.votedAye.iadd(f)):(e.allNay.push(t),e.voteCountNay++,e.votedNay.iadd(f)),e.voteCount++,e.votedTotal.iadd(f),e},{allAye:[],allNay:[],voteCount:0,voteCountAye:0,voteCountNay:0,votedAye:new Je.a(0),votedNay:new Je.a(0),votedTotal:new Je.a(0)});return dh(dh({},n),{},{isPassing:hh(t.status.threshold,e,n),votes:r})}function ph(e,[t,r,n,i]){let f;try{f=e.registry.createType("Proposal",t.toU8a(!0))}catch(e){console.error(e)}return{at:i,balance:n,proposal:f,proposer:r}}function bh(e,t){if(!t.isNone){if(function(e,t){return!!t&&!e.query.democracy.dispatchQueue}(e,t)){const r=t.unwrap();if(r.isMissing)return;const{data:n,deposit:i,provider:f,since:c}=r.asAvailable;return ph(e,[n,f,i,c])}return ph(e,t.unwrap())}}function mh(e,t){return Cd(e,e=>t.query.democracy.preimages(e).pipe(Object(ye.map)(e=>bh(t,e))))}function yh(e,t){return Cd(e,e=>t.query.democracy.preimages.multi(e).pipe(Object(ye.map)(e=>e.map(e=>bh(t,e)))))}function gh(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 vh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gh(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wh([e,t,r]){return e.filter(([,,e],t)=>{var n;return!(null===(n=r[t])||void 0===n||!n.isSome||e.isEmpty)}).map(([e,n,i],f)=>{const c=r[f].unwrap();return vh(vh({},function(e){return Object(be.a)(e[1].mul)}(c)?{balance:c[1],seconds:c[0]}:{balance:c[0],seconds:c[1]}),{},{image:t[f],imageHash:n,index:e,proposer:i})})}function Mh(e,t){return Cd(e,()=>{var e,r;return Object(be.a)(null===(e=t.query.democracy)||void 0===e?void 0:e.publicProps)&&Object(be.a)(null===(r=t.query.democracy)||void 0===r?void 0:r.preimages)?t.query.democracy.publicProps().pipe(Object(ye.switchMap)(e=>Object(me.combineLatest)([Object(me.of)(e),t.derive.democracy.preimages(e.map(([,e])=>e)),t.query.democracy.depositOf.multi(e.map(([e])=>e))])),Object(ye.map)(wh)):Object(me.of)([])})}function Oh(e,t){return Cd(e,()=>{var e;return null!==(e=t.query.democracy)&&void 0!==e&&e.lowestUnbaked?t.queryMulti([t.query.democracy.lowestUnbaked,t.query.democracy.referendumCount]).pipe(Object(ye.map)(([e,t])=>t.gt(e)?[...Array(t.sub(e).toNumber())].map((t,r)=>e.addn(r)):[])):Object(me.of)([])})}function xh(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 Sh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xh(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kh(e,t){return Cd(e,()=>t.derive.democracy.referendumsActive().pipe(Object(ye.switchMap)(e=>Object(me.combineLatest)([Object(me.of)(e),t.derive.democracy._referendumsVotes(e)])),Object(ye.map)(([e,t])=>e.map((e,r)=>Sh(Sh({},e),t[r])))))}function jh(e,t){return Cd(e,()=>t.derive.democracy.referendumIds().pipe(Object(ye.switchMap)(e=>e.length?t.derive.democracy.referendumsInfo(e):Object(me.of)([]))))}function Ph(e,t){return Cd(e,()=>t.derive.democracy.referendumIds().pipe(Object(ye.switchMap)(e=>t.query.democracy.referendumInfoOf.multi(e)),Object(ye.map)(e=>e.filter(e=>e.isSome).map(e=>e.unwrap()).filter(e=>e.isFinished).map(e=>e.asFinished))))}function Ah(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 Eh(e,t){return e.query.democracy.votersFor(t).pipe(Object(ye.switchMap)(r=>Object(me.combineLatest)([Object(me.of)(r),r.length?e.query.democracy.voteOf.multi(r.map(e=>[t,e])):Object(me.of)([]),e.derive.balances.votingBalances(r)])),Object(ye.map)(([t,r,n])=>t.map((t,i)=>({accountId:t,balance:n[i].votingBalance||e.registry.createType("Balance"),isDelegating:!1,vote:r[i]||e.registry.createType("Vote")}))))}function Ih(e,t){return e.filter(([,e])=>e.isDirect).map(([e,r])=>[e,r.asDirect.votes.filter(([e])=>e.eq(t))]).filter(([,e])=>!!e.length).reduce((e,[t,r])=>r.reduce((e,[,r])=>(r.isStandard&&e.push(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ah(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ah(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({accountId:t,isDelegating:!1},r.asStandard)),e),e),[])}function Th(e,t){return e.query.democracy.votingOf.entries().pipe(Object(ye.map)(r=>{const n=r.map(([{args:[e]},t])=>[e,t]),i=Ih(n,t),f=n.filter(([,e])=>e.isDelegating).map(([e,t])=>[e,t.asDelegating]);return f.forEach(([t,{balance:r,conviction:n,target:c}])=>{const a=f.find(([e])=>e.eq(c)),o=i.find(({accountId:e})=>e.eq(a?a[0]:c));o&&i.push({accountId:t,balance:r,isDelegating:!0,vote:e.registry.createType("Vote",{aye:o.vote.isAye,conviction:n})})}),i}))}function Rh(e,t){return Cd(e,e=>Object(me.combineLatest)([t.derive.democracy.sqrtElectorate(),Object(be.a)(t.query.democracy.votingOf)?Th(t,e.index):Eh(t,e.index)]).pipe(Object(ye.map)(([t,r])=>lh(t,e,r))))}function Nh(e,t){return Cd(e,e=>e.length?Object(me.combineLatest)(e.map(e=>t.derive.democracy._referendumVotes(e))):Object(me.of)([]))}function _h(e,t){return Cd(e,(e,r)=>{const n=function(e){if(e.isNone)return null;const t=e.unwrap();return function(e){return!!e.proposalHash}(t)?t:t.isOngoing?t.asOngoing:null}(r);return n?t.query.democracy.preimages(n.proposalHash).pipe(Object(ye.map)(r=>({image:bh(t,r),imageHash:n.proposalHash,index:t.registry.createType("ReferendumIndex",e),status:n}))):Object(me.of)(null)})}function Ch(e,t){return Cd(e,e=>e.length?t.query.democracy.referendumInfoOf.multi(e).pipe(Object(ye.switchMap)(r=>Object(me.combineLatest)(e.map((e,n)=>t.derive.democracy._referendumInfo(e,r[n])))),Object(ye.map)(e=>e.filter(e=>!!e))):Object(me.of)([]))}function Bh(e,t){return Cd(e,()=>t.query.balances.totalIssuance().pipe(Object(ye.map)(e=>oh(e))))}function Hh(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 Dh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hh(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lh(e){return function(e){return!Array.isArray(e)}(e)?[e.who,e.stake]:e}function zh(e){return function(e){return Array.isArray(e)}(e)?e[0]:e}function Vh([,e],[,t]){return t.cmp(e)}function qh(e,t){return Cd(e,()=>function(e){const t=e.query.phragmenElection?"phragmenElection":e.query.electionsPhragmen?"electionsPhragmen":e.query.elections?"elections":null,[r]=e.registry.getModuleInstances(e.runtimeVersion.specName.toString(),"council")||["council"];return(t?e.queryMulti([e.query[r].members,e.query[t].candidates,e.query[t].members,e.query[t].runnersUp]):Object(me.combineLatest)([e.query[r].members(),Object(me.of)([]),Object(me.of)([]),Object(me.of)([])])).pipe(Object(ye.map)(([r,n,i,f])=>Dh(Dh({},t?{candidacyBond:e.consts[t].candidacyBond,desiredRunnersUp:e.consts[t].desiredRunnersUp,desiredSeats:e.consts[t].desiredMembers,termDuration:e.consts[t].termDuration,votingBond:e.consts[t].votingBond}:{}),{},{candidateCount:e.registry.createType("u32",n.length),candidates:n.map(zh),members:i.length?i.map(Lh).sort(Vh):r.map(t=>[t,e.registry.createType("Balance")]),runnersUp:f.map(Lh).sort(Vh)})))}(t))}function Uh([e,t,r,n]){return t.forEach((t,i)=>{const f=t.toString(),c=n[i],a=!r[i].isEmpty,o=e[f];o&&o.hasMessage===a&&o.blockCount.eq(c)||(e[f]={blockCount:c,hasMessage:a,isOnline:a||c.gt(Qt)})}),e}function Fh(e,t){return Cd(e,()=>{var e;return null!==(e=t.query.imOnline)&&void 0!==e&&e.receivedHeartbeats?t.derive.staking.overview().pipe(Object(ye.switchMap)(({currentIndex:e,validators:r})=>Object(me.combineLatest)([Object(me.of)({}),Object(me.of)(r),t.query.imOnline.receivedHeartbeats.multi(r.map((t,r)=>[e,r])),t.query.imOnline.authoredBlocks.multi(r.map(t=>[e,t]))])),Object(ye.map)(Uh)):Object(me.of)({})})}function Wh(e,t){return Cd(e,Tu(e,t,"membership"))}function Kh(e,t){return Cd(e,Nu(e,t,"membership"))}function Xh(e,t){return Cd(e,Bu(e,t,"membership"))}function Zh(e,t){return Cd(e,zu(e,t,"membership"))}function Gh(e,t){return Cd(e,Hu(e,t,"membership"))}function Yh(e,t){return Cd(e,Du(e,t,"membership"))}function Jh(e,t){return Cd(e,Lu(e,t,"membership"))}function Qh(e,t){return!!e.isSome&&e.unwrap().some(e=>e.eq(t))}function $h(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 el(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$h(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tl(e,t){const r=t.find(([t])=>t===e);if(r&&r[1].isSome){const[e,t]=r[1].unwrap();return el({collatorId:e},t.isWithRetries?{isRetriable:!0,retries:t.asWithRetries.toNumber()}:{isRetriable:!1,retries:0})}return null}function rl(e,t){return t.map(t=>{const r=t.find(([t])=>t===e);return r?r[1]:null})}function nl(e,t){return Cd(e,e=>t.query.registrar&&t.query.parachains?t.queryMulti([t.query.registrar.active,t.query.registrar.retryQueue,t.query.registrar.selectedThreads,t.query.parachains.didUpdate,[t.query.registrar.paras,e],[t.query.registrar.pendingSwap,e],[t.query.parachains.heads,e],[t.query.parachains.relayDispatchQueue,e]]).pipe(Object(ye.map)(r=>function(e,[t,r,n,i,f,c,a,o]){return f.isNone?null:{active:tl(e,t),didUpdate:Qh(i,e),heads:a,id:e,info:el({id:e},f.unwrap()),pendingSwapId:c.unwrapOr(null),relayDispatchQueue:o,retryCollators:rl(e,r),selectedCollators:rl(e,n)}}(t.registry.createType("ParaId",e),r))):Object(me.of)(null))}function il(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 fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?il(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):il(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cl([e,t,r,n,i]){return e.map((e,f)=>({didUpdate:Qh(t,e),id:e,info:fl({id:e},r[f].unwrapOr(null)),pendingSwapId:n[f].unwrapOr(null),relayDispatchQueueSize:i[f][0].toNumber()}))}function al(e,t){return Cd(e,()=>{var e;return null!==(e=t.query.registrar)&&void 0!==e&&e.parachains&&t.query.parachains?t.query.registrar.parachains().pipe(Object(ye.switchMap)(e=>Object(me.combineLatest)([Object(me.of)(e),t.query.parachains.didUpdate(),t.query.registrar.paras.multi(e),t.query.registrar.pendingSwap.multi(e),t.query.parachains.relayDispatchQueueSize.multi(e)])),Object(ye.map)(cl)):Object(me.of)([])})}function ol(e,t){return Cd(e,()=>t.derive.session.info().pipe(Object(ye.map)(e=>e.eraLength)))}function sl(e,t){return Cd(e,()=>t.derive.session.progress().pipe(Object(ye.map)(e=>e.eraProgress)))}function dl([e,t,r,n,i]){return{activeEra:t,activeEraStart:r,currentEra:n,currentIndex:e,validatorCount:i}}function ul(e,t){return Cd(e,()=>t.query.session?t.query.staking?function(e){return e.queryMulti([e.query.session.currentIndex,e.query.staking.activeEra,e.query.staking.currentEra,e.query.staking.validatorCount]).pipe(Object(ye.map)(([e,t,r,n])=>{const{index:i,start:f}=t.unwrapOrDefault();return dl([e,i,f,r.unwrapOrDefault(),n])}))}(t):function(e){return e.query.session.currentIndex().pipe(Object(ye.map)(t=>dl([t,e.registry.createType("EraIndex"),e.registry.createType("Option<Moment>"),e.registry.createType("EraIndex"),e.registry.createType("u32")])))}(t):function(e){return Object(me.of)(dl([e.registry.createType("SessionIndex",1),e.registry.createType("EraIndex"),e.registry.createType("Option<Moment>"),e.registry.createType("EraIndex"),e.registry.createType("u32")]))}(t))}function hl(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 ll(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hl(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pl(e,t){return Cd(e,()=>t.derive.session.indexes().pipe(Object(ye.map)(e=>{var r,n,i,f;const c=(null===(r=t.consts)||void 0===r||null===(n=r.babe)||void 0===n?void 0:n.epochDuration)||t.registry.createType("u64",1),a=(null===(i=t.consts)||void 0===i||null===(f=i.staking)||void 0===f?void 0:f.sessionsPerEra)||t.registry.createType("SessionIndex",1);return ll(ll({},e),{},{eraLength:t.registry.createType("BlockNumber",a.mul(c)),isEpoch:!!t.query.babe,sessionLength:c,sessionsPerEra:a})})))}function bl(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 ml(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bl(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yl(e,t){return Cd(e,()=>t.query.babe?function(e){return e.derive.session.info().pipe(Object(ye.switchMap)(t=>{var r;return Object(me.combineLatest)([Object(me.of)(t),null!==(r=e.query.staking)&&void 0!==r&&r.erasStartSessionIndex?e.queryMulti([e.query.babe.currentSlot,e.query.babe.epochIndex,e.query.babe.genesisSlot,[e.query.staking.erasStartSessionIndex,t.activeEra]]):e.queryMulti([e.query.babe.currentSlot,e.query.babe.epochIndex,e.query.babe.genesisSlot])])}),Object(ye.map)(([t,[r,n,i,f]])=>[t,[r,n,i,f&&f.isSome?f.unwrap():e.registry.createType("SessionIndex",1)]]))}(t).pipe(Object(ye.map)(([e,r])=>function(e,t,[r,n,i,f]){const c=n.mul(t.sessionLength).iadd(i),a=r.sub(c),o=t.currentIndex.sub(f).imul(t.sessionLength).iadd(a);return ml(ml({},t),{},{eraProgress:e.registry.createType("BlockNumber",o),sessionProgress:e.registry.createType("BlockNumber",a)})}(t,e,r))):function(e){return e.derive.session.info().pipe(Object(ye.map)(t=>ml(ml({},t),{},{eraProgress:e.registry.createType("BlockNumber"),sessionProgress:e.registry.createType("BlockNumber")})))}(t))}function gl(e,t){return Cd(e,()=>t.derive.session.progress().pipe(Object(ye.map)(e=>e.sessionProgress)))}function vl(e,t){return Cd(e,()=>t.query.society.candidates().pipe(Object(ye.switchMap)(e=>Object(me.combineLatest)([Object(me.of)(e),t.query.society.suspendedCandidates.multi(e.map(({who:e})=>e))])),Object(ye.map)(([e,t])=>e.map(({kind:e,value:r,who:n},i)=>({accountId:n,isSuspended:t[i].isSome,kind:e,value:r})))))}function wl(e,t){return Cd(e,()=>t.queryMulti([t.query.society.bids,t.query.society.defender,t.query.society.founder,t.query.society.head,t.query.society.maxMembers,t.query.society.pot]).pipe(Object(ye.map)(([e,t,r,n,i,f])=>({bids:e,defender:t.unwrapOr(void 0),founder:r.unwrapOr(void 0),hasDefender:t.isSome&&n.isSome&&!n.eq(t)||!1,head:n.unwrapOr(void 0),maxMembers:i,pot:f}))))}function Ml(e,t){return Cd(e,e=>t.derive.society._members([e]).pipe(Object(ye.map)(([e])=>e)))}function Ol(e,t){return Cd(e,e=>Object(me.combineLatest)([Object(me.of)(e),t.query.society.payouts.multi(e),t.query.society.strikes.multi(e),t.query.society.defenderVotes.multi(e),t.query.society.suspendedMembers.multi(e),t.query.society.vouching.multi(e)]).pipe(Object(ye.map)(([e,t,r,n,i,f])=>e.map((e,c)=>({accountId:e,isDefenderVoter:n[c].isSome,isSuspended:i[c].isTrue,payouts:t[c],strikes:r[c],vote:n[c].unwrapOr(void 0),vouching:f[c].unwrapOr(void 0)})))))}function xl(e,t){return Cd(e,()=>t.query.society.members().pipe(Object(ye.switchMap)(e=>t.derive.society._members(e))))}function Sl(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 kl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const jl={withDestination:!0,withLedger:!0,withNominations:!0,withPrefs:!0};function Pl(e,t,r){const n=Object.entries((i=((null==t?void 0:t.unlocking)||[]).filter(({era:e})=>e.unwrap().gt(r.activeEra)),i.reduce((e,{era:t,value:r})=>{const n=t.toString();return e[n]=(e[n]||Qt).add(r.unwrap()),e},{}))).map(([t,n])=>({remainingEras:new Je.a(t).isub(r.activeEra),value:e.registry.createType("Balance",n)}));var i;return n.length?n:void 0}function Al(e,t,r){return e.registry.createType("Balance",((null==t?void 0:t.unlocking)||[]).reduce((e,{era:t,value:n})=>r.activeEra.gte(t.unwrap())?e.iadd(n.unwrap()):e,new Je.a(0)))}function El(e,t){return Cd(e,e=>t.derive.session.info().pipe(Object(ye.switchMap)(r=>Object(me.combineLatest)([t.derive.staking.keysMulti(e),t.derive.staking.queryMulti(e,jl)]).pipe(Object(ye.map)(([e,n])=>n.map((n,i)=>function(e,t,r,n){return kl(kl(kl({},r),n),{},{redeemable:Al(e,n.stakingLedger,t),unlocking:Pl(e,n.stakingLedger,t)})}(t,r,e[i],n)))))))}function Il(e,t){return Cd(e,e=>t.derive.staking.accounts([e]).pipe(Object(ye.map)(([e])=>e)))}function Tl(e,t){return Cd(e,()=>t.derive.session.indexes().pipe(Object(ye.switchMap)(({activeEra:e})=>t.query.staking.erasRewardPoints(e))))}new Map;const Rl={del:()=>{},forEach:()=>{},get:()=>{},set:(e,t)=>t};let Nl;!function(e="",t){Nl=t?function(e,t){return{del:r=>t.del(`${e}${r}`),forEach:t.forEach,get:r=>{const n=`${e}${r}`,i=t.get(n);if(i)return i.x=Date.now(),t.set(n,i),i.v},set:(r,n)=>{t.set(`${e}${r}`,{v:n,x:Date.now()})}}}(`derive:${e}:`,t):Rl,t&&function(e){const t=Date.now(),r=[];e.forEach((e,{x:n})=>{t-n>6048e5&&r.push(e)}),r.forEach(t=>e.del(t))}(t)}();function _l(e,t){return Cd(e,(e,r)=>{const n="eraExposure-"+e.toString(),i=r?void 0:Nl.get(n);return i?Object(me.of)(i):t.query.staking.erasStakersClipped.entries(e).pipe(Object(ye.map)(t=>{const i=function(e,t){const r={},n={};return t.forEach(([e,t])=>{const i=e.args[1].toString();n[i]=t,t.others.forEach(({who:e},t)=>{const n=e.toString();r[n]=r[n]||[],r[n].push({validatorId:i,validatorIndex:t})})}),{era:e,nominators:r,validators:n}}(e,t);return!r&&Nl.set(n,i),i}))})}function Cl(e,t){return Cd(e,e=>t.derive.staking._eraExposure(e,!0))}function Bl(e,t){return Cd(e,(e,r)=>e.length?Object(me.combineLatest)(e.map(e=>t.derive.staking._eraExposure(e,r))):Object(me.of)([]))}function Hl(e,t){return Cd(e,(e=!1)=>t.derive.staking.erasHistoric(e).pipe(Object(ye.switchMap)(r=>t.derive.staking._erasExposure(r,e))))}function Dl(e,t){return Cd(e,e=>t.queryMulti([t.query.staking.activeEra,t.query.staking.historyDepth]).pipe(Object(ye.map)(([r,n])=>{const i=[],f=n.toNumber(),c=r.unwrapOrDefault().index;let a=c;for(;a.gte(Qt)&&i.length<f;)a===c&&!0!==e||i.push(t.registry.createType("EraIndex",a)),a=a.sub($t);return i.reverse()})))}function Ll(e,t){return e.filter(e=>!t.some(t=>e.eq(t.era)))}function zl({individual:e}){return[...e.entries()].filter(([,e])=>e.gt(Qt)).reduce((e,[t,r])=>(e[t.toString()]=r,e),{})}function Vl(e,t){return Cd(e,(e,r)=>{if(!e.length)return Object(me.of)([]);const n=r?[]:e.map(e=>Nl.get("eraPoints-"+e.toString())).filter(e=>!!e),i=Ll(e,n);return i.length?t.query.staking.erasRewardPoints.multi(i).pipe(Object(ye.map)(t=>{const f=function(e,t){return e.map((e,r)=>({era:e,eraPoints:t[r].total,validators:zl(t[r])}))}(i,t);return!r&&f.forEach(e=>Nl.set("eraPoints-"+e.era.toString(),e)),e.map(e=>n.find(t=>e.eq(t.era))||f.find(t=>e.eq(t.era)))})):Object(me.of)(n)})}function ql(e,t){return Cd(e,(e=!1)=>t.derive.staking.erasHistoric(e).pipe(Object(ye.switchMap)(r=>t.derive.staking._erasPoints(r,e))))}function Ul(e,t){return Cd(e,(e,r)=>{const n="eraPrefs-"+e.toString(),i=r?void 0:Nl.get(n);return i?Object(me.of)(i):t.query.staking.erasValidatorPrefs.entries(e).pipe(Object(ye.map)(t=>{const i=function(e,t){const r={};return t.forEach(([e,t])=>{r[e.args[1].toString()]=t}),{era:e,validators:r}}(e,t);return!r&&Nl.set(n,i),i}))})}function Fl(e,t){return Cd(e,e=>t.derive.staking._eraPrefs(e,!0))}function Wl(e,t){return Cd(e,(e,r)=>e.length?Object(me.combineLatest)(e.map(e=>t.derive.staking._eraPrefs(e,r))):Object(me.of)([]))}function Kl(e,t){return Cd(e,(e=!1)=>t.derive.staking.erasHistoric(e).pipe(Object(ye.switchMap)(r=>t.derive.staking._erasPrefs(r,e))))}function Xl(e,t){return Cd(e,(e,r)=>{if(!e.length)return Object(me.of)([]);const n=r?[]:e.map(e=>Nl.get("eraRewards-"+e.toString())).filter(e=>!!e),i=Ll(e,n);return i.length?t.query.staking.erasValidatorReward.multi(i).pipe(Object(ye.map)(t=>{const f=function(e,t){return e.map((e,r)=>({era:e,eraReward:t[r].unwrapOrDefault()}))}(i,t);return!r&&f.forEach(e=>Nl.set("eraRewards-"+e.era.toString(),e)),e.map(e=>n.find(t=>e.eq(t.era))||f.find(t=>e.eq(t.era)))})):Object(me.of)(n)})}function Zl(e,t){return Cd(e,(e=!1)=>t.derive.staking.erasHistoric(e).pipe(Object(ye.switchMap)(r=>t.derive.staking._erasRewards(r,e))))}function Gl(e,t){return Cd(e,(e,r)=>{const n="eraSlashes-"+e.toString(),i=r?void 0:Nl.get(n);return i?Object(me.of)(i):Object(me.combineLatest)([t.query.staking.nominatorSlashInEra.entries(e),t.query.staking.validatorSlashInEra.entries(e)]).pipe(Object(ye.map)(([t,i])=>{const f=function(e,t,r){const n={},i={};return t.forEach(([e,t])=>{n[e.args[1].toString()]=t.unwrap()}),r.forEach(([e,t])=>{i[e.args[1].toString()]=t.unwrapOrDefault()[1]}),{era:e,nominators:n,validators:i}}(e,t,i);return!r&&Nl.set(n,f),f}))})}function Yl(e,t){return Cd(e,e=>t.derive.staking._eraSlashes(e,!0))}function Jl(e,t){return Cd(e,(e,r)=>e.length?Object(me.combineLatest)(e.map(e=>t.derive.staking._eraSlashes(e,r))):Object(me.of)([]))}function Ql(e,t){return Cd(e,(e=!1)=>t.derive.staking.erasHistoric(e).pipe(Object(ye.switchMap)(r=>t.derive.staking._erasSlashes(r,e))))}function $l(e){const t=new Array(e.reduce((e,t)=>e+t.length,0));let r=-1;for(let n=0;n<e.length;n++){const i=e[n];for(let e=0;e<i.length;e++)t[++r]=i[e]}return t}const ep={withController:!0,withExposure:!0,withPrefs:!0};function tp(e,t){return Cd(e,(e=ep)=>t.derive.staking.validators().pipe(Object(ye.switchMap)(({nextElected:r,validators:n})=>t.derive.staking.queryMulti(function(e,t){return $l([e,t.filter(t=>!e.find(e=>e.eq(t)))])}(r,n),e).pipe(Object(ye.map)(e=>({info:e,nextElected:r,validators:n}))))))}function rp(e,t){return Cd(e,e=>t.derive.staking.keysMulti([e]).pipe(Object(ye.map)(([e])=>e)))}function np(e,t){return Cd(e,e=>e.length?t.query.session.queuedKeys().pipe(Object(ye.switchMap)(r=>{var n;return Object(me.combineLatest)([Object(me.of)(r),null!==(n=t.consts.session)&&void 0!==n&&n.dedupKeyPrefix?t.query.session.nextKeys.multi(e.map(e=>[t.consts.session.dedupKeyPrefix,e])):t.query.session.nextKeys.multi(e)])}),Object(ye.map)(([t,r])=>e.map((e,n)=>function(e,t,r){const n=(t.find(([t])=>t.eq(e))||[void 0,[]])[1];return{nextSessionIds:r.unwrapOr([]),sessionIds:n}}(e,t,r[n])))):Object(me.of)([]))}function ip(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 fp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ip(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cp(e,t){return Cd(e,()=>Object(me.combineLatest)([t.derive.session.indexes(),t.derive.staking.validators()]).pipe(Object(ye.map)(([e,{nextElected:t,validators:r}])=>fp(fp({},e),{},{nextElected:t,validators:r}))))}function ap(e,t){return Cd(e,(e,r,n)=>r.length?t.queryMulti([...r.map(r=>[t.query.staking.erasStakersClipped,[r,e]]),...r.map(r=>[t.query.staking.erasStakers,[r,e]])]).pipe(Object(ye.map)(e=>r.map((t,n)=>({clipped:e[n],era:t,exposure:e[r.length+n]})))):Object(me.of)([]))}function op(e,t){return Cd(e,(e,r)=>t.derive.staking._ownExposures(e,[r],!0).pipe(Object(ye.map)(([e])=>e)))}function sp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._ownExposures(e,n,r))))}function dp(e,t){return Cd(e,(e,r,n)=>r.length?t.queryMulti([...r.map(r=>[t.query.staking.validatorSlashInEra,[r,e]]),...r.map(r=>[t.query.staking.nominatorSlashInEra,[r,e]])]).pipe(Object(ye.map)(e=>r.map((t,n)=>({era:t,total:e[n].isSome?e[n].unwrap()[1]:e[n+r.length].unwrapOrDefault()})))):Object(me.of)([]))}function up(e,t){return Cd(e,(e,r)=>t.derive.staking._ownSlashes(e,[r],!0).pipe(Object(ye.map)(([e])=>e)))}function hp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._ownSlashes(e,n,r))))}function lp(e,t,r,n){return function(e,t,r,{withController:n,withDestination:i,withExposure:f,withLedger:c,withNominations:a,withPrefs:o}){const s=e.registry.createType("Option<Nominations>"),d=e.registry.createType("RewardDestination"),u=e.registry.createType("Exposure"),h=e.registry.createType("ValidatorPrefs");return Object(me.combineLatest)([n||c?e.query.staking.bonded.multi(t):Object(me.of)(t.map(()=>null)),a?e.query.staking.nominators.multi(t):Object(me.of)(t.map(()=>s)),i?e.query.staking.payee.multi(t):Object(me.of)(t.map(()=>d)),o?e.query.staking.validators.multi(t):Object(me.of)(t.map(()=>h)),f?e.query.staking.erasStakers.multi(t.map(e=>[r,e])):Object(me.of)(t.map(()=>u))])}(e,r,t,n).pipe(Object(ye.switchMap)(([t,i,f,c,a])=>function(e,t,{withLedger:r=!1}){const n=t.filter(e=>r&&!!e&&e.isSome).map(e=>e.unwrap()),i=e.registry.createType("Option<StakingLedger>");return(n.length?e.query.staking.ledger.multi(n):Object(me.of)([])).pipe(Object(ye.map)(e=>{let r=-1;return t.map(t=>t&&t.isSome&&e[++r]||i)}))}(e,t,n).pipe(Object(ye.map)(e=>r.map((r,n)=>function(e,t,r,n,i,f,c){return{accountId:e,controllerId:t&&t.unwrapOr(null),exposure:f,nominators:r.isSome?r.unwrap().targets:[],rewardDestination:n,stakingLedger:c.unwrapOrDefault(),stashId:e,validatorPrefs:i}}(r,t[n],i[n],f[n],c[n],a[n],e[n]))))))}function pp(e,t){return Cd(e,(e,r)=>t.derive.staking.queryMulti([e],r).pipe(Object(ye.map)(([e])=>e)))}function bp(e,t){return Cd(e,(e,r)=>e.length?t.derive.session.indexes().pipe(Object(ye.switchMap)(({activeEra:n})=>{const i=e.map(e=>t.registry.createType("AccountId",e));return lp(t,n,i,r)})):Object(me.of)([]))}function mp(e,t){return Cd(e,(e,r,n)=>{const i=e.map(e=>t.registry.createType("AccountId",e).toString());return t.derive.staking._erasExposure(r,n).pipe(Object(ye.map)(e=>i.map(t=>e.map(({era:e,nominators:r,validators:n})=>{const i=!!n[t],f={},c=r[t]||[];return i?f[t]=n[t]:c&&c.forEach(({validatorId:e})=>{f[e]=n[e]}),{era:e,isEmpty:!Object.keys(f).length,isValidator:i,nominating:c,validators:f}}))))})}function yp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._stakerExposures(e,n,r))))}function gp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.stakerExposures([e,r]).pipe(Object(ye.map)(([e])=>e)))}function vp(e,t){return Cd(e,(e,r,n)=>{const i=t.registry.createType("AccountId",e).toString();return t.derive.staking._erasPoints(r,n).pipe(Object(ye.map)(e=>e.map(({era:e,eraPoints:r,validators:n})=>({era:e,eraPoints:r,points:n[i]||t.registry.createType("RewardPoint")}))))})}function wp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._stakerPoints(e,n,r))))}function Mp(e,t){return Cd(e,(e,r,n)=>t.query.staking.erasValidatorPrefs.multi(r.map(t=>[t,e])).pipe(Object(ye.map)(e=>e.map((e,t)=>({era:r[t],validatorPrefs:e})))))}function Op(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._stakerPrefs(e,n,r))))}function xp(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 Sp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xp(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kp(e,t,{rewards:r,stakingLedger:n}){const i=e.filter(e=>!n.claimedRewards.some(t=>t.eq(e))),f=t.map(([e])=>e),c=t.map(([,e])=>e);return r.filter(({isEmpty:e})=>!e).filter(e=>!!i.some(t=>e.era.eq(t))&&(function(e,t,r){const n=[];Object.keys(r.validators).forEach(i=>{const f=e.indexOf(i);if(-1!==f){const e=t[f].stakingLedger;null!=e&&e.claimedRewards.some(e=>r.era.eq(e))&&n.push(i)}}),n.forEach(e=>{delete r.validators[e]})}(f,c,e),!0)).filter(({validators:e})=>0!==Object.keys(e).length).map(e=>Sp(Sp({},e),{},{nominators:e.nominating.filter(t=>e.validators[t.validatorId])}))}function jp(e,t){return Cd(e,(e,r)=>Object(me.combineLatest)([t.derive.staking._erasPoints(e,r),t.derive.staking._erasPrefs(e,r),t.derive.staking._erasRewards(e,r)]))}function Pp(e,t){return Cd(e,(e,r,n)=>Object(me.combineLatest)([t.derive.staking.queryMulti(e,{withLedger:!0}),t.derive.staking._stakerExposures(e,r,n),t.derive.staking._stakerRewardsEras(r,n)]).pipe(Object(ye.switchMap)(([e,i,f])=>{const c=e.map(({stakingLedger:e,stashId:r},n)=>r&&e?function(e,t,[r,n,i],f){return f.map(({era:f,isEmpty:c,isValidator:a,nominating:o,validators:s})=>{const{eraPoints:d,validators:u}=r.find(e=>e.era.eq(f))||{eraPoints:Qt,validators:{}},{eraReward:h}=i.find(e=>e.era.eq(f))||{eraReward:e.registry.createType("Balance")},{validators:l}=n.find(e=>e.era.eq(f))||{validators:{}},p={},b=t.toString();return Object.entries(s).forEach(([t,r])=>{var n,i;const f=u[t]||Qt,c=(null===(n=l[t])||void 0===n?void 0:n.commission.unwrap())||Qt,a=(null===(i=r.total)||void 0===i?void 0:i.unwrap())||Qt;let o,s=Qt;if(!(a.isZero()||f.isZero()||d.isZero())){s=h.mul(f).div(d);const e=c.mul(s).div(fr);let n;if(t===b)n=r.own.unwrap();else{const e=r.others.find(({who:e})=>e.eq(b));n=e?e.value.unwrap():Qt}o=s.sub(e).imul(n).div(a).iadd(t===b?e:Qt)}p[t]={total:e.registry.createType("Balance",s),value:e.registry.createType("Balance",o)}}),{era:f,eraReward:h,isEmpty:c,isValidator:a,nominating:o,validators:p}})}(t,r,f,i[n]):[]);if(n)return Object(me.of)(c);const[a,o]=c.reduce(([e,t],r)=>{const n=[];return t.push(n),r.forEach(({validators:t})=>Object.keys(t).forEach(t=>{n.includes(t)||(n.push(t),e.includes(t)||e.push(t))})),[e,t]},[[],[]]);return t.derive.staking.queryMulti(a,{withLedger:!0}).pipe(Object(ye.map)(t=>e.map(({stakingLedger:e},n)=>kp(r,o[n].map(e=>[e,t.find(t=>t.accountId.eq(e))]),{rewards:c[n],stakingLedger:e}))))})))}function Ap(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._stakerRewards([e],n,r)),Object(ye.map)(([e])=>e)))}function Ep(e,t){return Cd(e,(e,r)=>e.length&&r.length?t.derive.staking._stakerRewards(e,r,!1):Object(me.of)([]))}function Ip(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(r=>t.derive.staking.stakerRewardsMultiEras(e,r))))}function Tp(e,t){return Cd(e,(e,r,n)=>{const i=t.registry.createType("AccountId",e).toString();return t.derive.staking._erasSlashes(r,n).pipe(Object(ye.map)(e=>e.map(({era:e,nominators:r,validators:n})=>({era:e,total:r[i]||n[i]||t.registry.createType("Balance")}))))})}function Rp(e,t){return Cd(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe(Object(ye.switchMap)(n=>t.derive.staking._stakerSlashes(e,n,r))))}function Np(e,t){return Cd(e,()=>function(e){let t=Date.now();return e.query.system.events().pipe(Object(ye.map)(e=>(t=e.filter(({event:e,phase:t})=>{try{return t.isApplyExtrinsic&&"staking"===e.section&&"Bonded"===e.method}catch{return!1}})?Date.now():t,t)),Object(ye.startWith)(t),Rd({skipTimeout:!0}))}(t).pipe(Object(ye.switchMap)(()=>t.query.staking.validators.keys()),Object(ye.map)(e=>e.map(({args:[e]})=>e).filter(e=>e))))}function _p(e,t){return Cd(e,()=>t.query.staking.erasStakers?t.derive.session.indexes().pipe(Object(ye.switchMap)(({currentEra:e})=>t.query.staking.erasStakers.keys(e)),Object(ye.map)(e=>e.map(({args:[,e]})=>e))):t.query.staking.currentElected())}function Cp(e,t){return Cd(e,()=>Object(me.combineLatest)([t.query.session?t.query.session.validators():Object(me.of)([]),t.query.staking?t.derive.staking.nextElected():Object(me.of)([])]).pipe(Object(ye.map)(([e,t])=>({nextElected:t.length?t:e,validators:e}))))}const Bp={withController:!0,withPrefs:!0};function Hp(e,t){return Cd(e,(e=Bp)=>Object(me.combineLatest)([t.derive.staking.validators(),t.derive.staking.stashes()]).pipe(Object(ye.switchMap)(([{nextElected:r},n])=>{const i=r.map(e=>e.toString()),f=n.filter(e=>!i.includes(e.toString()));return t.derive.staking.queryMulti(f,e).pipe(Object(ye.map)(e=>({info:e,waiting:f})))})))}function Dp(e,t){return Cd(e,Tu(e,t,"technicalCommittee"))}function Lp(e,t){return Cd(e,Nu(e,t,"technicalCommittee"))}function zp(e,t){return Cd(e,Bu(e,t,"technicalCommittee"))}function Vp(e,t){return Cd(e,zu(e,t,"technicalCommittee"))}function qp(e,t){return Cd(e,Hu(e,t,"technicalCommittee"))}function Up(e,t){return Cd(e,Du(e,t,"technicalCommittee"))}function Fp(e,t){return Cd(e,Lu(e,t,"technicalCommittee"))}function Wp(e,t){return Cd(e,()=>t.query.treasury?Object(me.combineLatest)([t.query.treasury.proposalCount(),t.query.treasury.approvals()]).pipe(Object(ye.switchMap)(([e,r])=>function(e,t,r){const n=[],i=t.toNumber();for(let t=0;t<i;t++)r.some(e=>e.eqn(t))||n.push(e.registry.createType("ProposalIndex",t));const f=[...n,...r];return Object(me.combineLatest)([e.query.treasury.proposals.multi(f),e.derive.council?e.derive.council.proposals():Object(me.of)([])]).pipe(Object(ye.map)(([n,i])=>function(e,{allIds:t,allProposals:r,approvalIds:n,councilProposals:i,proposalCount:f}){const c=[],a=[],o=i.filter(({proposal:t})=>e.tx.treasury.approveProposal.is(t)||e.tx.treasury.rejectProposal.is(t));return t.forEach((e,t)=>{if(r[t].isSome){const i=o.filter(({proposal:t})=>e.eq(t.args[0])).sort((e,t)=>e.proposal.method.localeCompare(t.proposal.method)),f=n.some(t=>t.eq(e)),s={council:i,id:e,proposal:r[t].unwrap()};f?c.push(s):a.push(s)}}),{approvals:c,proposalCount:f,proposals:a}}(e,{allIds:f,allProposals:n,approvalIds:r,councilProposals:i,proposalCount:t})))}(t,e,r))):Object(me.of)({approvals:[],proposalCount:t.registry.createType("ProposalIndex"),proposals:[]}))}function Kp(e,t){return Cd(e,e=>Object(me.combineLatest)([t.query.system.events.at(e),t.rpc.chain.getBlock(e)]).pipe(Object(ye.map)(([e,t])=>({block:t,events:e}))))}const Xp=new Je.a(6e3),Zp=new Je.a(5),Gp=new Je.a(3e5);function Yp(e,t){return e.derive.balances.account(t).pipe(Object(ye.map)(({accountNonce:e})=>e))}function Jp(e,t){var r;return null!==(r=e.rpc.system)&&void 0!==r&&r.accountNextIndex?e.rpc.system.accountNextIndex(t):Yp(e,t)}function Qp(e){return Object(me.combineLatest)([e.rpc.chain.getHeader(),e.rpc.chain.getFinalizedHead()]).pipe(Object(ye.switchMap)(([t,r])=>t.parentHash.isEmpty?Object(me.of)([t,t]):Object(me.combineLatest)([e.rpc.chain.getHeader(t.parentHash),e.rpc.chain.getHeader(r)])),Object(ye.map)(([e,t])=>e.number.unwrap().sub(t.number.unwrap()).gt(Zp)?e:t))}function $p(e,t){return(e,r,n)=>Object(me.combineLatest)([Object(I.a)(r)?Yp(t,e):-1===r?Jp(t,e):Object(me.of)(t.registry.createType("Index",r)),Object(I.a)(n)||D(n)&&n>0?Qp(t):Object(me.of)(null)]).pipe(Object(ye.map)(([e,r])=>{var n,i,f,c;return{header:r,mortalLength:Math.min((null===(n=t.consts.system)||void 0===n||null===(i=n.blockHashCount)||void 0===i?void 0:i.toNumber())||250,Gp.div((null===(f=t.consts.babe)||void 0===f?void 0:f.expectedBlockTime)||(null===(c=t.consts.timestamp)||void 0===c?void 0:c.minimumPeriod.muln(2))||Xp).iadd(Zp).toNumber()),nonce:e}}))}function eb(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 tb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const rb={accounts:c,balances:a,bounties:o,chain:s,contracts:d,council:u,democracy:h,elections:l,imOnline:p,membership:b,parachains:m,session:y,society:g,staking:v,technicalCommittee:w,treasury:M,tx:O},nb={contracts:{instances:["contracts"]},council:{instances:["council"],withDetect:!0},democracy:{instances:["democracy"]},elections:{instances:["phragmenElection","electionsPhragmen","elections","council"],withDetect:!0},imOnline:{instances:["imOnline"]},membership:{instances:["membership"]},parachains:{instances:["parachains","registrar"]},session:{instances:["session"]},society:{instances:["society"]},staking:{instances:["staking"]},technicalCommittee:{instances:["technicalCommittee"],withDetect:!0},treasury:{instances:["treasury"]}};function ib(e,t,r){const n=Object.keys(t.query),i=t.runtimeVersion.specName.toString();return Object.keys(r).filter(e=>!nb[e]||nb[e].instances.some(e=>n.includes(e))||nb[e].withDetect&&nb[e].instances.some(e=>(t.registry.getModuleInstances(i,e)||[]).some(e=>n.includes(e)))).reduce((n,i)=>{const f=r[i];return n[i]=Object.keys(f).reduce((r,n)=>{const i=n,c=f[i](e,t);return r[i]=c,r},{}),n},{})}function fb(e,{modules:t},r){return t.reduce((e,{errors:t,index:n,name:i},f)=>{if(!t.length)return e;const c=r>=12?n.toNumber():f;return e[je(i)]=t.reduce((e,t,r)=>(e[t.name.toString()]={is:e=>function({error:e,index:t},r,n){return t.eq(r)&&e.eq(n)}(e,c,r),meta:t},e),{}),e},{})}function cb(e,{modules:t},r){return t.filter(({events:e})=>e.isSome).reduce((e,{events:t,index:n,name:i},f)=>{const c=r>=12?n.toNumber():f;return e[je(i)]=t.unwrap().reduce((e,t,r)=>(e[t.name.toString()]={is:e=>function(e,t,r){return e.index[0]===t&&e.index[1]===r}(e,c,r),meta:t},e),{}),e},{})}function ab(e){return e?e.charAt(0).toLowerCase()+e.slice(1):""}function ob(e){const[t,r]=Ef(e),n=t+r.toNumber();return[n,e.subarray(t,n)]}var sb=r(252),db=r.n(sb),ub=r(183),hb=r(713);function lb(e,t){return function(e,t){return Object(ub.a)(e)||Object(C.a)(e)?db.a.h64(e,t):db.a.h64(Object(hb.a)(e),t)}(e,t).toString(16)}function pb(e,t){return new Je.a(lb(e,t),16)}function bb(e,t=64,r=!1){const n=Math.ceil(t/64);if(Qi()&&!r)return Ji(Object(ge.a)(e),n);const i=new Uint8Array(Math.ceil(t/8));for(let t=0;t<n;t++)i.set(pb(e,t).toArray("le",8),8*t);return i}const mb=e=>bb(e,128),yb={Blake2_128:e=>$i(e,128),Blake2_128Concat:e=>Ae($i(e,128),Object(ge.a)(e)),Blake2_256:e=>$i(e,256),Identity:e=>Object(ge.a)(e),Twox128:e=>bb(e,128),Twox256:e=>bb(e,256),Twox64Concat:e=>Ae(bb(e,64),Object(ge.a)(e))};function gb(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 vb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wb(e,t,r,n,i){return Ae(bb(t.prefix,128),bb(t.method,128),...r.map((t,r)=>{return(f=n[r],yb[f.type]||mb)(e.createType(t.toString(),i[r]).toU8a());var f}))}function Mb(e,t,r,n,i){const{method:f,section:c}=t;return Object(T.a)(Array.isArray(i),()=>`Call to ${je(c||"unknown")}.${je(f||"unknown")} needs ${r.length} arguments, provided in tuple format`),Object(T.a)(i.filter(e=>!Object(I.a)(e)).length===r.length,()=>`Call to ${je(c||"unknown")}.${je(f||"unknown")} needs ${r.length} arguments, found [${i.join(", ")}]`),If(wb(e,t,r,n,i))}function Ob(e,t,r){const{meta:{type:n}}=t,i=function({meta:e,method:t,prefix:r,section:n},i){const f=i;return f.meta=e,f.method=ab(t),f.prefix=r,f.section=n,f.toJSON=()=>vb(vb({},e.toJSON()),{},{storage:{method:t,prefix:r,section:n}}),f}(t,i=>n.isPlain?r.skipHashing?If(Object(ge.a)(r.key)):Mb(e,t,[],[],[]):n.isMap?Mb(e,t,[n.asMap.key],[n.asMap.hasher],[i]):n.isDoubleMap?Mb(e,t,[n.asDoubleMap.key1,n.asDoubleMap.key2],[n.asDoubleMap.hasher,n.asDoubleMap.key2Hasher],i):Mb(e,t,n.asNMap.keyVec,n.asNMap.hashers,i));return(n.isMap||n.isDoubleMap||n.isNMap)&&function(e,t,r){const{meta:{type:n},method:i,section:f}=t;r.iterKey=function(e,{meta:{documentation:t,name:r,type:n},section:i},{method:f},c){const a=n.isMap?n.asMap.key:n.isDoubleMap?n.asDoubleMap.key1:n.asNMap.keyVec[0];return c.meta=e.createType("StorageEntryMetadataLatest",{documentation:t,fallback:e.createType("Bytes"),modifier:e.createType("StorageEntryModifierLatest",1),name:r,type:e.createType("StorageEntryTypeLatest",e.createType("Type",a),0)}),(...t)=>e.createType("StorageKey",c(...t),{method:f,section:i})}(e,t,r,(...r)=>{if(Object(T.a)(0===r.length||n.isDoubleMap&&1===r.length||n.isNMap&&r.length===n.asNMap.hashers.length-1,()=>`Iteration ${je(f||"unknown")}.${je(i||"unknown")} needs arguments to be one less than the full arguments, found [${r.join(", ")}]`),r.length){if(n.isDoubleMap)return new rf(e,wb(e,t,[n.asDoubleMap.key1],[n.asDoubleMap.hasher],r));if(n.isNMap){const i=[...n.asNMap.keyVec],f=[...n.asNMap.hashers];return i.pop(),f.pop(),new rf(e,wb(e,t,i,f,r))}}return new rf(e,wb(e,t,[],[],[]))})}(e,t,i),i.keyPrefix=(...e)=>i.iterKey&&i.iterKey(...e)||ob(i())[1],i}function xb(e,t,{documentation:r,type:n}){return i=>Ob(i,{meta:{documentation:i.createType("Vec<Text>",[r]),modifier:i.createType("StorageEntryModifierLatest",1),name:i.createType("Text",e),toJSON:()=>t,type:i.createType("StorageEntryTypeLatest",n,0)},method:e,prefix:"Substrate",section:"substrate"},{key:t,skipHashing:!0})}const Sb={changesTrieConfig:xb("changesTrieConfig",":changes_trie",{documentation:" Changes trie configuration is stored under this key.",type:"u32"}),childStorageKeyPrefix:xb("childStorageKeyPrefix",":child_storage:",{documentation:" Prefix of child storage keys.",type:"u32"}),code:xb("code",":code",{documentation:" Wasm code of the runtime.",type:"Bytes"}),extrinsicIndex:xb("extrinsicIndex",":extrinsic_index",{documentation:" Current extrinsic index (u32) is stored under this key.",type:"u32"}),heapPages:xb("heapPages",":heappages",{documentation:" Number of wasm linear memory pages required for execution of the runtime.",type:"u64"})};function kb(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 jb(e,{modules:t},r){return t.reduce((t,r)=>{if(r.storage.isNone)return t;const{name:n}=r,i=je(n),f=r.storage.unwrap(),c=f.prefix.toString();return t[i]=f.items.reduce((t,r)=>{const n=r.name.toString();return t[ab(n)]=Ob(e,{meta:r,method:n,prefix:c,section:i},{}),t},{}),t},function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},function(e){return{substrate:Object.entries(Sb).reduce((t,[r,n])=>(t[r]=n(e),t),{})}}(e)))}r(689);function Pb(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 Ab(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Eb={};Object.keys(f).filter(e=>0!==Object.keys(f[e].rpc||{}).length).forEach(e=>{Eb[e]={},Object.entries(f[e].rpc).forEach(([t,r])=>{const n=!!r.pubsub,i=r.aliasSection||e;Eb[i]||(Eb[i]={}),Eb[i][t]=Ab(Ab({},r),{},{isSubscription:n,jsonrpc:`${i}_${t}`,method:t,section:i})})});var Ib=Eb;function Tb(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 Rb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Nb=Object(E.a)("rpc-core"),_b={fallback:void 0,modifier:{isOptional:!0},type:{asMap:{linked:{isTrue:!1}},isMap:!1}};function Cb(e,{params:t,type:r},n){const i=t.map(({isOptional:e,name:t,type:r})=>`${t}${e?"?":""}: ${r}`).join(", ");Nb.error(`${e}(${i}): ${r}:: ${n.message}`)}function Bb(e){return["0x3a636f6465"].includes(e.toHex())}var Hb=j("instanceId"),Db=j("registryDefault"),Lb=j("getBlockRegistry"),zb=j("storageCache");class Vb{constructor(e,t,r,n={}){Object.defineProperty(this,Hb,{writable:!0,value:void 0}),Object.defineProperty(this,Db,{writable:!0,value:void 0}),Object.defineProperty(this,Lb,{writable:!0,value:void 0}),Object.defineProperty(this,zb,{writable:!0,value:new Map}),this.mapping=new Map,this.provider=void 0,this.sections=[],Object(T.a)(r&&Object(be.a)(r.send),"Expected Provider to API create"),S(this,Hb)[Hb]=e,S(this,Db)[Db]=t,this.provider=r;const i=Object.keys(Ib);this.sections.push(...i),this.addUserInterfaces(n)}get isConnected(){return this.provider.isConnected}connect(){return this.provider.connect()}disconnect(){return this.provider.disconnect()}setRegistrySwap(e){S(this,Lb)[Lb]=_d(e,{getInstanceId:()=>S(this,Hb)[Hb]})}addUserInterfaces(e){this.sections.push(...Object.keys(e).filter(e=>!this.sections.includes(e))),this.sections.forEach(t=>{var r;this[r=t]||(this[r]={});const n=this[t];Object.entries(Rb(Rb({},this._createInterface(t,Ib[t]||{})),this._createInterface(t,e[t]||{}))).forEach(([e,t])=>{n[e]||(n[e]=t)})})}_createInterface(e,t){return Object.entries(t).filter(([t,{endpoint:r}])=>!this.mapping.has(r||`${e}_${t}`)).reduce((r,[n,{endpoint:i}])=>{const f=t[n],c=!!f.pubsub,a=i||`${e}_${n}`;return this.mapping.set(a,Rb(Rb({},f),{},{isSubscription:c,jsonrpc:a,method:n,section:e})),r[n]=c?this._createMethodSubscribe(e,n,f):this._createMethodSend(e,n,f),r},{})}_memomize(e,t){const r=_d(e("scale"),{getInstanceId:()=>S(this,Hb)[Hb]});return r.json=e("json"),r.raw=e("raw"),r.meta=t,r}_createMethodSend(e,t,r){const n=r.endpoint||`${e}_${t}`,i=r.params.findIndex(({isHistoric:e})=>e);let f=null;const c=async(e,f)=>{const c=-1===i?null:f[i],{registry:a}="scale"===e&&c&&S(this,Lb)[Lb]?await S(this,Lb)[Lb](Object(ge.a)(c)):{registry:S(this,Db)[Db]},o=this._formatInputs(a,null,r,f),s=await this.provider.send(n,o.map(e=>e.toJSON()));return"scale"===e?this._formatOutput(a,c,t,r,o,s):a.createType("raw"===e?"Raw":"Json",s)};return f=this._memomize(e=>(...n)=>{const a="scale"===e&&-1!==i&&!!n[i];return new me.Observable(i=>(c(e,n).then(e=>{i.next(e),i.complete()}).catch(e=>{Cb(t,r,e),i.error(e),i.complete()}),()=>{var e;null===(e=f)||void 0===e||e.unmemoize(...n)})).pipe(Object(ye.publishReplay)(1),a?Pd():Object(ye.refCount)())},r),f}_createSubscriber({paramsJson:e,subName:t,subType:r,update:n},i){return new Promise((f,c)=>{this.provider.subscribe(r,t,e,n).then(f).catch(e=>{i(e),c(e)})})}_createMethodSubscribe(e,t,r){const[n,i,f]=r.pubsub,c=`${e}_${i}`,a=`${e}_${f}`,o=`${e}_${n}`;let s=null;return s=this._memomize(e=>(...n)=>new me.Observable(i=>{let f=Promise.resolve(null);const d=S(this,Db)[Db],u=e=>{Cb(t,r,e),i.error(e)};try{const a=this._formatInputs(d,null,r,n),s=a.map(e=>e.toJSON()),h=(n,f)=>{if(n)Cb(t,r,n);else try{i.next("scale"===e?this._formatOutput(d,null,t,r,a,f):d.createType("raw"===e?"Raw":"Json",f))}catch(n){i.error(n)}};f=this._createSubscriber({paramsJson:s,subName:c,subType:o,update:h},u)}catch(e){u(e)}return()=>{var e;null===(e=s)||void 0===e||e.unmemoize(...n),f.then(e=>R(e)?Promise.resolve(!1):this.provider.unsubscribe(o,a,e)).catch(e=>Cb(t,r,e))}}).pipe(Rd()),r),s}_formatInputs(e,t,r,n){const i=r.params.filter(({isOptional:e})=>!e).length,f=i===r.params.length?"":` (${r.params.length-i} optional)`;return Object(T.a)(n.length>=i&&n.length<=r.params.length,()=>`Expected ${r.params.length} parameters${f}, ${n.length} found instead`),n.map((n,i)=>id(e,r.params[i].type,[n],{blockHash:t}))}_formatOutput(e,t,r,n,i,f){if("StorageData"===n.type){const r=i[0];return this._formatStorageData(e,t,r,f)}if("StorageChangeSet"===n.type){const t=i[0];return t?this._formatStorageSet(e,f.block,t,f.changes):e.createType("StorageChangeSet",f)}if("Vec<StorageChangeSet>"===n.type){const t=f.map(({block:t,changes:r})=>[e.createType("Hash",t),this._formatStorageSet(e,t,i[0],r)]);return"queryStorageAt"===r?t[0][1]:t}return id(e,n.type,[f],{blockHash:t})}_formatStorageData(e,t,r,n){const i=R(n),f=i?null:Bb(r)?n:Object(ge.a)(n);return this._newType(e,t,r,f,i)}_formatStorageSet(e,t,r,n){const i=1!==r.length;return r.reduce((r,f,c)=>(r.push(this._formatStorageSetEntry(e,t,f,n,i,c)),r),[])}_formatStorageSetEntry(e,t,r,n,i,f){const c=r.toHex(),a=n.find(([e])=>e===c),o=Object(I.a)(a)?i&&S(this,zb)[zb].get(c)||null:a[1],s=R(o),d=s||Bb(r)?o:Object(ge.a)(o);return S(this,zb)[zb].set(c,o),this._newType(e,t,r,d,s,f)}_newType(e,t,r,n,i,f=-1){const c=r.outputType||"Raw",a=r.meta||_b,o=-1===f?"":` entry ${f}:`;try{if(a.modifier.isOptional){let r=null;i||(r=id(e,c,[n],{blockHash:t,isPedantic:!0}));const f=new va(e,Ta(e,c),r);return t&&(f.createdAtHash=e.createType("Hash",t)),f}return id(e,c,[i?a.fallback?Object(Pe.a)(a.fallback.toHex()):void 0:n],{blockHash:t,isPedantic:!0})}catch(e){throw new Error(`Unable to decode storage ${r.section||"unknown"}.${r.method||"unknown"}:${o}: ${e.message}`)}}}function qb(e,t){const r=Math.ceil(e.length/t),n=Array(r);for(let i=0;i<r;i++){const r=i*t;n[i]=e.slice(r,r+t)}return n}function Ub(e){return Object(be.a)(e.sign)}const Fb=Object(E.a)("api/util");function Wb(e,{block:{extrinsics:t,header:r}},n,i){const f=e.toHex(),c=t.map(e=>e.hash.toHex()),a=c.indexOf(f);if(-1!==a)return n.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eqn(a));i.isInBlock&&Fb.warn(`block ${r.hash.toHex()}: Unable to find extrinsic ${f} inside ${c.join(", ")}`)}const Kb=e=>e;function Xb(e,t,r,n){return e.filter(({event:e})=>t===e.section&&r.includes(e.method)).map(e=>n(e))}class Zb{constructor({dispatchError:e,dispatchInfo:t,events:r,internalError:n,status:i}){this.dispatchError=void 0,this.dispatchInfo=void 0,this.internalError=void 0,this.events=void 0,this.status=void 0,this.dispatchError=e||function(e=[]){return Xb(e,"system",["ExtrinsicFailed"],({event:{data:e}})=>e[0])[0]}(r),this.dispatchInfo=t||function(e=[]){return Xb(e,"system",["ExtrinsicFailed","ExtrinsicSuccess"],({event:{data:e,method:t}})=>"ExtrinsicSuccess"===t?e[0]:e[1])[0]}(r),this.events=r||[],this.internalError=n,this.status=i}get isCompleted(){return this.isError||this.status.isInBlock||this.status.isFinalized}get isError(){return this.status.isDropped||this.status.isFinalityTimeout||this.status.isInvalid||this.status.isUsurped}get isFinalized(){return this.status.isFinalized}get isInBlock(){return this.status.isInBlock}get isWarning(){return this.status.isRetracted}filterRecords(e,t){return Xb(this.events,e,Array.isArray(t)?t:[t],Kb)}findRecord(e,t){return this.filterRecords(e,t)[0]}toHuman(e){var t,r,n;return{dispatchError:null===(t=this.dispatchError)||void 0===t?void 0:t.toHuman(),dispatchInfo:null===(r=this.dispatchInfo)||void 0===r?void 0:r.toHuman(),events:this.events.map(t=>t.toHuman(e)),internalError:null===(n=this.internalError)||void 0===n?void 0:n.message.toString(),status:this.status.toHuman(e)}}}function Gb(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 Yb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gb(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Jb=e=>e;function Qb(e,t,r){const n=function({api:e,apiType:t,decorateMethod:r}){const n=e.registry.createClass("Extrinsic");var i=j("ignoreStatusCb"),f=j("transformResult"),c=j("makeEraOptions"),a=j("makeSignOptions"),o=j("makeSignAndSendOptions"),s=j("observeSign"),d=j("observeStatus"),u=j("observeSend"),h=j("observeSubscribe"),l=j("optionsOrNonce"),p=j("signViaSigner"),b=j("updateSigner");return class extends n{constructor(r,n){super(r,n,{version:e.extrinsicType}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:Jb}),Object.defineProperty(this,c,{writable:!0,value:(e,{header:t,mortalLength:r,nonce:n})=>t?S(this,a)[a](e,{blockHash:t.hash,era:this.registry.createType("ExtrinsicEra",{current:t.number,period:e.era||r}),nonce:n}):(D(e.era)&&(delete e.era,delete e.blockHash),S(this,a)[a](e,{nonce:n}))}),Object.defineProperty(this,a,{writable:!0,value:(t,r)=>Yb(Yb(Yb({blockHash:e.genesisHash,genesisHash:e.genesisHash},t),r),{},{runtimeVersion:e.runtimeVersion,signedExtensions:e.registry.signedExtensions,version:e.extrinsicType})}),Object.defineProperty(this,o,{writable:!0,value:(e,t)=>{let r={};return Object(be.a)(e)?t=e:r=Yb({},e),[r,t]}}),Object.defineProperty(this,s,{writable:!0,value:(t,r)=>{const n=Ub(t)?t.address:t.toString(),i=S(this,l)[l](r);let f;return e.derive.tx.signingInfo(n,i.nonce,i.era).pipe(Object(ye.first)(),Object(ye.mergeMap)(async e=>{const r=S(this,c)[c](i,e);Ub(t)?this.sign(t,r):f=await S(this,p)[p](n,r,e.header)}),Object(ye.mapTo)(f))}}),Object.defineProperty(this,d,{writable:!0,value:(t,r)=>{if(!r.isFinalized&&!r.isInBlock)return Object(me.of)(S(this,f)[f](new Zb({status:r})));const n=r.isInBlock?r.asInBlock:r.asFinalized;return e.derive.tx.events(n).pipe(Object(ye.map)(({block:e,events:n})=>S(this,f)[f](new Zb({events:Wb(t,e,n,r),status:r}))),Object(ye.catchError)(e=>Object(me.of)(S(this,f)[f](new Zb({internalError:e,status:r})))))}}),Object.defineProperty(this,u,{writable:!0,value:(t=-1)=>e.rpc.author.submitExtrinsic(this).pipe(Object(ye.tap)(e=>{S(this,b)[b](t,e)}))}),Object.defineProperty(this,h,{writable:!0,value:(t=-1)=>{const r=this.hash;return e.rpc.author.submitAndWatchExtrinsic(this).pipe(Object(ye.switchMap)(e=>S(this,d)[d](r,e)),Object(ye.tap)(e=>{S(this,b)[b](t,e)}))}}),Object.defineProperty(this,l,{writable:!0,value:(e={})=>Object(Tc.a)(e)||D(e)?{nonce:e}:e}),Object.defineProperty(this,p,{writable:!0,value:async(t,r,n)=>{const i=r.signer||e.signer;Object(T.a)(i,"No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.");const f=this.registry.createType("SignerPayload",Yb(Yb({},r),{},{address:t,blockNumber:n?n.number:0,method:this.method}));let c;if(i.signPayload)c=await i.signPayload(f.toPayload());else{if(!i.signRaw)throw new Error("Invalid signer interface, it should implement either signPayload or signRaw (or both)");c=await i.signRaw(f.toRaw())}return super.addSignature(t,c.signature,f.toPayload()),c.id}}),Object.defineProperty(this,b,{writable:!0,value:(t,r)=>{-1!==t&&e.signer&&e.signer.update&&e.signer.update(t,r)}}),S(this,i)[i]="rxjs"===t}dryRun(t,n){return Object(C.a)(n)||Object(Oe.a)(n)?r(()=>e.rpc.system.dryRun(this.toHex(),n)):r(()=>S(this,s)[s](t,n).pipe(Object(ye.switchMap)(()=>e.rpc.system.dryRun(this.toHex()))))()}paymentInfo(t,n){if(Object(C.a)(n)||Object(Oe.a)(n))return r(()=>e.rpc.payment.queryInfo(this.toHex(),n));const[i]=S(this,o)[o](n),f=Ub(t)?t.address:t.toString();return r(()=>e.derive.tx.signingInfo(f,i.nonce,i.era).pipe(Object(ye.first)(),Object(ye.switchMap)(t=>{const r=S(this,c)[c](i,t),n=S(this,a)[a](r,{});return this.signFake(f,n),e.rpc.payment.queryInfo(this.toHex())})))()}send(t){const n=e.hasSubscriptions&&(S(this,i)[i]||!!t);return r(n?S(this,h)[h]:S(this,u)[u])(t)}sign(e,t){return super.sign(e,S(this,a)[a](S(this,l)[l](t),{})),this}signAsync(e,t){return r(()=>S(this,s)[s](e,t).pipe(Object(ye.mapTo)(this)))()}signAndSend(t,n,f){const[c,a]=S(this,o)[o](n,f),d=e.hasSubscriptions&&(S(this,i)[i]||!!a);return r(()=>S(this,s)[s](t,c).pipe(Object(ye.switchMap)(e=>d?S(this,h)[h](e):S(this,u)[u](e))))(a)}withResultTransform(e){return S(this,f)[f]=e,this}}}({api:t,apiType:e,decorateMethod:r});return e=>new n(t.registry,e)}const $b=Object(E.a)("api/augment");function em(e,t,r=[]){return t.length?` ${t.length} ${e}${r.length?" and":""}`:""}function tm(e,t){return t.length?`\n\t${e.padStart(7)}: ${t.sort().join(", ")}`:""}function rm(e,t,[r,n]){(r.length||n.length)&&$b.warn(`api.${e}: Found${em("added",r,n)}${em("removed",n)} ${t}:${tm("added",r)}${tm("removed",n)}`)}function nm(e,t){return e.filter(e=>!t.includes(e))}function im(e,t){const[r,n]=function(e,t){return[Object.keys(e),Object.keys(t)]}(e,t);return[nm(r,n),nm(n,r)]}function fm(e,t){const r=Object.keys(e);return Object.keys(t).filter(e=>r.includes(e)).reduce((r,n)=>{const i=Object.keys(e[n]);return r.concat(...Object.keys(t[n]).filter(e=>!i.includes(e)).map(e=>`${n}.${e}`))},[])}function cm(e,t,r,n=!1){return n&&Object.keys(r).forEach(e=>{delete r[e]}),e&&Object.keys(r).length&&(rm(e,"modules",im(t,r)),rm(e,"calls",function(e,t){return[fm(t,e),fm(e,t)]}(t,r))),Object.keys(t).reduce((e,n)=>{const i=t[n];return e[n]=Object.keys(i).reduce((e,t)=>(e[t]||(e[t]=i[t]),e),r[n]||{}),e},r)}function am(e){return Object.keys(e)}function om(e,t){return am(e).reduce((r,n)=>(r[n]=function(e,t){return am(e).reduce((r,n)=>{const i=e[n];return r[n]=t(i),r},{})}(e[n],t),r),{})}function sm({method:e,section:t},r){return`${t}.${e}(${r.join(", ")})`}function dm(e,t){const r=t.filter(e=>!Object(I.a)(e));return e.meta.type.isDoubleMap?function(e,t){const{key1:r,key2:n}=e.meta.type.asDoubleMap;return Object(T.a)(2===t.length,()=>`${sm(e,[r,n])} is a double map, requiring 2 arguments, ${t.length} found`),[e,t]}(e,r):e.meta.type.isMap?function(e,t){const{key:r}=e.meta.type.asMap;return Object(T.a)(1===t.length,()=>`${sm(e,[r])} is a map, requiring 1 argument, ${t.length} found`),t.length?[e,t[0]]:[e]}(e,r):e.meta.type.isNMap?function(e,t){const{keyVec:r}=e.meta.type.asNMap;return Object(T.a)(t.length===r.length,()=>`${sm(e,r)} is a multi map, requiring ${r.length} arguments, ${t.length} found`),[e,t]}(e,r):(Object(T.a)(0===r.length,()=>`${sm(e,[])} does not take any arguments, ${r.length} found`),[e])}var um=j("eventemitter");function hm(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 lm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hm(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const pm=Object(E.a)("api/init");let bm=0;var mm=j("instanceId"),ym=j("registry");function gm(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 vm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gm(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wm=Object(E.a)("api/init");var Mm=j("healthTimer"),Om=j("registries"),xm=j("updateSub"),Sm=j("onProviderConnect"),km=j("onProviderDisconnect"),jm=j("onProviderError");function Pm(e){return Object(T.b)(e,"Api needs to be initialized before using, listen on 'ready'")}function Am(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 Em(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Am(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Am(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Im=j("allHasFired"),Tm=j("callback"),Rm=j("fired"),Nm=j("fns"),_m=j("isActive"),Cm=j("results"),Bm=j("subscriptions");class Hm{constructor(e,t){Object.defineProperty(this,Im,{writable:!0,value:!1}),Object.defineProperty(this,Tm,{writable:!0,value:void 0}),Object.defineProperty(this,Rm,{writable:!0,value:[]}),Object.defineProperty(this,Nm,{writable:!0,value:[]}),Object.defineProperty(this,_m,{writable:!0,value:!0}),Object.defineProperty(this,Cm,{writable:!0,value:[]}),Object.defineProperty(this,Bm,{writable:!0,value:[]}),S(this,Tm)[Tm]=t,S(this,Bm)[Bm]=e.map(async(e,t)=>{const[r,...n]=Array.isArray(e)?e:[e];return S(this,Rm)[Rm].push(!1),S(this,Nm)[Nm].push(r),r(...n,this._createCallback(t))})}_allHasFired(){var e;return(e=S(this,Im))[Im]||(e[Im]=0===S(this,Rm)[Rm].filter(e=>!e).length),S(this,Im)[Im]}_createCallback(e){return t=>{S(this,Rm)[Rm][e]=!0,S(this,Cm)[Cm][e]=t,this._triggerUpdate()}}_triggerUpdate(){if(S(this,_m)[_m]&&Object(be.a)(S(this,Tm)[Tm])&&this._allHasFired())try{S(this,Tm)[Tm](S(this,Cm)[Cm])}catch(e){}}unsubscribe(){S(this,_m)[_m]&&(S(this,_m)[_m]=!1,S(this,Bm)[Bm].forEach(async e=>{try{const t=await e;Object(be.a)(t)&&t()}catch(e){}}))}}function Dm(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 Lm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dm(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zm(e,t){let r=!1;return{reject:e=>(r||(r=!0,t(e)),me.EMPTY),resolve:t=>{r||(r=!0,e(t))}}}function Vm(e,t){const r=t&&t.methodName&&t.methodName.includes("subscribe");return function(...n){const[i,f]=function(e,t){let r;const n=e.slice();return e.length&&Object(be.a)(e[e.length-1])&&(r=n.pop()),Object(T.a)(!t||Object(be.a)(r),"Expected a callback to be passed with subscriptions"),[n,r]}(n,!!r);return f?function(e,t,r){return new Promise((n,i)=>{const f=zm(n,i),c=e(...t).pipe(Object(ye.catchError)(e=>f.reject(e)),Object(ye.tap)(()=>f.resolve(()=>c.unsubscribe()))).subscribe(e=>{setTimeout(()=>r(e),0)})})}(e,i,f):function(e,t){return new Promise((r,n)=>{const i=zm(r,n),f=e(...t).pipe(Object(ye.catchError)(e=>i.reject(e))).subscribe(e=>{i.resolve(e),setTimeout(()=>f.unsubscribe(),0)})})}((null==t?void 0:t.overrideNoSub)||e,i)}}var qm,Um=j("isReadyPromise"),Fm=j("isReadyOrErrorPromise");class Wm extends class extends class extends class extends class extends class{constructor(){Object.defineProperty(this,um,{writable:!0,value:new A.a})}emit(e,...t){return S(this,um)[um].emit(e,...t)}on(e,t){return S(this,um)[um].on(e,t),this}off(e,t){return S(this,um)[um].removeListener(e,t),this}once(e,t){return S(this,um)[um].once(e,t),this}}{constructor(e,t,r){var n;super(),Object.defineProperty(this,mm,{writable:!0,value:void 0}),Object.defineProperty(this,ym,{writable:!0,value:void 0}),this.__phantom=new Je.a(0),this._consts={},this._derive=void 0,this._errors={},this._events={},this._extrinsics=void 0,this._extrinsicType=4,this._genesisHash=void 0,this._isConnected=void 0,this._isReady=!1,this._options=void 0,this._query={},this._queryMulti=void 0,this._rpc=void 0,this._rpcCore=void 0,this._runtimeChain=void 0,this._runtimeMetadata=void 0,this._runtimeVersion=void 0,this._rx={consts:{},query:{},tx:{}},this._type=void 0,this._decorateMethod=void 0,this._rxDecorateMethod=e=>e,S(this,mm)[mm]=""+ ++bm,S(this,ym)[ym]=(null===(n=e.source)||void 0===n?void 0:n.registry)||e.registry||new Md,this._rx.registry=S(this,ym)[ym];const i=e.source?e.source._rpcCore.provider.clone():e.provider||new pe;this._decorateMethod=r,this._options=e,this._type=t,this._rpcCore=new Vb(S(this,mm)[mm],S(this,ym)[ym],i,this._options.rpc),this._isConnected=new me.BehaviorSubject(this._rpcCore.provider.isConnected),this._rx.hasSubscriptions=this._rpcCore.provider.hasSubscriptions}get registry(){return S(this,ym)[ym]}createType(e,...t){return S(this,ym)[ym].createType(e,...t)}registerTypes(e){e&&S(this,ym)[ym].register(e)}get hasSubscriptions(){return this._rpcCore.provider.hasSubscriptions}get supportMulti(){return this._rpcCore.provider.hasSubscriptions||!!this._rpcCore.state.queryStorageAt}_injectDecorated(e,t,r){const n=function(e,t){Object(T.a)(t instanceof Mn,"You need to pass a valid Metadata instance to Decorated");const r=t.asLatest,n=t.version;return{consts:xn(e,r),errors:fb(0,r,n),events:cb(0,r,n),query:jb(e,r),tx:On(e,r,n)}}(e.registry,e.metadata);!t&&e.decoration||(e.decoration={consts:{},errors:{},events:{},query:{}}),cm("consts",n.consts,e.decoration.consts,t),cm("errors",n.errors,e.decoration.errors,t),cm("events",n.events,e.decoration.events,t);return cm("query",r?this._decorateStorageAt(n,this._decorateMethod,r):this._decorateStorage(n,this._decorateMethod),e.decoration.query,t),{decoratedApi:e.decoration,decoratedMeta:n}}_injectMetadata(e,t){const{decoratedApi:r,decoratedMeta:n}=this._injectDecorated(e,t);this._consts=r.consts,this._errors=r.errors,this._events=r.events,this._query=r.query,t||!this._extrinsics?(this._extrinsics=this._decorateExtrinsics(n,this._decorateMethod),this._rx.tx=this._decorateExtrinsics(n,this._rxDecorateMethod)):(cm("tx",this._decorateExtrinsics(n,this._decorateMethod),this._extrinsics,!1),cm(null,this._decorateExtrinsics(n,this._rxDecorateMethod),this._rx.tx,!1)),cm(null,this._decorateStorage(n,this._rxDecorateMethod),this._rx.query,t),cm(null,n.consts,this._rx.consts,t)}injectMetadata(e,t,r){this._injectMetadata({metadata:e,registry:r||S(this,ym)[ym],specVersion:Qt},t)}_decorateFunctionMeta(e,t){return t.meta=e.meta,t.method=e.method,t.section=e.section,t.toJSON=e.toJSON,e.callIndex&&(t.callIndex=e.callIndex),t}_filterRpc(e,t){const r=e.methods.map(e=>e.toString());0!==Object.keys(t).length&&(this._rpcCore.addUserInterfaces(t),this._decorateRpc(this._rpcCore,this._decorateMethod,this._rpc),this._decorateRpc(this._rpcCore,this._rxDecorateMethod,this._rx.rpc)),this._filterRpcMethods(r)}_filterRpcMethods(e){const t=0!==e.length,r=[...this._rpcCore.mapping.entries()],n=r.reduce((e,[,{alias:t,endpoint:r,method:n,pubsub:i,section:f}])=>(e.push(`${f}_${n}`),i&&(e.push(`${f}_${i[1]}`),e.push(`${f}_${i[2]}`)),t&&e.push(...t),r&&e.push(r),e),[]),i=e.filter(e=>!n.includes(e)),f=r.filter(([r])=>t&&!e.includes(r)&&"rpc_methods"!==r);i.length&&pm.warn("RPC methods not decorated: "+i.join(", ")),f.forEach(([,{method:e,section:t}])=>{delete this._rpc[t][e],delete this._rx.rpc[t][e]})}_decorateRpc(e,t,r={}){return e.sections.reduce((r,n)=>{const i=n;return r[i]||(r[i]=Object.entries(e[i]).reduce((e,[r,n])=>((this.hasSubscriptions||!r.startsWith("subscribe")&&!r.startsWith("unsubscribe"))&&(e[r]=t(n,{methodName:r}),e[r].json=t(n.json,{methodName:r}),e[r].raw=t(n.raw,{methodName:r}),e[r].meta=n.meta),e),{})),r},r)}_decorateMulti(e){return e(e=>(this.hasSubscriptions?this._rpcCore.state.subscribeStorage:this._rpcCore.state.queryStorageAt)(e.map(e=>Array.isArray(e)?[e[0].creator,...e.slice(1)]:[e.creator])))}_decorateExtrinsics({tx:e},t){const r=Qb(this._type,this._rx,t);return Object.entries(e).reduce((e,[t,n])=>(e[t]=Object.entries(n).reduce((e,[t,n])=>(e[t]=this._decorateExtrinsicEntry(n,r),e),{}),e),r)}_decorateExtrinsicEntry(e,t){const r=(...r)=>t(e(...r));return r.is=t=>e.is(t),this._decorateFunctionMeta(e,r)}_decorateStorage({query:e},t){return Object.entries(e).reduce((e,[r,n])=>(e[r]=Object.entries(n).reduce((e,[r,n])=>(e[r]=this._decorateStorageEntry(n,t),e),{}),e),{})}_decorateStorageAt({query:e},t,r){return Object.entries(e).reduce((e,[n,i])=>(e[n]=Object.entries(i).reduce((e,[n,i])=>(e[n]=this._decorateStorageEntryAt(i,t,r),e),{}),e),{})}_decorateStorageEntry(e,t){const r=t=>dm(e,t),n=this._decorateStorageCall(e,t);return n.creator=e,n.at=t((e,...t)=>this._rpcCore.state.getStorage(r(t),e)),n.hash=t((...e)=>this._rpcCore.state.getStorageHash(r(e))),n.is=t=>t.section===e.section&&t.method===e.method,n.key=(...t)=>Object(ve.a)(ob(e(e.meta.type.isPlain?void 0:e.meta.type.isMap?t[0]:e.meta.type.isDoubleMap?[t[0],t[1]]:t))[1]),n.keyPrefix=(...t)=>Object(ve.a)(e.keyPrefix(...t)),n.range=t((e,...t)=>this._decorateStorageRange(n,t,e)),n.size=t((...e)=>this._rpcCore.state.getStorageSize(r(e))),n.sizeAt=t((e,...t)=>this._rpcCore.state.getStorageSize(r(t),e)),e.iterKey&&(e.meta.type.isMap||e.meta.type.isDoubleMap)&&(n.entries=t(Cd(S(this,mm)[mm],(...t)=>this._retrieveMapEntries(e,null,t))),n.entriesAt=t(Cd(S(this,mm)[mm],(t,...r)=>this._retrieveMapEntries(e,t,r))),n.entriesPaged=t(Cd(S(this,mm)[mm],t=>this._retrieveMapEntriesPaged(e,t))),n.keys=t(Cd(S(this,mm)[mm],(...t)=>this._retrieveMapKeys(e,null,t))),n.keysAt=t(Cd(S(this,mm)[mm],(t,...r)=>this._retrieveMapKeys(e,t,r))),n.keysPaged=t(Cd(S(this,mm)[mm],t=>this._retrieveMapKeysPaged(e,t)))),this.supportMulti&&(n.multi=t(t=>this._retrieveMulti(t.map(t=>[e,t])))),this._decorateFunctionMeta(e,n)}_decorateStorageEntryAt(e,t,r){const n=t=>dm(e,t),i=t((...e)=>this._rpcCore.state.getStorage(n(e),r));return i.creator=e,i.hash=t((...e)=>this._rpcCore.state.getStorageHash(n(e),r)),i.is=t=>t.section===e.section&&t.method===e.method,i.key=(...t)=>Object(ve.a)(ob(e(e.meta.type.isPlain?void 0:e.meta.type.isMap?t[0]:e.meta.type.isDoubleMap?[t[0],t[1]]:t))[1]),i.keyPrefix=(...t)=>Object(ve.a)(e.keyPrefix(...t)),i.size=t((...e)=>this._rpcCore.state.getStorageSize(n(e),r)),e.iterKey&&(e.meta.type.isMap||e.meta.type.isDoubleMap)&&(i.entries=t(Cd(S(this,mm)[mm],(...t)=>this._retrieveMapEntries(e,r,t))),i.keys=t(Cd(S(this,mm)[mm],(...t)=>this._retrieveMapKeys(e,r,t)))),this._decorateFunctionMeta(e,i)}_decorateStorageCall(e,t){return t((...t)=>this.hasSubscriptions?this._rpcCore.state.subscribeStorage([dm(e,t)]).pipe(Object(ye.map)(([e])=>e)):this._rpcCore.state.getStorage(dm(e,t)),{methodName:e.method,overrideNoSub:(...t)=>this._rpcCore.state.getStorage(dm(e,t))})}_decorateStorageRange(e,t,r){const n=Mo(e.creator.meta.type,e.creator.meta.modifier.isOptional);return this._rpcCore.state.queryStorage([e.key(...t)],...r).pipe(Object(ye.map)(e=>e.map(([e,[t]])=>[e,this.createType(n,t.isSome?t.unwrap().toHex():void 0)])))}_retrieveMulti(e){if(!e.length)return Object(me.of)([]);const t=this.hasSubscriptions?this._rpcCore.state.subscribeStorage:this._rpcCore.state.queryStorageAt;return Object(me.combineLatest)(qb(e,250).map(e=>t(e))).pipe(Object(ye.map)($l))}_retrieveMapKeys({iterKey:e,meta:t,method:r,section:n},i,f){Object(T.a)(e&&(t.type.isMap||t.type.isDoubleMap||t.type.isNMap),"keys can only be retrieved on maps, linked maps and double maps");const c=e(...f).toHex(),a=new me.BehaviorSubject(c),o=i?e=>this._rpcCore.state.getKeysPaged(c,1e3,e,i):e=>this._rpcCore.state.getKeysPaged(c,1e3,e);return a.pipe(Object(ye.switchMap)(o),Object(ye.map)(e=>e.map(e=>e.setMeta(t,n,r))),Object(ye.tap)(e=>{setTimeout(()=>{1e3===e.length?a.next(e[999].toHex()):a.complete()},0)}),Object(ye.toArray)(),Object(ye.map)($l))}_retrieveMapKeysPaged({iterKey:e,meta:t,method:r,section:n},i){Object(T.a)(e&&(t.type.isMap||t.type.isDoubleMap||t.type.isNMap),"keys can only be retrieved on maps, linked maps and double maps");const f=e(...i.args).toHex();return this._rpcCore.state.getKeysPaged(f,i.pageSize,i.startKey||f).pipe(Object(ye.map)(e=>e.map(e=>e.setMeta(t,n,r))))}_retrieveMapEntries(e,t,r){const n=t?e=>this._rpcCore.state.queryStorageAt(e,t):e=>this._rpcCore.state.queryStorageAt(e);return this._retrieveMapKeys(e,t,r).pipe(Object(ye.switchMap)(e=>e.length?Object(me.combineLatest)(qb(e,250).map(n)).pipe(Object(ye.map)(t=>$l(t).map((t,r)=>[e[r],t]))):Object(me.of)([])))}_retrieveMapEntriesPaged(e,t){return this._retrieveMapKeysPaged(e,t).pipe(Object(ye.switchMap)(e=>e.length?this._rpcCore.state.queryStorageAt(e).pipe(Object(ye.map)(t=>t.map((t,r)=>[e[r],t]))):Object(me.of)([])))}_decorateDeriveRx(e){var t,r,n,i;const f=null===(t=this._runtimeVersion)||void 0===t?void 0:t.specName.toString(),c=lm(lm({},this._options.derives),(null===(r=this._options.typesBundle)||void 0===r||null===(n=r.spec)||void 0===n||null===(i=n[null!=f?f:""])||void 0===i?void 0:i.derives)||{});return om(function(e,t,r={}){return tb(tb({},ib(e,t,rb)),ib(e,t,r))}(S(this,mm)[mm],this._rx,c),e)}_decorateDerive(e){return om(this._rx.derive,e)}}{constructor(e,t,r){super(e,t,r),Object.defineProperty(this,Mm,{writable:!0,value:null}),Object.defineProperty(this,Om,{writable:!0,value:[]}),Object.defineProperty(this,xm,{writable:!0,value:null}),Object.defineProperty(this,Sm,{writable:!0,value:async()=>{this.emit("connected"),this._isConnected.next(!0);try{const[e,t]=await Promise.all([this._loadMeta(),!1===this._options.initWasm?Promise.resolve(!0):Od()]);e&&!this._isReady&&t&&(this._isReady=!0,this.emit("ready",this)),S(this,Mm)[Mm]=setInterval(()=>{this._rpcCore.system.health().toPromise().catch(()=>{})},1e4)}catch(e){const t=new Error("FATAL: Unable to initialize the API: "+e.message);wm.error(t),this.emit("error",t)}}}),Object.defineProperty(this,km,{writable:!0,value:()=>{this.emit("disconnected"),this._isConnected.next(!1),this._unsubscribeHealth()}}),Object.defineProperty(this,jm,{writable:!0,value:e=>{this.emit("error",e)}}),this.registry.setKnownTypes(e),e.source?S(this,Om)[Om]=S(e.source,Om)[Om]:this.registerTypes(e.types),this._rpc=this._decorateRpc(this._rpcCore,this._decorateMethod),this._rx.rpc=this._decorateRpc(this._rpcCore,this._rxDecorateMethod),this.supportMulti&&(this._queryMulti=this._decorateMulti(this._decorateMethod),this._rx.queryMulti=this._decorateMulti(this._rxDecorateMethod)),this._rx.signer=e.signer,this._rpcCore.setRegistrySwap(e=>this.getBlockRegistry(e)),this.hasSubscriptions?(this._rpcCore.provider.on("disconnected",S(this,km)[km]),this._rpcCore.provider.on("error",S(this,jm)[jm]),this._rpcCore.provider.on("connected",S(this,Sm)[Sm])):wm.warn("Api will be available in a limited mode since the provider does not support subscriptions"),this._rpcCore.provider.isConnected&&S(this,Sm)[Sm]()}_initRegistry(e,t,r,n,i){e.setChainProperties(i||this.registry.getChainProperties()),e.setKnownTypes(this._options),e.register(function({knownTypes:e},t,r,n){var i,f,c,a,o,s,d,u;const h=t.toString(),l=r.toString(),p=tt(n).toNumber();return Lt(Lt(Lt(Lt(Lt(Lt(Lt({},zt(St[l],p)),zt(rt[h],p)),zt(null===(i=e.typesBundle)||void 0===i||null===(f=i.spec)||void 0===f||null===(c=f[l])||void 0===c?void 0:c.types,p)),zt(null===(a=e.typesBundle)||void 0===a||null===(o=a.chain)||void 0===o||null===(s=o[h])||void 0===s?void 0:s.types,p)),(null===(d=e.typesSpec)||void 0===d?void 0:d[l])||{}),(null===(u=e.typesChain)||void 0===u?void 0:u[h])||{}),e.types||{})}(e,t,r.specName,r.specVersion)),e.setHasher(function({knownTypes:e},t,r){var n,i,f,c,a,o;const s=t.toString(),d=r.toString();return e.hasher||(null===(n=e.typesBundle)||void 0===n||null===(i=n.chain)||void 0===i||null===(f=i[s])||void 0===f?void 0:f.hasher)||(null===(c=e.typesBundle)||void 0===c||null===(a=c.spec)||void 0===a||null===(o=a[d])||void 0===o?void 0:o.hasher)||null}(e,t,r.specName)),e.knownTypes.typesBundle&&(e.knownTypes.typesAlias=function({knownTypes:e},t,r){var n,i,f,c,a,o;const s=t.toString(),d=r.toString();return Lt(Lt(Lt({},(null===(n=e.typesBundle)||void 0===n||null===(i=n.spec)||void 0===i||null===(f=i[d])||void 0===f?void 0:f.alias)||{}),(null===(c=e.typesBundle)||void 0===c||null===(a=c.chain)||void 0===a||null===(o=a[s])||void 0===o?void 0:o.alias)||{}),e.typesAlias||{})}(e,t,r.specName)),e.setMetadata(n,void 0,vm(vm({},function({knownTypes:e},t,r){var n,i,f,c,a,o;const s=t.toString(),d=r.toString();return Lt(Lt({},(null===(n=e.typesBundle)||void 0===n||null===(i=n.spec)||void 0===i||null===(f=i[d])||void 0===f?void 0:f.signedExtensions)||{}),(null===(c=e.typesBundle)||void 0===c||null===(a=c.chain)||void 0===a||null===(o=a[s])||void 0===o?void 0:o.signedExtensions)||{})}(e,t,r.specName)),this._options.signedExtensions||{}))}_getDefaultRegistry(){const e=S(this,Om)[Om].find(({isDefault:e})=>e);return Object(T.a)(e,"Initialization error, cannot find the default registry"),e}async at(e){const t=Object(ge.a)(e),r=await this.getBlockRegistry(t);return r.decoration?r.decoration:this._injectDecorated(r,!0,t).decoratedApi}async getBlockRegistry(e){const t=S(this,Om)[Om].find(({lastBlockHash:t})=>t&&td(t,e));if(t)return t;Object(T.a)(this._genesisHash&&this._runtimeVersion,"Cannot retrieve data on an uninitialized chain");const r=this.registry.createType("HeaderPartial",this._genesisHash.eq(e)?{number:Qt,parentHash:this._genesisHash}:await this._rpcCore.chain.getHeader.json(e).toPromise());Object(T.a)(!r.parentHash.isEmpty,"Unable to retrieve header and parent from supplied hash");const[n,i]=function(e,t){const r=Ht.find(t=>e.eq(t.genesisHash));return r?[r.versions.reduce((e,r)=>t.gt(r.blockNumber)?r:e,void 0),r.versions.find(e=>t.lte(e.blockNumber))]:[void 0,void 0]}(this._genesisHash,r.number),f=this.registry.createType("RuntimeVersionPartial",n&&(i||n.specVersion.eq(this._runtimeVersion.specVersion))?{specName:this._runtimeVersion.specName,specVersion:n.specVersion}:await this._rpcCore.state.getRuntimeVersion.json(r.parentHash).toPromise()),c=S(this,Om)[Om].find(({specVersion:e})=>e.eq(f.specVersion));if(c)return c.lastBlockHash=e,c;const a=new Md(e),o=new Mn(a,await this._rpcCore.state.getMetadata.raw(r.parentHash).toPromise());this._initRegistry(a,this._runtimeChain,f,o);const s={lastBlockHash:e,metadata:o,registry:a,specVersion:f.specVersion};return S(this,Om)[Om].push(s),s}async _loadMeta(){var e;return!!this._isReady||(this._unsubscribeUpdates(),[this._genesisHash,this._runtimeMetadata]=null!==(e=this._options.source)&&void 0!==e&&e._isReady?await this._metaFromSource(this._options.source):await this._metaFromChain(this._options.metadata),this._initFromMeta(this._runtimeMetadata))}async _metaFromSource(e){this._extrinsicType=e.extrinsicVersion,this._runtimeChain=e.runtimeChain,this._runtimeVersion=e.runtimeVersion;const t=[];return Object.keys(e.rpc).forEach(r=>{Object.keys(e.rpc[r]).forEach(e=>{t.push(`${r}_${e}`)})}),this._filterRpcMethods(t),[e.genesisHash,e.runtimeMetadata]}_detectCapabilities(e,t){return jd(this._rx,t).toPromise().then(r=>{Object.keys(r).length&&(e.register(r),wm.debug(()=>`Capabilities detected${t?` (${Object(ve.a)(Object(ge.a)(t))})`:""}: ${H(r)}`))}).catch(void 0),!0}_subscribeUpdates(){!S(this,xm)[xm]&&this.hasSubscriptions&&(S(this,xm)[xm]=this._rpcCore.state.subscribeRuntimeVersion().pipe(Object(ye.switchMap)(e=>{var t;return null!==(t=this._runtimeVersion)&&void 0!==t&&t.specVersion.eq(e.specVersion)?Object(me.of)(!1):this._rpcCore.state.getMetadata().pipe(Object(ye.map)(t=>{wm.log(`Runtime version updated to spec=${e.specVersion.toString()}, tx=${e.transactionVersion.toString()}`),this._runtimeMetadata=t,this._runtimeVersion=e,this._rx.runtimeVersion=e;const r=this._getDefaultRegistry();return r.metadata=t,r.specVersion=e.specVersion,this._initRegistry(r.registry.init(),this._runtimeChain,e,t),this._injectMetadata(r,!1),this._detectCapabilities(r.registry)}))})).subscribe())}async _metaFromChain(e){const[t,r,n,i,f,c]=await Promise.all([this._rpcCore.chain.getBlockHash(0).toPromise(),this._rpcCore.state.getRuntimeVersion().toPromise(),this._rpcCore.system.chain().toPromise(),this._rpcCore.system.properties().toPromise(),this._rpcCore.rpc.methods().toPromise(),e?Promise.resolve(null):this._rpcCore.state.getMetadata().toPromise()]);this._runtimeChain=n,this._runtimeVersion=r,this._rx.runtimeVersion=r;const a=`${t.toHex()||"0x"}-${r.specVersion.toString()}`,o=c||(e&&e[a]?new Mn(this.registry,e[a]):await this._rpcCore.state.getMetadata().toPromise());return this._initRegistry(this.registry,n,r,o,i),this._filterRpc(f,function({knownTypes:e},t,r){var n,i,f,c,a,o;const s=t.toString(),d=r.toString();return Lt(Lt({},(null===(n=e.typesBundle)||void 0===n||null===(i=n.spec)||void 0===i||null===(f=i[d])||void 0===f?void 0:f.rpc)||{}),(null===(c=e.typesBundle)||void 0===c||null===(a=c.chain)||void 0===a||null===(o=a[s])||void 0===o?void 0:o.rpc)||{})}(this.registry,n,r.specName)),this._subscribeUpdates(),S(this,Om)[Om].length||S(this,Om)[Om].push({isDefault:!0,metadata:o,registry:this.registry,specVersion:r.specVersion}),o.getUniqTypes(this._options.throwOnUnknown||!1),[t,o]}_initFromMeta(e){return this._extrinsicType=e.asLatest.extrinsic.version.toNumber(),this._rx.extrinsicType=this._extrinsicType,this._rx.genesisHash=this._genesisHash,this._rx.runtimeVersion=this._runtimeVersion,this._injectMetadata(this._getDefaultRegistry(),!0),this._rx.derive=this._decorateDeriveRx(this._rxDecorateMethod),this._derive=this._decorateDerive(this._decorateMethod),this._detectCapabilities(this.registry),!0}_unsubscribeHealth(){S(this,Mm)[Mm]&&(clearInterval(S(this,Mm)[Mm]),S(this,Mm)[Mm]=null)}_unsubscribeUpdates(){S(this,xm)[xm]&&(S(this,xm)[xm].unsubscribe(),S(this,xm)[xm]=null)}_unsubscribe(){this._unsubscribeHealth(),this._unsubscribeUpdates()}}{get consts(){return Pm(this._consts)}get derive(){return Pm(this._derive)}get errors(){return Pm(this._errors)}get events(){return Pm(this._events)}get extrinsicVersion(){return this._extrinsicType}get genesisHash(){return Pm(this._genesisHash)}get isConnected(){return this._isConnected.getValue()}get libraryInfo(){return`${we.a.name} v${we.a.version}`}get query(){return Pm(this._query)}get queryMulti(){return Pm(this._queryMulti)}get rpc(){return Pm(this._rpc)}get runtimeChain(){return Pm(this._runtimeChain)}get runtimeMetadata(){return Pm(this._runtimeMetadata)}get runtimeVersion(){return Pm(this._runtimeVersion)}get rx(){return Pm(this._rx)}get type(){return this._type}get tx(){return Pm(this._extrinsics)}}{constructor(e={},t,r){super(e,t,r)}connect(){return this._rpcCore.connect()}disconnect(){return this._unsubscribe(),this._rpcCore.disconnect()}findCall(e){return this.registry.findMetaCall(Object(ge.a)(e))}findError(e){return this.registry.findMetaError(Object(ge.a)(e))}setSigner(e){this._rx.signer=e}async sign(e,t,{signer:r}={}){if(Object(C.a)(e)){const n=r||this._rx.signer;return Object(T.a)(null==n?void 0:n.signRaw,"No signer exists with a signRaw interface. You possibly need to pass through an explicit keypair for the origin so it can be used for signing."),(await n.signRaw(Em(Em({type:"bytes"},t),{},{address:e}))).signature}return Object(ve.a)(e.sign(Object(ge.a)(t.data)))}}{static create(e){const t=new Wm(e);return e&&e.throwOnConnect?t.isReadyOrError:(t.isReadyOrError.catch(()=>{}),t.isReady)}constructor(e){super(e,"promise",Vm),Object.defineProperty(this,Um,{writable:!0,value:void 0}),Object.defineProperty(this,Fm,{writable:!0,value:void 0}),S(this,Um)[Um]=new Promise(e=>{super.once("ready",()=>e(this))}),S(this,Fm)[Fm]=new Promise((e,t)=>{const r=zm(e,t);super.once("ready",()=>r.resolve(this)),super.once("error",e=>r.reject(e))})}get isReady(){return S(this,Um)[Um]}get isReadyOrError(){return S(this,Fm)[Fm]}clone(){return new Wm(Lm(Lm({},this._options),{},{source:this}))}async combineLatest(e,t){const r=new Hm(e,t);return()=>{r.unsubscribe()}}}function Km(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 Xm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Km(Object(r),!0).forEach((function(t){Zm(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Km(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gm={app:"#151515",button:"C0C0C0",card:"#262626",os:"#000000"},Ym={error:"#D73400",main:"#FF4077"},Jm=Object.freeze({ETHEREUM:"ethereum",SUBSTRATE:"substrate",UNKNOWN:"unknown"}),Qm=Object.freeze({UNKNOWN:"unknown"}),$m=Object.freeze({KUSAMA:"0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe",POLKADOT:"0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"}),ey=Zm({},Qm.UNKNOWN,{color:Ym.error,order:99,pathId:"",prefix:2,protocol:Jm.UNKNOWN,secondaryColor:Gm.card,title:"Unknown network"}),ty=(Zm(qm={},$m.KUSAMA,{color:"#000",decimals:12,genesisHash:$m.KUSAMA,order:2,pathId:"kusama",prefix:2,title:"Kusama",unit:"KSM"}),Zm(qm,$m.POLKADOT,{color:"#E6027A",decimals:12,genesisHash:null,order:1,pathId:"polkadot",prefix:0,title:"Polkadot",unit:"DOT"}),qm),ry={color:"#4C4646",protocol:Jm.SUBSTRATE,secondaryColor:Gm.card};var ny,iy,fy=Object.freeze((ny=ty,iy=ry,Object.keys(ny).reduce((function(e,t){return Xm(Xm({},e),{},Zm({},t,Xm(Xm({},iy),ny[t])))}),{}))),cy=Object.freeze(ey);Object.values(Xm(Xm({},fy),cy)).map((function(e){return e.pathId})),Object.freeze(Object.assign({},fy,[],cy)),$m.KUSAMA;function ay(e){var t=Tt.find((function(t){return t.network===e}));return Object(T.a)(t&&t.genesisHash[0],"Unable to find genesisHash for ".concat(e)),t.genesisHash[0]}var oy=ay("kusama"),sy=ay("polkadot");function dy(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 uy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dy(Object(r),!0).forEach((function(t){hy(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ly(e){return function(e){if(Array.isArray(e))return py(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return py(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function by(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function my(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){by(f,n,i,c,a,"next",e)}function a(e){by(f,n,i,c,a,"throw",e)}c(void 0)}))}}function yy(e,t,r,n){return gy.apply(this,arguments)}function gy(){return(gy=my(regeneratorRuntime.mark((function e(t,r,n,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.apply(void 0,ly(r).concat([function(e){var t=i?i(e):e;window.send(n,t)}])).then((function(e){var t="unsub".concat(n);return window[t]=e,{}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vy(){return(vy=my(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.consts);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wy(){return(wy=my(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.rpc.system.properties();case 2:return r=e.sent,n=t.genesisHash.toHuman(),e.abrupt("return",n==$m.POLKADOT?t.registry.createType("ChainProperties",uy(uy({},r),{},{tokenDecimals:[10],tokenSymbol:["DOT"],genesisHash:n})):uy(uy({},r.toJSON()),{},{genesisHash:n}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var My=r(66),Oy=r.n(My);function xy(e=32){return Object(pi.a)(new Uint8Array(e))}function Sy(e,t){return Uint8Array.from(Oy.a.hmac(Oy.a.sha512,e).update(t).digest())}function ky(e,t=xy(),r=2048,n=!1){const i=Object(ge.a)(e),f=Object(ge.a)(t);return{password:Qi()&&!n?Gi(i,f,r):function(e,t,r,n=64){let i=new Uint8Array,f=0;const c=Ae(t,new Uint8Array(4));for(;i.length<n;){f++,c.set(dr(f,{bitLength:32,isLe:!1}),t.length);let n=Sy(e,c);const a=n;let o=0;for(;++o<r;){n=Sy(e,n);let t=-1;for(;++t<n.length;)a[t]^=n[t]}i=Ae(i,a)}return i.slice(0,n)}(i,f,r),rounds:r,salt:t}}var jy=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function Py(e){return(e||"").normalize("NFKD")}function Ay(e){return parseInt(e,2)}function Ey(e){return e.map(e=>e.toString(2).padStart(8,"0")).join("")}function Iy(e){const t=8*e.length/32,r=Oy.a.sha256().update(e).digest();return Ey(Array.from(r)).slice(0,t)}function Ty(e,t){return ky(Object(ni.a)(Py(e)),Object(ni.a)("mnemonic"+Py(t))).password}function Ry(e){var t;const r=Py(e).split(" ");Object(T.a)(r.length%3==0,"Invalid mnemonic");const n=r.map(e=>{const t=jy.indexOf(e);return Object(T.a)(-1!==t,"Invalid mnemonic"),t.toString(2).padStart(11,"0")}).join(""),i=32*Math.floor(n.length/33),f=n.slice(0,i),c=n.slice(i),a=null===(t=f.match(/(.{1,8})/g))||void 0===t?void 0:t.map(Ay);Object(T.a)(a&&a.length%4==0&&a.length>=16&&a.length<=32,"Invalid entropy");const o=Object(ge.a)(a),s=Iy(o);return Object(T.a)(s===c,"Invalid mnemonic checksum"),o}function Ny(e){return e=e||128,Object(T.a)(e%32==0,"Invalid entropy"),t=xy(e/8),Object(T.a)(t.length%4==0&&t.length>=16&&t.length<=32,"Invalid entropy"),(Ey(Array.from(t))+Iy(t)).match(/(.{1,11})/g).map(e=>jy[Ay(e)]).join(" ");var t}const _y={12:128,15:160,18:192,21:224,24:256};function Cy(e=12,t=!1){return Qi()&&!t?Ri(e):Ny(_y[e])}const By=/^\d+$/,Hy={bitLength:256,isLe:!0};var Dy=j("chainCode"),Ly=j("isHard");class zy{constructor(){Object.defineProperty(this,Dy,{writable:!0,value:new Uint8Array(32)}),Object.defineProperty(this,Ly,{writable:!0,value:!1})}static from(e){const t=new zy,[r,n]=e.startsWith("/")?[e.substr(1),!0]:[e,!1];return t.soft(By.test(r)?parseInt(r,10):r),n?t.harden():t}get chainCode(){return S(this,Dy)[Dy]}get isHard(){return S(this,Ly)[Ly]}get isSoft(){return!S(this,Ly)[Ly]}hard(e){return this.soft(e).harden()}harden(){return S(this,Ly)[Ly]=!0,this}soft(e){return D(e)||Object(Tc.a)(e)||B(e)?this.soft(hr(e,Hy)):Object(Me.a)(e)?this.soft(Object(Pe.a)(e)):Object(C.a)(e)?this.soft(If(Object(ni.a)(e))):e.length>32?this.soft($i(e)):(S(this,Dy)[Dy].fill(0),S(this,Dy)[Dy].set(e,0),this)}soften(){return S(this,Ly)[Ly]=!1,this}}const Vy=/\/(\/?)([^/]+)/g;function qy(e){const t=e.match(Vy),r=[];let n="";return t&&(n=t.join(""),t.forEach(e=>{r.push(zy.from(e.substr(1)))})),Object(T.a)(n===e,()=>`Re-constructed path "${n}" does not match input`),{parts:t,path:r}}const Uy=/^(\w+( \w+)*)((\/\/?[^/]+)*)(\/\/\/(.*))?$/;function Fy(e){const t=e.match(Uy);Object(T.a)(!R(t),"Unable to match provided value to a secret URI");const[,r,,n,,,i]=t,{path:f}=qy(n);return{derivePath:n,password:i,path:f,phrase:r}}var Wy=r(69),Ky=r.n(Wy);function Xy(e,t,r,n=!1){const i=Object(ge.a)(e),f=Object(ge.a)(r),c=Object(ge.a)(t);return Object(T.a)(32===f.length,()=>`Invalid publicKey, received ${f.length}, expected 32`),Object(T.a)(64===c.length,()=>`Invalid signature, received ${c.length} bytes, expected 64`),Qi()&&!n?Li(c,i,f):Ky.a.sign.detached.verify(i,c,f)}function Zy(e,t,r){const n=Object(ge.a)(r),i=Object(ge.a)(t);return Object(T.a)(32===n.length,()=>`Invalid publicKey, received ${n.length} bytes, expected 32`),Object(T.a)(64===i.length,()=>`Invalid signature, received ${i.length} bytes, expected 64`),Fi(i,Object(ge.a)(e),n)}const Gy=["blake2","keccak"];function Yy(e,t){if("blake2"===e)return $i(t);if("keccak"===e)return Mc(t);throw new Error(`Unsupported secp256k1 hasher '${e}', expected one of ${Gy.join(", ")}`)}const Jy=e=>(t,r,n)=>function(e,t,r,n="blake2"){const i="keccak"===n,f=Object(ge.a)(t);Object(T.a)(65===f.length,`Expected signature with 65 bytes, ${f.length} found instead`);const c=new Uint8Array(Sc.recoverPubKey(Yy(n,e),{r:f.slice(0,32),s:f.slice(32,64)},f[64]).encodeCompressed()),a=Yy(n,i?jc(c):c),o=Object(ge.a)(r);return i?td(a.slice(-20),o.slice(-20)):td(a,o)}(t,r,n,e),Qy=[["ecdsa",Jy("blake2")],["ethereum",Jy("keccak")]],$y=[["ed25519",Xy],["sr25519",Zy],...Qy],eg=["ed25519","sr25519","ecdsa"];function tg(e,{message:t,publicKey:r,signature:n},i=$y){return e.isValid=i.some(([i,f])=>{try{if(f(t,n,r))return e.crypto=i,!0}catch(e){}return!1}),e}function rg(e,t,r){const n=Object(ge.a)(t);Object(T.a)([64,65,66].includes(n.length),()=>"Invalid signature length, expected [64..66] bytes, found "+n.length);const i=Vc(r),f={message:e,publicKey:i,signature:n},c={crypto:"none",isValid:!1,publicKey:i};return[0,1,2].includes(n[0])&&[65,66].includes(n.length)?function(e,{message:t,publicKey:r,signature:n}){Object(T.a)([0,1,2].includes(n[0]),()=>"Unknown crypto type, expected signature prefix [0..2], found "+n[0]);const i=eg[n[0]]||"none";e.crypto=i;try{e.isValid={ecdsa:()=>tg(e,{message:t,publicKey:r,signature:n.subarray(1)},Qy).isValid,ed25519:()=>Xy(t,n.subarray(1),r),none:()=>{throw Error("no verify for `none` crypto type")},sr25519:()=>Zy(t,n.subarray(1),r)}[i]()}catch(e){}return e}(c,f):tg(c,f)}var ng=r(20),ig=r.n(ng);function fg(e){return ri(Object(Pe.a)(e))}function cg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ag(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ag(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ag(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var og=new ig.a(-1),sg=new ig.a(2);function dg(e,t,r,n,i,f){var c=1===f?$t:og,a=r.add(n),o=$t.muln(10*i).mul(a).div(rr);return[a,e.add(c.mul(a)),ig.a.max(Qt,t.add(c.mul(o)))]}function ug(e,t,r,n,i,f){for(var c=r.votedAye,a=r.votedNay,o=r.votedTotal;;){var s=cg(dg(c,o,i,f,n?0:1,n?-1:1),3),d=s[0];if(hh(e,t,{votedAye:s[1],votedNay:a,votedTotal:s[2]})!==n)return i;i=d}}function hg(e,t,r,n,i,f){for(var c=r.votedAye,a=r.votedNay,o=r.votedTotal;;){var s=cg(dg(a,o,i,f,n?1:0,n?1:-1),3),d=s[0];if(hh(e,t,{votedAye:c,votedNay:s[1],votedTotal:s[2]})!==n)return i;i=d}}function lg(e,t,r){var n=hh(e,t,r);if(e.isSimplemajority){var i=n?r.votedAye.sub(r.votedNay):r.votedNay.sub(r.votedAye);return{changeAye:r.votedNay.isZero()?Qt:i,changeNay:r.votedAye.isZero()?Qt:i}}for(var f=Qt,c=Qt,a=r.votedTotal.div(sg);!a.isZero();){f=ug(e,t,r,n,f,a),c=hg(e,t,r,n,c,a);var o=a.div(sg);o.isZero()&&(f=f.add(a),c=c.add(a)),a=o}return{changeAye:r.votedNay.isZero()?Qt:n?ig.a.min(f,r.votedAye):f,changeNay:r.votedAye.isZero()?Qt:n?c:ig.a.min(c,r.votedNay)}}function pg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mg(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function yg(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){mg(f,n,i,c,a,"next",e)}function a(e){mg(f,n,i,c,a,"throw",e)}c(void 0)}))}}function gg(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 vg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gg(Object(r),!0).forEach((function(t){wg(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mg(e){var t=Fa.filterOrigin(e).map((function(e){var t=e.name,r=e.type;return{name:t.toString(),type:fn(r.toString())}})),r=e.args.map((function(e){return{isValid:!0,value:e}}));return{hash:e.hash,params:t,values:r}}function Og(e){for(var t=e.registry.findMetaCall(e.callIndex).meta,r="",n=0;n<t.documentation.length&&t.documentation[n].length;n++)r+=t.documentation[n];var i=e.toHuman();if("setCode"==i.method){var f=i.args;i.args=[f[0].slice(0,16)+"..."+f[0].slice(f[0].length-16)]}return{callIndex:e.toJSON().callIndex,method:i.method,section:i.section,args:i.args,meta:vg(vg({},t.toJSON()),{},{documentation:r})}}function xg(){return(xg=yg(regeneratorRuntime.mark((function e(t,r){var n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.democracy.referendums();case 2:return n=e.sent,e.next=5,t.derive.democracy.sqrtElectorate();case 5:return i=e.sent,f=n.map((function(e){var t,n,f=e.image,c=e.imageHash,a=e.status,o=e.votedAye,s=e.votedNay,d=e.votedTotal,u=e.votes,h={},l={};if(f&&f.proposal&&(h=Mg(f.proposal.registry.findMetaCall(f.proposal.callIndex).meta),l=Og(f.proposal),f.proposal=f.proposal.toHuman(),"setCode"==(null===(n=f.proposal)||void 0===n?void 0:n.method))){var p=f.proposal.args;f.proposal=vg(vg({},f.proposal),{},{args:[p[0].toString().slice(0,16)+"..."+p[0].toString().slice(p[0].toString().length-16)]})}var b=lg(a.threshold,i,{votedAye:o,votedNay:s,votedTotal:d}),m=u.find((function(e){return e.accountId.toString()==r})),y=m?{balance:m.balance,vote:m.vote.toHuman()}:null;return vg(vg(vg({},h),l),{},{title:"".concat(l.section,".").concat(l.method),content:null===(t=l.meta)||void 0===t?void 0:t.documentation,imageHash:c.toHuman(),changes:{changeAye:b.changeAye.toString(),changeNay:b.changeNay.toString()},userVoted:y})})),e.abrupt("return",{referendums:n,details:f});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Sg=[1,2,4,8,16,32].map((function(e,t){return[t+1,e]})),kg={"0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3":new ig.a(403200)};function jg(){return(jg=yg(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(kg[t.genesisHash.toHex()]||t.consts.democracy.enactmentPeriod).toNumber()*t.consts.timestamp.minimumPeriod.toNumber()/1e3*2/86400,n=Sg.map((function(e){var t=pg(e,2),n=t[0],i=t[1];return{lock:i,period:(r*i).toFixed(2),value:n}})),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pg(){return(Pg=yg(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.democracy.proposals();case 2:return r=e.sent,e.abrupt("return",r.map((function(e){return e.image&&e.image.proposal&&(e.image.proposal=Og(e.image.proposal)),e})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ag(){return(Ag=yg(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.council.votes();case 2:return r=e.sent,e.abrupt("return",r.reduce((function(e,t){var r=pg(t,2),n=r[0],i=r[1],f=i.stake,c=i.votes,a=vg({},e);return c.forEach((function(e){var t=e.toString();a[t]||(a[t]={}),a[t][n.toString()]=f})),a}),{}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Eg=Object(ni.a)("modlpy/trsry".padEnd(32,"\0"));function Ig(){return(Ig=yg(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.treasury.proposals();case 2:return r=e.sent,e.next=5,t.derive.balances.account(Eg);case 5:return n=e.sent,(i=vg({},r)).balance=Mr(n.freeBalance,{forceUnit:"-",withSi:!1}).split(".")[0],i.proposals.forEach((function(e){e.council.length&&(e.council=e.council.map((function(e){return vg(vg({},e),{},{proposal:Og(e.proposal)})})))})),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tg(){return(Tg=yg(regeneratorRuntime.mark((function e(t){var r,n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(t.query.tips||t.query.treasury).tips.keys();case 2:return r=e.sent,n=r.map((function(e){return e.args[0].toHex()})),e.next=6,(t.query.tips||t.query.treasury).tips.multi(n);case 6:return i=e.sent,f=i.map((function(e,t){return[n[t],e.unwrapOr(null)]})).filter((function(e){return!!e[1]})).sort((function(e,t){return e[1].closes.unwrapOr(Qt).cmp(t[1].closes.unwrapOr(Qt))})),e.abrupt("return",Promise.all(f.map(function(){var e=yg(regeneratorRuntime.mark((function e(r){var n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r[1].toJSON(),e.next=3,(t.query.tips||t.query.treasury).reasons(n.reason);case 3:return i=e.sent,f=n.tips.map((function(e){return{address:e[0],value:e[1]}})),e.abrupt("return",vg(vg({hash:r[0]},n),{},{reason:i.isSome?fg(i.unwrap().toHex()):null,tips:f}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rg(){return(Rg=yg(regeneratorRuntime.mark((function e(t,r,n){var i,f,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.query.electionsPhragmen.members();case 2:return i=e.sent,f=Math.ceil(.6*i.length),c=n?t.tx.treasury.rejectProposal(r):t.tx.treasury.approveProposal(r),e.abrupt("return",t.tx.council.propose(f,c,c.length));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ng(){return(Ng=yg(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.council.proposals();case 2:return r=e.sent,n=[],r.forEach((function(e){n.push(vg(vg({},e),{},{proposal:Og(e.proposal)}))})),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _g(){return(_g=yg(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([t.derive.chain.bestNumber(),t.derive.democracy.locks(r)]);case 2:return n=e.sent,e.abrupt("return",n[1].filter((function(e){var t=e.isFinished,r=e.unlockAt;return t&&n[0].gt(r)})).map((function(e){return e.referendumId})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Cg={fetchReferendums:function(e,t){return xg.apply(this,arguments)},getReferendumVoteConvictions:function(e){return jg.apply(this,arguments)},fetchProposals:function(e){return Pg.apply(this,arguments)},fetchCouncilVotes:function(e){return Ag.apply(this,arguments)},getCouncilMotions:function(e){return Ng.apply(this,arguments)},getTreasuryOverview:function(e){return Ig.apply(this,arguments)},getTreasuryTips:function(e){return Tg.apply(this,arguments)},makeTreasuryProposalSubmission:function(e,t,r){return Rg.apply(this,arguments)},getDemocracyUnlocks:function(e,t){return _g.apply(this,arguments)}};function Bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||Dg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hg(e){return function(e){if(Array.isArray(e))return Lg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Dg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dg(e,t){if(e){if("string"==typeof e)return Lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lg(e,t):void 0}}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zg(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function Vg(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){zg(f,n,i,c,a,"next",e)}function a(e){zg(f,n,i,c,a,"throw",e)}c(void 0)}))}}var qg,Ug=new Uint8Array([0]),Fg={};function Wg(e){if(!e)return null;for("ec"===e.substr(-2)&&(e=e.substr(0,e.length-2));"ec11"===e.substr(-4);)e=e.substr(0,e.length-4);if("4"!==e.substr(0,1)||"0"!==e.substr(-1))return null;e=e.substr(1,e.length-2);var t=parseInt(e.substr(0,2),16)||0,r=parseInt(e.substr(0,4),16)||0,n=0;if(2*t+2===e.length)e=e.substr(2),n=t;else{if(2*r+4!==e.length)return null;e=e.substr(4),n=r}for(var i=new Uint8Array(n),f=0;f<n;f++)i[f]=parseInt(e.substr(2*f,2),16);return i}function Kg(e){return Xg.apply(this,arguments)}function Xg(){return(Xg=Vg(regeneratorRuntime.mark((function e(t){var r,n,i,f,c,a,o,s,d,u,h,l,p,b,m,y,g,v,w,M,O,x,S,k,j,P=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=P.length>1&&void 0!==P[1]&&P[1],n=Object(Qe.a)(Object(ve.a)(t.slice(0,5))),i=parseInt(n.substr(2,4),16),f=i>1,c=parseInt(n.substr(6,4),16),a=Object(Qe.a)(Object(ve.a)(t.slice(5))),!f||r){e.next=9;break}return o={currentFrame:c,frameCount:i,isMultipart:f,partData:a},e.abrupt("return",o);case 9:s=a.substr(0,2),d=a.substr(2,2),u=a.substr(4,2),e.prev=12,e.t0=s,e.next="45"===e.t0?16:"53"===e.t0?31:68;break;case 16:if(l={data:{}},h="00"===d||"01"===d?"signData":"01"===d?"signTransaction":null,p=a.substr(4,44),l.action=h,l.data.account=p,"signData"!==h){e.next=25;break}l.data.rlp=a[13],e.next=30;break;case 25:if("signTransaction"!==h){e.next=29;break}l.data.data=a[13],e.next=30;break;case 29:throw new Error("Could not determine action type.");case 30:return e.abrupt("return",l);case 31:if(b={data:{}},e.prev=32,b.data.crypto="00"===d?"ed25519":"01"===d?"sr25519":null,m=a.substr(6,64),y=Object(Pe.a)("0x"+m),g="0x"+a.slice(70),v=g.slice(0,-64),w="0x".concat(g.substr(-64)),M=Object(Pe.a)(v),b.data.genesisHash=w,O=M.length>256,x=fy[w]){e.next=45;break}throw new Error("Signer does not currently support a chain with genesis hash: ".concat(w));case 45:e.t1=u,e.next="00"===e.t1||"02"===e.t1?48:"01"===e.t1?56:62;break;case 48:return b.action=O?"signData":"signTransaction",b.oversized=O,b.isHash=O,S=Ef(M),k=Bg(S,1),j=k[0],M.subarray(j),b.data.data=M,b.data.account=qc(y,x.prefix),e.abrupt("break",62);case 56:return b.action="signData",b.oversized=!1,b.isHash=!0,b.data.data=v,b.data.account=qc(y,x.prefix),e.abrupt("break",62);case 62:e.next=67;break;case 64:throw e.prev=64,e.t2=e.catch(32),new Error("Error: something went wrong decoding the Substrate UOS payload: "+a);case 67:return e.abrupt("return",b);case 68:throw new Error("Error: Payload is not formatted correctly: "+t);case 69:e.next=74;break;case 71:throw e.prev=71,e.t3=e.catch(12),new Error("we cannot handle the payload: "+t);case 74:case"end":return e.stop()}}),e,null,[[12,71],[32,64]])})))).apply(this,arguments)}function Zg(e){var t=void 0!==e.frameCount&&e.frameCount>1;return e.isMultipart||t}function Gg(e,t,r){return Yg.apply(this,arguments)}function Yg(){return(Yg=Vg(regeneratorRuntime.mark((function e(t,r,n){var i,f,c,a,o,s,d,u,h,l,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(Fg.totalFrameCount||(i=new Array(r).fill(null),Fg.multipartData=i,Fg.totalFrameCount=r),c=(f=Fg).completedFramesCount,a=f.multipartComplete,o=f.multipartData,s=f.totalFrameCount,d=new Uint8Array(n.length/2),u=0;u<d.length;u++)d[u]=parseInt(n.substr(2*u,2),16);if(0!==t||d[0]!==new Uint8Array([0])[0]&&d[0]!==new Uint8Array([123])[0]){e.next=6;break}throw new Error("Error decoding invalid part data.");case 6:if(!(c<s)){e.next=18;break}if((h=o)[t]=d,l=h.reduce((function(e,t,r){return null===t&&e.push(r+1),e}),[]),p=s-l.length,Fg.completedFramesCount=p,Fg.latestFrame=t,Fg.missedFrames=l,Fg.multipartData=h,!(s>0&&p===s)||a){e.next=18;break}return e.next=18,Jg();case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jg(){return Qg.apply(this,arguments)}function Qg(){return(Qg=Vg(regeneratorRuntime.mark((function e(){var t,r,n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(t=Fg).multipartData,n=t.totalFrameCount,i=r.reduce((function(e,t){if(null===t)throw new Error("part data is not completed");var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}),new Uint8Array(0)),f=Ae(Ug,$g(n),$g(0)),i=Ae(f,i),Fg.multipartComplete=!0,e.next=7,ev(i,!0);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $g(e){return new Uint8Array([e>>8,255&e])}function ev(e){return tv.apply(this,arguments)}function tv(){return(tv=Vg(regeneratorRuntime.mark((function e(t){var r,n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],e.next=3,Kg(t,r);case 3:if(!Zg(n=e.sent)){e.next=8;break}return e.next=7,Gg(n.currentFrame,n.frameCount,n.partData);case 7:return e.abrupt("return");case 8:Fg.unsignedData=n;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rv(){return(rv=Vg(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Fg={},e.prev=1,r=Wg(t),e.next=5,ev(r,!1);case 5:return e.abrupt("return",{signer:Fg.unsignedData.data.account});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{error:e.t0.message});case 11:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function nv(){return Fg}var iv=new Uint8Array([83]),fv=new Uint8Array([1]);function cv(e,t,r,n){return Ae(iv,fv,new Uint8Array([t]),Vc(e),Object(ge.a)(r),Object(ge.a)(n))}function av(e){for(var t=[],r=0;r<e.length;)t.push(e.subarray(r,r+1024)),r+=1024;return t.map((function(e,r){return Ae(Ug,$g(t.length),$g(r),e)}))}var ov={kusama:" ",polkadot:" "};function sv(e,t){if(!e)throw new Error(function(e){return"function"==typeof e}(t)?t():t)}const dv=/^0x[a-fA-F0-9]+$/;function uv(e,t=-1,r=!1){return!("string"!=typeof e||"0x"!==e&&!dv.test(e))&&(-1===t?e.length%2==0||r:e.length===2+Math.ceil(t/4))}const hv=/^[a-fA-F0-9]+$/;function lv(e){if(!e)return"";if(function(e){return!(!e||!uv(e,-1,!0)||"0x"!==e.substr(0,2))}(e))return e.substr(2);if(hv.test(e))return e;throw new Error(`Invalid hex ${e} passed to hexStripPrefix`)}var pv=r(360);const bv=new(r(366).a);function mv(e){return e?uv(e)?function(e,t=-1){if(!e)return new Uint8Array;sv(uv(e),()=>`Expected hex value to convert, found '${e}'`);const r=lv(e),n=r.length/2,i=Math.ceil(-1===t?n:t/8),f=new Uint8Array(i),c=Math.max(0,i-n);for(let e=0;e<i;e++)f[e+c]=parseInt(r.substr(2*e,2),16);return f}(e):function(e){return"string"==typeof e||e instanceof String}(e)?function(e){return e?bv.encode(e.toString()):new Uint8Array}(e):Array.isArray(e)||Object(pv.a)(e)?new Uint8Array(e):(sv(function(e){return function(e,t){return e instanceof t}(e,Uint8Array)}(e),()=>`Unable to convert ${e.toString()} (typeof ${typeof e}) to a Uint8Array`),e):new Uint8Array}function yv(e,t){return e.length===t.length&&0===function(e,t){return function(e,t){let r=0;for(;;){const n=r>=e.length,i=r>=t.length;if(n&&i)return 0;if(n)return-1;if(i)return 1;if(e[r]!==t[r])return e[r]>t[r]?1:-1;r++}}(mv(e),mv(t))}(e,t)}function gv(e,t){return yv(mv(e),mv(t))}const vv=mv("Ethereum Signed Message:\n"),wv=mv("<Bytes>"),Mv=mv("</Bytes>"),Ov=wv.length+Mv.length;function xv(e,t){return e.length>=Ov&&gv(e.subarray(0,wv.length),wv)&&gv(e.slice(-Mv.length),Mv)||t&&e.length>=vv.length&&gv(e.subarray(0,vv.length),vv)}function Sv(e){const t=mv(e);return xv(t,!0)?t:function(...e){let t=0,r=0;const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=mv(e[r]),t+=n[r].length;const i=new Uint8Array(t);for(let e=0;e<n.length;e++)i.set(n[e],r),r+=n[e].length;return i}(wv,t,Mv)}function kv(e){Object(T.a)(32===e.length,"Expected valid 32-byte private key as a seed");const t=Sc.keyFromPrivate(e);return{publicKey:new Uint8Array(t.getPublic().encodeCompressed()),secretKey:dr(t.getPrivate(),kc)}}function jv(e,t=!1){if(!t&&Qi()){const t=Hi(e);return{publicKey:t.slice(32),secretKey:t.slice(0,64)}}return Ky.a.sign.keyPair.fromSeed(e)}function Pv(e){return{publicKey:e.slice(64,96),secretKey:e.slice(0,64)}}function Av(e){return Pv(qi(e))}var Ev=r(149),Iv=r.n(Ev);function Tv(e){return function(e){Object(T.a)(e&&"string"==typeof e,"Expected non-null, non-empty base64 string input"),Object(T.a)(/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e),"Invalid base64 encoding")}(e),Iv.a.toByteArray(e)}function Rv(e,t=!1){return Qi()&&!t?Bi(e):function(e){try{Ry(e)}catch(e){return!1}return!0}(e)}function Nv(e,t="",r=!1){if(Object(T.a)(Rv(e),"Invalid bip39 mnemonic specified"),Qi()&&!r)return _i(e,t);return ky(function(e,t=!1){return Qi()&&!t?Ni(e):Ry(e)}(e),Object(ni.a)("mnemonic"+t)).password.slice(0,32)}const _v=Sc.curve;const Cv=Object(ni.a)("Bitcoin seed");function Bv(e,t){return{chainCode:t,publicKey:kv(e).publicKey,secretKey:e}}function Hv(e,t){const r=dr(t,{bitLength:32,isLe:!1}),n=t>=2147483648?Ae(new Uint8Array(1),e.secretKey,r):Ae(e.publicKey,r);try{const t=Sy(e.chainCode,n);return Bv(function(e,t){Object(T.a)(Object(Oe.a)(e)&&32===e.length,"Expected seckey to be an Uint8Array with length 32"),Object(T.a)(Object(Oe.a)(t)&&32===t.length,"Expected tweak to be an Uint8Array with length 32");const r=new Je.a(t);return Object(T.a)(r.cmp(_v.n)<0,"Tweak parameter is out of range"),r.iadd(new Je.a(e)),r.cmp(_v.n)>=0&&r.isub(_v.n),Object(T.a)(!r.isZero(),"Invalid resulting private key"),dr(r,{bitLength:256,isLe:!1})}(e.secretKey,t.slice(0,32)),t.slice(32))}catch(r){return Hv(e,t+1)}}function Dv(e,t=""){const r=Sy(Cv,e),n=Bv(r.slice(0,32),r.slice(32));return t&&"m"!==t&&"M"!==t&&"m'"!==t&&"M'"!==t?(Object(T.a)(function(e){if(!e.startsWith("m/"))return!1;const t=e.split("/").slice(1);return t.every(e=>/^\d+'?$/.test(e))&&!t.map(e=>parseInt(e.replace(/'$/,""),10)).some(e=>isNaN(e)||e>=2147483648||e<0)}(t),"Invalid derivation path"),t.split("/").slice(1).reduce((e,t)=>Hv(e,parseInt(t,10)+(t.length>1&&t.endsWith("'")?2147483648:0)),n)):n}const Lv=If(Object(ni.a)("Secp256k1HDKD"));function zv(e,{chainCode:t,isHard:r}){return Object(T.a)(r,"A soft key was found in the path (and is unsupported)"),kv(function(e,t){return $i(Ae(Lv,e,t),256)}(e.secretKey.subarray(0,32),t))}const Vv=If(Object(ni.a)("Ed25519HDKD"));function qv({publicKey:e,secretKey:t}){return Ae(t,e).slice()}const Uv={ecdsa:zv,ed25519:function(e,{chainCode:t,isHard:r}){return Object(T.a)(r,"A soft key was found in the path (and is unsupported)"),jv(function(e,t){return $i(Ae(Vv,e,t))}(e.secretKey.subarray(0,32),t))},ethereum:zv,sr25519:function(e,{chainCode:t,isSoft:r}){return r?function(e,t){return Pv(Vi(qv(e),t))}(e,t):function(e,t){return Pv(zi(qv(e),t))}(e,t)}};function Fv(e,t,r){const n=Uv[r];return t.reduce((e,t)=>n(e,t),e)}function Wv(e,{secretKey:t},r="blake2"){Object(T.a)(32===(null==t?void 0:t.length),"Expected valid secp256k1 secretKey, 32-bytes");const n=Sc.keyFromPrivate(t).sign(Yy(r,e));return Ae(dr(n.r,kc),dr(n.s,kc),new Uint8Array([n.recoveryParam||0]))}const Kv=new Uint8Array;const Xv=new Uint8Array;const Zv={N:32768,p:1,r:8};var Gv=r(359),Yv=r.n(Gv);function Jv(e,t=xy(),r=Zv){return{params:r,password:Qi()?Yi(Object(ge.a)(e),t,Math.log2(r.N),r.r,r.p):Rc(Yv()(Object(hb.a)(Object(ge.a)(e)),Object(hb.a)(t),r.N,r.r,r.p,64)),salt:t}}const Qv=["scrypt","xsalsa20-poly1305"],$v=["none"];function ew(e,t,r=Qv){Object(T.a)(e,"No encrypted data available to decode"),Object(T.a)(t||!r.includes("xsalsa20-poly1305"),"Password required to decode encrypted data");let n=e;if(t){let i;if(r.includes("scrypt")){const{params:r,salt:n}=function(e){const t=e.subarray(0,32),r=or(e.subarray(32,36),{isLe:!0}).toNumber(),n=or(e.subarray(36,40),{isLe:!0}).toNumber(),i=or(e.subarray(40,44),{isLe:!0}).toNumber();return Object(T.a)(r===Zv.N&&n===Zv.p&&i===Zv.r,"Invalid injected scrypt params found"),{params:{N:r,p:n,r:i},salt:t}}(e);i=Jv(t,n,r).password,e=e.subarray(44)}else i=Object(ni.a)(t);n=function(e,t,r){return Ky.a.secretbox.open(e,t,r)||null}(e.subarray(24),e.subarray(0,24),function(e,t=-1,r=!1){const n=Math.ceil(t/8);if(-1===t||e.length===n)return e;if(e.length>n)return e.subarray(0,n);const i=new Uint8Array(n);return r?i.set(e,0):i.set(e,n-e.length),i}(i,256,!0))}return Object(T.a)(n,"Unable to decode using the supplied passphrase"),n}const tw=new Uint8Array([161,35,3,33,0]),rw=new Uint8Array([48,83,2,1,1,48,5,6,3,43,101,112,4,34,4,32]),nw=rw.length;function iw({publicKey:e,secretKey:t},r){Object(T.a)(t,"Expected a valid secretKey to be passed to encode");const n=Ae(rw,t,tw,e);if(!r)return n;const{params:i,password:f,salt:c}=Jv(r),{encrypted:a,nonce:o}=function(e,t,r=xy(24)){return{encrypted:Ky.a.secretbox(e,r,t),nonce:r}}(n,f.subarray(0,32));return Ae(function(e,{N:t,p:r,r:n}){return Ae(e,dr(t,{bitLength:32,isLe:!0}),dr(r,{bitLength:32,isLe:!0}),dr(n,{bitLength:32,isLe:!0}))}(c,i),o,a)}function fw(e){return Iv.a.fromByteArray(Object(ge.a)(e))}function cw(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 aw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cw(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ow(e,{address:t,meta:r},n,i){return aw(aw({},function(e,t,r){return{encoded:fw(e),encoding:{content:t,type:r?Qv:$v,version:"3"}}}(n,["pkcs8",e],i)),{},{address:t,meta:r})}function sw(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 dw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sw(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const uw=new Uint8Array,hw={ecdsa:kv,ed25519:jv,ethereum:kv,sr25519:Av},lw={ecdsa:new Uint8Array([2]),ed25519:new Uint8Array([0]),ethereum:new Uint8Array([2]),sr25519:new Uint8Array([1])},pw={ecdsa:(e,t)=>Wv(e,t,"blake2"),ed25519:function(e,{publicKey:t,secretKey:r},n=!1){Object(T.a)(r,"Expected a valid secretKey");const i=Object(ge.a)(e);return Qi()&&!n?Di(t,r.subarray(0,32),i):Ky.a.sign.detached(i,r)},ethereum:(e,t)=>Wv(e,t,"keccak"),sr25519:function(e,{publicKey:t,secretKey:r}){return Object(T.a)(32===(null==t?void 0:t.length),"Expected a valid publicKey, 32-bytes"),Object(T.a)(64===(null==r?void 0:r.length),"Expected a valid secretKey, 64-bytes"),Ui(t,r,Object(ge.a)(e))}},bw={ecdsa:e=>e.length>32?$i(e):e,ed25519:e=>e,ethereum:e=>20===e.length?e:Mc(jc(e)),sr25519:e=>e};function mw(e){return!e||0===e.length||e.every(e=>0===e)}function yw(e,t,r){return $i(Ae(t||"",r||"",e))}function gw({toSS58:e,type:t},{publicKey:r,secretKey:n},i={},f=null,c){const a=(e,i)=>{const a=function(e,t,r){const n=ew(t,e,Array.isArray(r)||Object(I.a)(r)?r:[r]),i=n.subarray(0,rw.length);Object(T.a)(td(i,rw),"Invalid Pkcs8 header found in body");let f=n.subarray(nw,nw+64),c=nw+64,a=n.subarray(c,c+tw.length);td(a,tw)||(c=nw+32,f=n.subarray(nw,c),a=n.subarray(c,c+tw.length),Object(T.a)(td(a,tw),"Invalid Pkcs8 divider found in body"));const o=c+tw.length;return{publicKey:n.subarray(o,o+32),secretKey:f}}(e,i||f,c);if(64===a.secretKey.length)r=a.publicKey,n=a.secretKey;else{const e=hw[t](a.secretKey);r=e.publicKey,n=e.secretKey}},o=e=>(mw(n)&&f&&a(e,f),f=iw({publicKey:r,secretKey:n},e),c=void 0,f),s=()=>{const n=bw[t](r);return"ethereum"===t?Pc(n):e(n)};return{get address(){return s()},get addressRaw(){const e=bw[t](r);return"ethereum"===t?e.slice(-20):e},get isLocked(){return mw(n)},get meta(){return i},get publicKey(){return r},get type(){return t},decodePkcs8:a,derive:(i,f)=>{Object(T.a)("ethereum"!==t,"Unable to derive on this keypair"),Object(T.a)(!mw(n),"Cannot derive on a locked keypair");const{path:c}=qy(i),a=Fv({publicKey:r,secretKey:n},c,t);return gw({toSS58:e,type:t},a,f,null)},encodePkcs8:e=>o(e),lock:()=>{n=new Uint8Array},setMeta:e=>{i=dw(dw({},i),e)},sign:(e,i={})=>(Object(T.a)(!mw(n),"Cannot sign with a locked key pair"),Ae(i.withType?lw[t]:uw,pw[t](Object(ge.a)(e),{publicKey:r,secretKey:n}))),toJson:e=>{const n=["ecdsa","ethereum"].includes(t)?20===r.length?Object(ve.a)(r):Object(ve.a)(function(e){return Object(T.a)([33,65].includes(e.length),"Invalid publicKey provided"),new Uint8Array(Sc.keyFromPublic(e).getPublic().encodeCompressed())}(r)):s();return ow(t,{address:n,meta:i},o(e),!!e)},unlock:e=>a(e),verify:(e,r,n)=>rg(e,r,bw[t](Object(ge.a)(n))).isValid,vrfSign:(e,i,f)=>{if(Object(T.a)(!mw(n),"Cannot sign with a locked key pair"),"sr25519"===t)return function(e,{secretKey:t},r=Kv,n=Kv){return Object(T.a)(64===(null==t?void 0:t.length),"Invalid secretKey, expected 64-bytes"),Wi(t,Object(ge.a)(r),Object(ge.a)(e),Object(ge.a)(n))}(e,{secretKey:n},i,f);const c=pw[t](Object(ge.a)(e),{publicKey:r,secretKey:n});return Ae(yw(c,i,f),c)},vrfVerify:(e,n,i,f,c)=>{const a=bw[t](Object(ge.a)(i));if("sr25519"===t)return function(e,t,r,n=Xv,i=Xv){const f=Object(ge.a)(r),c=Object(ge.a)(t);return Object(T.a)(32===f.length,"Invalid publicKey, expected 32-bytes"),Object(T.a)(96===c.length,"Invalid vrfSign output, expected 96 bytes"),Ki(f,Object(ge.a)(n),Object(ge.a)(e),Object(ge.a)(i),c)}(e,n,r,f,c);return rg(e,Ae(lw[t],n.subarray(32)),a).isValid&&td(n.subarray(0,32),yw(n.subarray(32),f,c))}}}var vw=j("map");class ww{constructor(){Object.defineProperty(this,vw,{writable:!0,value:{}})}add(e){return S(this,vw)[vw][Vc(e.address).toString()]=e,e}all(){return Object.values(S(this,vw)[vw])}get(e){const t=S(this,vw)[vw][Vc(e).toString()];return Object(T.a)(t,()=>`Unable to retrieve keypair '${Object(Oe.a)(e)||Object(Me.a)(e)?Object(ve.a)(Object(ge.a)(e)):e}'`),t}remove(e){delete S(this,vw)[vw][Vc(e).toString()]}}const Mw={ecdsa:e=>kv(e),ed25519:e=>jv(e),ethereum:e=>kv(e),sr25519:e=>Av(e)};var Ow=j("pairs"),xw=j("type"),Sw=j("ss58");class kw{constructor(e={}){Object.defineProperty(this,Ow,{writable:!0,value:void 0}),Object.defineProperty(this,xw,{writable:!0,value:void 0}),Object.defineProperty(this,Sw,{writable:!0,value:void 0}),this.decodeAddress=Vc,this.encodeAddress=(e,t)=>"ethereum"===this.type?Pc(e):qc(e,Object(I.a)(t)?S(this,Sw)[Sw]:t),e.type=e.type||"ed25519",Object(T.a)(["ecdsa","ethereum","ed25519","sr25519"].includes(e.type||"undefined"),()=>"Expected a keyring type of either 'ed25519', 'sr25519', 'ethereum' or 'ecdsa', found '"+(e.type||"unknown")),S(this,Ow)[Ow]=new ww,S(this,Sw)[Sw]=e.ss58Format,S(this,xw)[xw]=e.type}get pairs(){return this.getPairs()}get publicKeys(){return this.getPublicKeys()}get type(){return S(this,xw)[xw]}addPair(e){return S(this,Ow)[Ow].add(e)}addFromAddress(e,t={},r=null,n=this.type,i,f){const c=this.decodeAddress(e,i);return this.addPair(gw({toSS58:this.encodeAddress,type:n},{publicKey:c,secretKey:new Uint8Array},t,r,f))}addFromJson(e,t){return this.addPair(this.createFromJson(e,t))}addFromMnemonic(e,t={},r=this.type){return this.addFromUri(e,t,r)}addFromPair(e,t={},r=this.type){return this.addPair(this.createFromPair(e,t,r))}addFromSeed(e,t={},r=this.type){return this.addPair(gw({toSS58:this.encodeAddress,type:r},Mw[r](e),t,null))}addFromUri(e,t={},r=this.type){return this.addPair(this.createFromUri(e,t,r))}createFromJson({address:e,encoded:t,encoding:{content:r,type:n,version:i},meta:f},c){Object(T.a)("3"!==i||"pkcs8"===r[0],()=>`Unable to decode non-pkcs8 type, [${r.join(",")}] found}`);const a="0"!==i&&Array.isArray(r)?r[1]:this.type,o=Array.isArray(n)?n:[n];Object(T.a)(["ed25519","sr25519","ecdsa","ethereum"].includes(a),()=>"Unknown crypto type "+a);const s=Object(Me.a)(e)?Object(Pe.a)(e):this.decodeAddress(e,c),d=Object(Me.a)(t)?Object(Pe.a)(t):Tv(t);return gw({toSS58:this.encodeAddress,type:a},{publicKey:s,secretKey:new Uint8Array},f,d,o)}createFromPair(e,t={},r=this.type){return gw({toSS58:this.encodeAddress,type:r},e,t,null)}createFromUri(e,t={},r=this.type){const n=e.startsWith("//")?"bottom drive obey lake curtain smoke basket hold race lonely fit walk"+e:e,{derivePath:i,password:f,path:c,phrase:a}=Fy(n);let o;const s=Object(Me.a)(a,256);if(s)o=Object(Pe.a)(a);else{const e=a,t=e.split(" ");[12,15,18,21,24].includes(t.length)?o="ethereum"===r?function(e,t="",r=!1,n=32){return Object(T.a)(Rv(e),"Invalid bip39 mnemonic specified"),Object(T.a)([32,64].includes(n),()=>`Invalid seed length ${n}, expected 32 or 64`),n&&32===n?Qi()&&!r?Ci(e,t):Ty(e,t).subarray(0,32):64===n?Ty(e,t):new Uint8Array}(a,"",!1,64):Nv(a,f):(Object(T.a)(e.length<=32,"specified phrase is not a valid mnemonic and is invalid as a raw seed at > 32 bytes"),o=Object(ni.a)(e.padEnd(32)))}const d="ethereum"===r?s?Mw[r](o):Dv(o,i.substring(1)):Fv(Mw[r](o),c,r);return gw({toSS58:this.encodeAddress,type:r},d,t,null)}getPair(e){return S(this,Ow)[Ow].get(e)}getPairs(){return S(this,Ow)[Ow].all()}getPublicKeys(){return S(this,Ow)[Ow].all().map(({publicKey:e})=>e)}removePair(e){S(this,Ow)[Ow].remove(e)}setSS58Format(e){S(this,Sw)[Sw]=e}toJson(e,t){return S(this,Ow)[Ow].get(e).toJson(t)}}function jw(e){return function(e){if(Array.isArray(e))return Ew(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Aw(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||Aw(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Aw(e,t){if(e){if("string"==typeof e)return Ew(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ew(e,t):void 0}}function Ew(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Iw(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 Tw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iw(Object(r),!0).forEach((function(t){Rw(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iw(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nw(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function _w(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){Nw(f,n,i,c,a,"next",e)}function a(e){Nw(f,n,i,c,a,"throw",e)}c(void 0)}))}}var Cw=new kw({ss58Format:0,type:"sr25519"});function Bw(){return(Bw=_w(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Cy(),e.abrupt("return",{mnemonic:t});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hw(){return(Hw=_w(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Od();case 2:return n={},r.forEach((function(e){n[e]={}})),t.forEach((function(e){var t=Cw.addFromJson(e);r.forEach((function(e){var r=Object(ve.a)(t.publicKey);n[e][r]=Cw.encodeAddress(t.publicKey,e)}))})),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dw(){return(Dw=_w(regeneratorRuntime.mark((function e(t,r,n){var i,f,c,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("treasury.approveProposal"!=r.txName){e.next=6;break}return e.next=3,Cg.makeTreasuryProposalSubmission(t,n[0],!1);case 3:i=e.sent,e.next=13;break;case 6:if("treasury.rejectProposal"!=r.txName){e.next=12;break}return e.next=9,Cg.makeTreasuryProposalSubmission(t,n[0],!0);case 9:i=e.sent,e.next=13;break;case 12:i=(f=t.tx[r.module])[r.call].apply(f,jw(n));case 13:return c=r.sender.address,r.proxy&&(i=t.tx.recovery.asRecovered(r.sender.address,i),c=Cw.encodeAddress(Object(Pe.a)(r.proxy.pubKey))),e.next=17,i.paymentInfo(c);case 17:return a=e.sent,e.abrupt("return",a);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lw(e,t){if(!t||!t.events)return{};var r=!1,n="";return t.events.filter((function(e){return!!e.event})).map((function(t){var i=t.event,f=i.data,c=i.method,a=i.section;if("system"===a&&"ExtrinsicFailed"===c){var o=Pw(f,1)[0],s=o.type;if(o.isModule)try{var d=o.asModule,u=e.registry.findMetaError(new Uint8Array([d.index.toNumber(),d.error.toNumber()]));s="".concat(u.section,".").concat(u.name)}catch(e){}window.send("txUpdateEvent",{title:"".concat(a,".").concat(c),message:s}),n=s}else window.send("txUpdateEvent",{title:"".concat(a,".").concat(c),message:"ok"}),"system"==a&&"ExtrinsicSuccess"==c&&(r=!0)})),{success:r,error:n}}function zw(){return(zw=_w(regeneratorRuntime.mark((function e(t,r,n){var i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=Fy("".concat(t).concat(r)),f=i.path,"ed25519"!==n||!f.some((function(e){return e.isSoft}))){e.next=4;break}return e.abrupt("return","Soft derivation paths are not allowed on ed25519");case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",e.t0.message);case 9:return e.abrupt("return",null);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function Vw(){return(Vw=_w(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=nv().unsignedData,i=Cw.getPair(n.data.account);try{var f;if(i.isLocked||i.lock(),i.decodePkcs8(r),window.api)f=window.api.registry.createType("ExtrinsicPayload",n.data.data,{version:window.api.extrinsicVersion});else{var c=new Md;c.setMetadata(new Mn(c,ov[t])),f=c.createType("ExtrinsicPayload",n.data.data,{version:4})}e(f.sign(i))}catch(t){e({error:t.message})}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qw(){return(qw=_w(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=Cw.getPair(r.address);try{var i;n.isLocked||n.lock(),n.decodePkcs8(t),window.api?i=window.api.registry:(i=new Md).setMetadata(new Mn(i,ov.kusama)),i.setSignedExtensions(r.signedExtensions),e(i.createType("ExtrinsicPayload",r,{version:r.version}).sign(n))}catch(t){e({error:t.message})}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Uw(){return(Uw=_w(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=Cw.getPair(r.address);try{n.isLocked||n.lock(),n.decodePkcs8(t),e({signature:Object(ve.a)(n.sign(Sv(r.data)))})}catch(t){e({error:t.message})}})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fw(){return(Fw=_w(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",rg(Sv(t),r,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ww={initKeys:function(e,t){return Hw.apply(this,arguments)},gen:function(){return Bw.apply(this,arguments)},recover:function(e,t,r,n){return new Promise((function(i,f){var c,a="",o="";try{switch(e){case"mnemonic":c=Cw.addFromMnemonic(r,{},t),a=r;break;case"rawSeed":c=Cw.addFromUri(r,{},t),o=r;break;case"keystore":var s=JSON.parse(r);c=Cw.addFromJson(s);try{c.decodePkcs8(n)}catch(e){i(null)}i(Tw({pubKey:Object(ve.a)(c.publicKey)},c.toJson(n)))}}catch(e){i({error:e.message})}if(c.address){var d=c.toJson(n);c.lock(),Cw.addFromJson(d),i(Tw({pubKey:Object(ve.a)(c.publicKey),mnemonic:a,rawSeed:o},d))}else i(null)}))},txFeeEstimate:function(e,t,r){return Dw.apply(this,arguments)},sendTx:function(e,t,r,n,i){return new Promise(function(){var f=_w(regeneratorRuntime.mark((function f(c){var a,o,s,d,u;return regeneratorRuntime.wrap((function(f){for(;;)switch(f.prev=f.next){case 0:if("treasury.approveProposal"!=t.txName){f.next=6;break}return f.next=3,Cg.makeTreasuryProposalSubmission(e,r[0],!1);case 3:a=f.sent,f.next=13;break;case 6:if("treasury.rejectProposal"!=t.txName){f.next=12;break}return f.next=9,Cg.makeTreasuryProposalSubmission(e,r[0],!0);case 9:a=f.sent,f.next=13;break;case 12:a=(o=e.tx[t.module])[t.call].apply(o,jw(r));case 13:if(s=function(){},d=function(t){if(t.status.isInBlock||t.status.isFinalized){var r=Lw(e,t),n=r.success,f=r.error;n&&c({hash:a.hash.toString(),blockHash:t.status.asInBlock.toHex()}),f&&c({error:f}),s()}else window.send(i,t.status.type)},!t.isUnsigned){f.next=18;break}return a.send(d).then((function(e){s=e})).catch((function(e){c({error:e.message})})),f.abrupt("return");case 18:t.proxy?(a=e.tx.recovery.asRecovered(t.sender.address,a),u=Cw.getPair(Object(Pe.a)(t.proxy.pubKey))):u=Cw.getPair(Object(Pe.a)(t.sender.pubKey));try{u.decodePkcs8(n)}catch(e){c({error:"password check failed"})}a.signAndSend(u,{tip:new ig.a(t.tip,10)},d).then((function(e){s=e})).catch((function(e){c({error:e.message})}));case 21:case"end":return f.stop()}}),f)})));return function(e){return f.apply(this,arguments)}}())},checkPassword:function(e,t){return new Promise((function(r){var n=Cw.getPair(Object(Pe.a)(e));try{n.isLocked||n.lock(),n.decodePkcs8(t)}catch(e){r(null)}r({success:!0})}))},changePassword:function(e,t,r){return new Promise((function(n){var i=Object(Pe.a)(e),f=Cw.getPair(i);try{f.isLocked||f.lock(),f.decodePkcs8(t)}catch(e){return void n(null)}var c=f.toJson(r);Cw.removePair(i),Cw.addFromJson(c),n(Tw({pubKey:Object(ve.a)(f.publicKey)},c))}))},checkDerivePath:function(e,t,r){return zw.apply(this,arguments)},parseQrCode:function(e){return rv.apply(this,arguments)},signAsync:function(e,t){return Vw.apply(this,arguments)},makeTx:function(e,t,r,n){return new Promise((function(i){var f=t.proxy?qc(Object(Pe.a)(t.proxy.pubKey),n):t.sender.address;e.derive.tx.signingInfo(f).then(function(){var n=Vg(regeneratorRuntime.mark((function n(c){var a,o,s,d,u,h,l,p,b,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=c.header,o=c.mortalLength,s=c.nonce,"treasury.approveProposal"!=t.txName){n.next=7;break}return n.next=4,Cg.makeTreasuryProposalSubmission(e,r[0],!1);case 4:d=n.sent,n.next=14;break;case 7:if("treasury.rejectProposal"!=t.txName){n.next=13;break}return n.next=10,Cg.makeTreasuryProposalSubmission(e,r[0],!0);case 10:d=n.sent,n.next=14;break;case 13:d=(u=e.tx[t.module])[t.call].apply(u,Hg(r));case 14:t.proxy&&(d=e.tx.recovery.asRecovered(t.sender.address,d)),h=e.registry.createType("SignerPayload",{address:f,blockHash:a.hash,blockNumber:a?a.number:0,era:e.registry.createType("ExtrinsicEra",{current:a.number,period:o}),genesisHash:e.genesisHash,method:d.method,nonce:s,signedExtensions:["CheckNonce"],tip:t.tip,runtimeVersion:{specVersion:e.runtimeVersion.specVersion,transactionVersion:e.runtimeVersion.transactionVersion},version:e.extrinsicVersion}),l=h.toPayload(),p=l.method.length>5e3,b=e.registry.createType("ExtrinsicPayload",l,{version:l.version}),m=p?$i(b.toU8a(!0)):b.toU8a(),qg={tx:d,payload:h.toPayload()},i({qrAddress:l.address,qrIsHashed:p,qrPayload:av(cv(l.address,p?1:2,m,e.genesisHash))[0]});case 22:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()).catch((function(e){return i({error:e.message})}))}))},addSignatureAndSend:function(e,t,r){return new Promise((function(n){var i=qg,f=i.tx,c=i.payload;if(f.addSignature){f.addSignature(t,"0x".concat(r),c);var a=function(){};f.send((function(t){if(t.status.isInBlock||t.status.isFinalized){var r=Lw(e,t),i=r.success,c=r.error;i&&n({hash:f.hash.toString(),blockHash:t.status.asInBlock.toHex()}),c&&n({error:c}),a()}else window.send("txStatusChange",t.status.type)})).then((function(e){a=e})).catch((function(e){n({error:e.message})}))}else n({error:"invalid tx"})}))},signTxAsExtension:function(e,t){return qw.apply(this,arguments)},signBytesAsExtension:function(e,t){return Uw.apply(this,arguments)},verifySignature:function(e,t,r){return Fw.apply(this,arguments)}},Kw=r(361);const Xw=e=>$i(e,512),Zw=32,Gw=Xw(new Uint8Array(32)),Yw={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},Jw={cx:Zw,cy:Zw,fill:"#eee",r:Zw};function Qw(e){const{r:t,r3o4:r,ro2:n,ro4:i,rroot3o2:f,rroot3o4:c}=function(e){const t=e?20:24;return{r:t,r3o4:3*t/4,ro2:t/2,ro4:t/4,rroot3o2:t*Math.sqrt(3)/2,rroot3o4:t*Math.sqrt(3)/4}}(e);return[[Zw,Zw-t],[Zw,Zw-n],[Zw-c,Zw-r],[Zw-f,Zw-n],[Zw-c,Zw-i],[Zw-f,Zw],[Zw-f,Zw+n],[Zw-c,Zw+i],[Zw-c,Zw+r],[Zw,Zw+t],[Zw,Zw+n],[Zw+c,Zw+r],[Zw+f,Zw+n],[Zw+c,Zw+i],[Zw+f,Zw],[Zw+f,Zw-n],[Zw+c,Zw-i],[Zw+c,Zw-r],[Zw,Zw]]}function $w(e){const t=Object.values(Yw).map(e=>e.freq).reduce((e,t)=>e+t),r=function(e){return Xw(Vc(e)).map((e,t)=>(e+256-Gw[t])%256)}(e),n=Math.floor((r[30]+256*r[31])%t),i=r[28]%6*3,f=Math.floor(70*r[29]/256+26)%80+30,c=function(e){let t=0;const r=Object.values(Yw).find(r=>(t+=r.freq,e<t));if(!r)throw new Error("Unable to find schema");return r}(n),a=Array.from(r).map((e,t)=>{const r=(e+t%28*58)%256;if(0===r)return"#444";if(255===r)return"transparent";const n=Math.floor(r%64*360/64),i=[53,15,35,75][Math.floor(r/64)];return`hsl(${n}, ${f}%, ${i}%)`});return c.colors.map((e,t)=>a[c.colors[t<18?(t+i)%18:18]])}function eM(e,{isAlternative:t}){const r=$w(e);return[Jw].concat(Qw(t).map(([e,t],n)=>({cx:e,cy:t,fill:r[n],r:5})))}function tM(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 rM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tM(Object(r),!0).forEach((function(t){nM(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iM(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function fM(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){iM(f,n,i,c,a,"next",e)}function a(e){iM(f,n,i,c,a,"throw",e)}c(void 0)}))}}var cM=new kw({ss58Format:0,type:"sr25519"});function aM(e){return oM.apply(this,arguments)}function oM(){return(oM=fM(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.map((function(e){var t=eM(e,{isAlternative:!1}).map((function(e){var t=e.cx,r=e.cy,n=e.fill,i=e.r;return"<circle cx='".concat(t,"' cy='").concat(r,"' fill='").concat(n,"' r='").concat(i,"' />")})).join("");return[e,"<svg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'>".concat(t,"</svg>")]})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sM(){return(sM=fM(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,aM(t.map((function(e){return cM.encodeAddress(Object(Pe.a)(e),2)})));case 2:return r=e.sent,e.abrupt("return",r.map((function(e,r){return e[0]=t[r],e})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dM(){return(dM=fM(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Od();case 2:return e.prev=2,r={},t.forEach((function(e){var t=Object(ve.a)(cM.decodeAddress(e));r[t]=e})),e.abrupt("return",r);case 8:return e.prev=8,e.t0=e.catch(2),window.send("log",{error:e.t0.message}),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function uM(){return(uM=fM(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Od();case 2:return n={},r.forEach((function(e){n[e]={},t.forEach((function(t){n[e][t]=cM.encodeAddress(Object(Pe.a)(t),e)}))})),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hM(){return(hM=fM(regeneratorRuntime.mark((function e(t,r,n){var i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(Kw.ss58Decode)(r,n).toJSON(),e.next=3,t.query.indices.accounts(i.data);case 3:return f=e.sent,e.abrupt("return",f);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lM(){return(lM=fM(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(r.map((function(e){return cM.encodeAddress(Object(Pe.a)(e),2)})).map((function(e){return Promise.all([t.query.staking.bonded(e),t.query.staking.ledger(e)])}))).then((function(e){return e.map((function(e,t){return[r[t],e[0],e[1].toHuman()?e[1].toHuman().stash:null]}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pM(){return(pM=fM(regeneratorRuntime.mark((function e(t,r,n){var i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(e){var t=e.lockedBreakdown.map((function(e){return rM(rM({},e),{},{use:fg(e.id.toHex())})}));return rM(rM({},e),{},{lockedBreakdown:t})},!n){e.next=4;break}return yy(t.derive.balances.all,[r],n,i),e.abrupt("return");case 4:return e.next=6,t.derive.balances.all(r);case 6:return f=e.sent,e.abrupt("return",i(f));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bM(){return(bM=fM(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.derive.accounts.indexes().then((function(e){return Promise.all(r.map((function(e){return t.derive.accounts.info(e)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mM,yM={encodeAddress:function(e,t){return uM.apply(this,arguments)},decodeAddress:function(e){return dM.apply(this,arguments)},queryAddressWithAccountIndex:function(e,t,r){return hM.apply(this,arguments)},genIcons:aM,genPubKeyIcons:function(e){return sM.apply(this,arguments)},queryAccountsBonded:function(e,t){return lM.apply(this,arguments)},getBalance:function(e,t,r){return pM.apply(this,arguments)},getAccountIndex:function(e,t){return bM.apply(this,arguments)}};function gM(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 vM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gM(Object(r),!0).forEach((function(t){wM(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var MM={falloff:.05,idealStake:.5,maxInflation:.1,minInflation:.025},OM=(wM(mM={},oy,vM(vM({},MM),{},{idealStake:.75})),wM(mM,sy,vM(vM({},MM),{},{idealStake:.75})),mM);function xM(e){return NM(e)||PM(e)||TM(e)||IM()}function SM(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 kM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SM(Object(r),!0).forEach((function(t){AM(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jM(e){return function(e){if(Array.isArray(e))return RM(e)}(e)||PM(e)||TM(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PM(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function AM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EM(e,t){return NM(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||TM(e,t)||IM()}function IM(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function TM(e,t){if(e){if("string"==typeof e)return RM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?RM(e,t):void 0}}function RM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function NM(e){if(Array.isArray(e))return e}function _M(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function CM(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){_M(f,n,i,c,a,"next",e)}function a(e){_M(f,n,i,c,a,"throw",e)}c(void 0)}))}}var BM=new ig.a("1".padEnd(13,"0"));function HM(e){return e.muln(1e3).div(BM).toNumber()/1e3}function DM(e,t,r){var n=[],i=[],f=[],c=[],a=0,o=0;return e.forEach((function(e){var s=e.era,d=e.eraReward,u=r.find((function(e){return e.era.eq(s)})),h=t.find((function(e){return e.era.eq(s)})),l=null!=u&&u.eraPoints.gtn(0)?HM(u.points.mul(d).div(u.eraPoints)):0,p=h?HM(h.total):0;o+=l,l>0&&a++,n.push(s.toHuman()),f.push(l),c.push((a?Math.ceil(100*o/a):0)/100),i.push(p)})),{chart:[i,f,c],labels:n}}function LM(e){var t=[],r=[],n=[],i=0,f=0;return e.forEach((function(e){var c=e.era,a=e.points;f+=a.toNumber(),t.push(c.toHuman()),a.gtn(0)&&i++,r.push((i?Math.ceil(100*f/i):0)/100),n.push(a)})),{chart:[n,r],labels:t}}function zM(e){var t=[],r=[],n=[],i=[],f=0,c=0;return e.forEach((function(e){var a=e.clipped,o=e.era,s=e.exposure,d=HM(a.total.unwrap()),u=HM(s.total.unwrap());c+=d,d>0&&f++,i.push((f?Math.ceil(100*c/f):0)/100),t.push(o.toHuman()),r.push(d),n.push(u)})),{chart:[r,n,i],labels:t}}function VM(){return(VM=CM(regeneratorRuntime.mark((function e(t,r){var n,i,f,c,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.staking.ownSlashes(r,!0);case 2:return n=e.sent,e.next=5,t.derive.staking.erasRewards();case 5:return i=e.sent,e.next=8,t.derive.staking.stakerPoints(r,!0);case 8:return f=e.sent,e.next=11,t.derive.staking.ownExposures(r,!0);case 11:return c=e.sent,a=LM(f),o=DM(i,n,f),s=zM(c),e.abrupt("return",{points:a,rewards:o,stakes:s});case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qM(e,t){var r={};return e.forEach((function(e,n){r[e]=t[n].filter((function(e){return!e.eraReward.isZero()}))})),{allRewards:r,rewardCount:Object.values(r).filter((function(e){return 0!==e.length})).length}}function UM(e,t){return Object.entries(e).reduce((function(e,r){var n=EM(r,2),i=n[0];return n[1].filter((function(e){return e.era.gte(t)})).forEach((function(t){Object.entries(t.validators).forEach((function(r){var n=EM(r,2),f=n[0],c=n[1].value,a=e.find((function(e){return e.validatorId===f}));if(a){var o=a.eras.find((function(e){return e.era.eq(t.era)}));o?o.stashes[i]=c:a.eras.push({era:t.era,stashes:AM({},i,c)}),a.available=a.available.add(c)}else e.push({available:c,eras:[{era:t.era,stashes:AM({},i,c)}],validatorId:f})}))})),e}),[]).sort((function(e,t){return t.available.cmp(e.available)}))}function FM(e,t){if(e){var r=function(e){return Object.entries(e).map((function(e){var t=EM(e,2),r=t[0],n=t[1];return{available:n.reduce((function(e,t){var r=t.validators;return Object.values(r).reduce((function(e,t){var r=t.value;return e.iadd(r)}),e)}),new ig.a(0)),rewards:n,stashId:r}})).filter((function(e){return!e.available.isZero()})).sort((function(e,t){return t.available.cmp(e.available)}))}(e);return{stashTotal:r.length?r.reduce((function(e,t){var r=t.available;return e.add(r)}),Qt):null,stashes:r,validators:UM(e,t)}}return{}}function WM(){return(WM=CM(regeneratorRuntime.mark((function e(t,r,n){var i,f,c,a,o,s,d,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=t.derive.staking)||void 0===i?void 0:i.erasHistoric();case 2:return f=e.sent,c=f.slice(-1*n),e.next=6,t.derive.staking.stakerRewardsMultiEras([r],c);case 6:return a=e.sent,o=qM([r],a),s=o.allRewards,d=Object(be.a)(t.tx.staking.payoutStakers)?new ig.a(0):new ig.a("1000000000"),u=FM(s,d),e.abrupt("return",{available:u.stashTotal,validators:u.validators});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var KM=new ig.a(864e5);function XM(){return(XM=CM(regeneratorRuntime.mark((function e(t){var r,n,i,f,c,a,o,s,d,u,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([t.derive.session.eraLength(),t.query.staking.historyDepth()]);case 2:if(r=e.sent,n=EM(r,2),i=n[0],f=n[1],!i||!f){e.next=21;break}o=KM.div((null===(c=t.consts.babe)||void 0===c?void 0:c.expectedBlockTime)||(null===(a=t.consts.timestamp)||void 0===a?void 0:a.minimumPeriod.muln(2))||new ig.a(6e3)),s=i.mul(f),d=[],u=2;case 11:if(!(h=o.muln(u)).gte(s)){e.next=15;break}return e.abrupt("break",19);case 15:d.push({text:u,unit:"day",value:h.div(i).toNumber()}),u*=3,e.next=11;break;case 19:return d.push({text:f.toNumber(),unit:"eras",value:f.toNumber()}),e.abrupt("return",d);case 21:return e.abrupt("return",[{text:0,unit:"",value:0}]);case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(){return(ZM=CM(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.query.staking.nominators.entries();case 2:return r=e.sent,e.abrupt("return",r.reduce((function(e,t){var r=EM(t,2),n=r[0],i=r[1];if(i.isSome&&n.args.length){var f=n.args[0].toString();i.unwrap().targets.forEach((function(t,r){var n=t.toString();e[n]?e[n].push(f):e[n]=[f]}))}return e}),{}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function GM(e){return!e.nextElected}function YM(e,t,r,n){var i=r.activeEra,f=r.eraLength,c=r.lastEra,a=r.sessionLength,o=e.createType("Exposure"),s=n&&c.sub(n).iadd($t);return[t.info.map((function(r){var n=r.accountId,d=r.exposure,u=void 0===d?o:d,h=r.stakingLedger,l=r.validatorPrefs,p=EM(u.total?[u.own.unwrap(),u.total.unwrap()]:[Qt,Qt],2),b=p[0],m=p[1],y=m.isZero(),g=(u.others||[]).reduce((function(t,r){var n=r.value,i=(void 0===n?e.createType("Compact<Balance>"):n).unwrap();return t.isZero()||i.lt(t)?i:t}),Qt);m.isZero()&&(m=b=h.total.unwrap());var v=n.toString(),w=c.isZero()?void 0:h.claimedRewards[h.claimedRewards.length-1],M=s&&w&&w.gt(s)?w:void 0;return M&&!a.eq($t)&&(M=c.sub(M).mul(f)),{accountId:n,bondOther:m.sub(b),bondOwn:b,bondShare:0,bondTotal:m,commissionPer:l.commission.unwrap().toNumber()/1e7,exposure:u,isActive:!y,isBlocking:!(!l.blocked||!l.blocked.isTrue),isElected:!GM(t)&&t.nextElected.some((function(e){return e.eq(n)})),key:v,knownLength:i.sub(h.claimedRewards[0]||i),lastPayout:M,minNominated:g,numNominators:(u.others||[]).length,numRecentPayouts:s?h.claimedRewards.filter((function(e){return e.gte(s)})).length:0,rankBondOther:0,rankBondOwn:0,rankBondTotal:0,rankNumNominators:0,rankOverall:0,rankReward:0,skipRewards:y,stakedReturn:0,stakedReturnCmp:0}})),Object.keys({})]}function JM(e,t,r){var n=function(e){return OM[e.genesisHash.toHex()]||MM}(e),i=n.falloff,f=n.idealStake,c=n.maxInflation,a=n.minInflation,o=t.muln(1e6).div(r).toNumber()/1e6,s=c/f,d=100*(a+(o<=f?o*(s-a/f):(s*f-a)*Math.pow(2,(f-o)/i)));return{inflation:d,stakedReturn:d/o}}function QM(e){return function(t,r){return t[e]=r+1,t}}function $M(e,t,r,n,i,f){var c=EM(YM(e,t,i,f),2),a=c[0],o=c[1],s=EM(YM(e,r,i),1)[0],d=a.filter((function(e){return e.isActive})).map((function(e){return e.bondTotal})).sort((function(e,t){return e.cmp(t)})),u=d.reduce((function(e,t){return e.iadd(t)}),new ig.a(0)),h=u.divn(d.length),l=JM(e,u,n);!h.isZero()&&a.forEach((function(e){e.skipRewards||(e.stakedReturn=l.stakedReturn*h.mul(ir).div(e.bondTotal).toNumber()/ir.toNumber(),e.stakedReturnCmp=e.stakedReturn*(100-e.commissionPer)/100)}));var p,b,m=a.reduce((function(e,t){var r=t.minNominated;return e.isZero()||r.lt(e)?r:e}),Qt),y=(p=$l([a,s]),b=[],p.filter((function(e){var t=e.accountId.toString();return!b.includes(t)&&(b.push(t),!0)})).sort((function(e,t){return t.bondTotal.cmp(e.bondTotal)})).map(QM("rankBondTotal")).sort((function(e,t){return e.stakedReturnCmp-t.stakedReturnCmp})).map(QM("rankReward")).sort((function(e,t){return t.stakedReturnCmp-e.stakedReturnCmp||e.commissionPer-t.commissionPer||t.rankBondTotal-e.rankBondTotal})).map(QM("rankOverall")).sort((function(e,t){return e.isFavorite===t.isFavorite?0:e.isFavorite?-1:1}))),g=y.map((function(e){return e.commissionPer})).sort((function(e,t){return e-t})),v=Math.floor(g.length/2),w=g.length?g.length%2?g[v]:(g[v-1]+g[v])/2:0,M=a.map((function(e){return e.key})),O=s.map((function(e){return e.key})),x=$l([M,O]);return{avgStaked:h,inflation:l,lowStaked:d[0]||Qt,medianComm:w,minNominated:m,nominators:o,totalIssuance:n,totalStaked:u,validatorIds:x,validators:y,waitingIds:O}}var eO=function(e){var t=e.activeEra,r=e.eraLength,n=e.sessionLength;return{activeEra:t,eraLength:r,lastEra:t.isZero()?Qt:t.subn(1),sessionLength:n}};function tO(){return(tO=CM(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([t.query.staking.historyDepth(),t.query.balances.totalIssuance(),t.derive.staking.electedInfo({withExposure:!0,withPrefs:!0}),t.derive.staking.waitingInfo({withPrefs:!0}),t.derive.session.info(),t.query.staking.minNominatorBond()]);case 2:return r=e.sent,n=r[1]&&r[2]&&r[3]&&r[4]?$M(t,r[2],r[3],r[1],eO(r[4]),r[0]):{},e.abrupt("return",kM(kM({inflation:{inflation:0,stakedReturn:0},medianComm:0},n),{},{minNominatorBond:r[5]}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rO(e,t){return nO.apply(this,arguments)}function nO(){return(nO=CM(regeneratorRuntime.mark((function e(t,r){var n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r,i=!1,e.next=4,Promise.all([t.query.staking.bonded(r),t.query.staking.ledger(r)]);case 4:return(f=e.sent)[0].isSome&&(i=!0),f[1].isSome&&(n=f[1].unwrap().stash.toString(),r!=n&&(i=!1)),e.abrupt("return",[n,i]);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iO(e){return e?e.toString():null}function fO(e,t,r,n){var i=EM(n,3),f=i[0],c=i[1],a=c.controllerId,o=c.exposure,s=c.nextSessionIds,d=c.nominators,u=c.rewardDestination,h=c.sessionIds,l=c.stakingLedger,p=c.validatorPrefs,b=i[2],m=!(null==d||!d.length),y=!(Array.isArray(b)?b[1].isEmpty:b.isEmpty)||!(null==r||!r.includes(t)),g=Ae.apply(void 0,jM(s.map((function(e){return e.toU8a()})))),v=Ae.apply(void 0,jM(h.map((function(e){return e.toU8a()})))),w=iO(a);return{controllerId:w,destination:null==u?void 0:u.toString().toLowerCase(),destinationId:(null==u?void 0:u.toNumber())||0,exposure:o,hexSessionIdNext:Object(ve.a)(g,48),hexSessionIdQueue:Object(ve.a)(v.length?v:g,48),isOwnController:e==w,isOwnStash:f,isStashNominating:m,isStashValidating:y,nominating:null==d?void 0:d.map(iO),sessionIds:(s.length?s:h).map(iO),stakingLedger:l,stashId:t,validatorPrefs:p}}function cO(e,t,r,n,i,f,c){var a,o=null===(a=e.consts.staking)||void 0===a?void 0:a.maxNominatorRewardedPerValidator,s=n.filter((function(e,t){if(r[t].isNone)return!1;var n=r[t].unwrap().lastNonzeroSlash;return!n.isZero()&&n.gte(f)})),d=c.map((function(e){return e.others.sort((function(e,t){return t.value.unwrap().cmp(e.value.unwrap())}))})).map((function(e,r){return!o||o.gtn(e.map((function(e){return e.who.toString()})).indexOf(t))?null:n[r]})).filter((function(e){return!!e&&!s.includes(e)})),u=c.map((function(e,r){return e.others.some((function(e){return e.who.eq(t)}))?null:n[r]})).filter((function(e){return!!e})),h=c.map((function(e,t){return e.total.unwrap().isZero()||u.includes(n[t])&&f.eq(i)?n[t]:null})).filter((function(e){return!!e})).filter((function(e){return!s.includes(e)&&!d.includes(e)})),l=n.filter((function(e){return!u.includes(e)&&!s.includes(e)&&!d.includes(e)}));return u=u.filter((function(e){return!h.includes(e)&&!s.includes(e)&&!d.includes(e)})),{nomsActive:l,nomsChilled:s,nomsInactive:u,nomsOver:d,nomsWaiting:h}}function aO(e,t,r){return oO.apply(this,arguments)}function oO(){return(oO=CM(regeneratorRuntime.mark((function e(t,r,n){var i,f,c,a,o,s,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.derive.session.indexes();case 2:return i=e.sent,e.next=5,Promise.all([t.query.staking.nominators(r)].concat(n.map((function(e){return t.query.staking.erasStakers(i.activeEra,e)}))).concat(n.map((function(e){return t.query.staking.slashingSpans(e)}))));case 5:return f=e.sent,c=xM(f),a=c[0],o=c.slice(1),s=o.slice(0,n.length),d=o.slice(n.length),e.abrupt("return",cO(t,r,d,n,i.activeEra,a.unwrapOrDefault().submittedIn,s));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sO(e,t){if(null==e||!e.unlocking||!t)return{mapped:[],total:Qt};var r=e.unlocking.filter((function(e){var t=e.remainingEras;return e.value.gt(Qt)&&t.gt(Qt)})).map((function(e){return[e,e.remainingEras.sub($t).imul(t.eraLength).iadd(t.eraLength).isub(t.eraProgress).toNumber()]})),n=r.reduce((function(e,t){var r=EM(t,1)[0].value;return e.iadd(r)}),new ig.a(0));return{mapped:r.map((function(e){return[Mr(e[0].value,{forceUnit:"-",withSi:!1}),e[1]]})),total:n}}function dO(){return(dO=CM(regeneratorRuntime.mark((function e(t,r){var n,i,f,c,a,o,s,d,u,h,l,p,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rO(t,r);case 2:return n=e.sent,i=EM(n,2),f=i[0],c=i[1],e.next=8,Promise.all([t.derive.staking.account(f),t.query.staking.validators(f),t.derive.staking.stashes().then((function(e){return e.map((function(e){return e.toString()}))})),t.derive.session.progress()]);case 8:if(a=e.sent,o=EM(a,4),s=o[0],d=o[1],u=o[2],h=o[3],l=fO(r,f,u,[c,s,d]),p=sO(s,h),!l.nominating||!l.nominating.length){e.next=20;break}return e.next=19,aO(t,f,l.nominating);case 19:b=e.sent;case 20:return e.abrupt("return",kM(kM({account:s},l),{},{inactives:b,unbondings:p}));case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uO(){return(uO=CM(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.query.staking.slashingSpans(r);case 2:return n=e.sent,e.abrupt("return",n.isNone?0:n.unwrap().prior.length+1);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var hO={loadValidatorRewardsData:function(e,t){return VM.apply(this,arguments)},getAccountRewardsEraOptions:function(e){return XM.apply(this,arguments)},loadAccountRewardsData:function(e,t,r){return WM.apply(this,arguments)},querySortedTargets:function(e){return tO.apply(this,arguments)},queryNominations:function(e){return ZM.apply(this,arguments)},getOwnStashInfo:function(e,t){return dO.apply(this,arguments)},getSlashingSpans:function(e,t){return uO.apply(this,arguments)}};function lO(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 pO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lO(Object(r),!0).forEach((function(t){bO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mO(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function yO(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){mO(f,n,i,c,a,"next",e)}function a(e){mO(f,n,i,c,a,"throw",e)}c(void 0)}))}}function gO(e){return function(e){if(Array.isArray(e))return MO(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||wO(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||wO(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wO(e,t){if(e){if("string"==typeof e)return MO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?MO(e,t):void 0}}function MO(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var OO=Object(ni.a)("modlpy/cfund"),xO=[[0,0],[0,1],[0,2],[0,3],[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]];function SO(e){var t;if(null===(t=e.consts.auctions)||void 0===t?void 0:t.leasePeriodsPerSlot){for(var r=[],n=0;e.consts.auctions.leasePeriodsPerSlot.gtn(n);n++)for(var i=n;e.consts.auctions.leasePeriodsPerSlot.gtn(i);i++)r.push([n,i]);return r}return xO}function kO(e,t,r){return r.sort((function(e,t){var r=vO(e,1),n=vO(r[0].args,1)[0],i=vO(t,1),f=vO(i[0].args,1)[0];return n.cmp(f)})).reduce((function(r,n){var i,f,c=vO(n,2),a=vO(c[0].args,1)[0],o=c[1],s=function(e,t,r){return r.isNone?[]:r.unwrap().reduce((function(r,n,i){if(n.isSome){var f=vO(n.unwrap(),3),c=f[0],a=f[1],o=f[2],s=t.leasePeriod||Qt,d=vO(e[i],2),u=d[0],h=d[1];r.push({accountId:c.toString(),firstSlot:s.addn(u).toNumber(),isCrowdloan:td(OO,c.subarray(0,OO.length)),lastSlot:s.addn(h).toNumber(),paraId:a.toString(),value:o})}return r}),[])}(e,t,o);return s.length&&(0===r.length||(i=s,f=r[r.length-1].winners,JSON.stringify({w:i})!==JSON.stringify({w:f})))&&r.push(function(e,t,r){var n=e.endBlock;return{blockNumber:n&&t?t.add(n):t||Qt,blockOffset:t||Qt,total:r.reduce((function(e,t){var r=t.value;return e.iadd(r)}),new ig.a(0)),winners:r}}(t,a,s)),r}),[]).reverse()}function jO(e,t,r,n){return r.info?{paraId:r.paraId,cap:r.info.cap,end:r.info.end,isCapped:r.info.cap.sub(r.info.raised).lt(t),isEnded:e.gt(r.info.end),isWinner:n.some((function(e){return e===r.paraId})),isCrowdloan:!0,firstSlot:r.info.firstPeriod.toJSON(),lastSlot:r.info.lastPeriod.toJSON(),value:r.info.raised}:null}function PO(e,t,r){if(e&&e.leasePeriod&&t){var n=e.leasePeriod,i=n.add(r);return t.filter((function(e){var t=e.firstSlot,r=e.isWinner,f=e.lastSlot;return!r&&t>=n.toNumber()&&f<=i.toNumber()})).sort((function(e,t){return t.value.cmp(e.value)}))}}function AO(e,t){return e.concat.apply(e,gO(t.filter((function(r){var n=r.firstSlot,i=r.lastSlot,f=r.paraId,c=r.value;return!e.some((function(e){return e.firstSlot==n&&e.lastSlot==i}))&&!t.some((function(e){return f!==e.paraId&&n==e.firstSlot&&i==e.lastSlot&&c.lt(e.value)}))})))).map((function(e){return t.find((function(t){var r=t.firstSlot,n=t.lastSlot,i=t.value;return e.firstSlot==r&&e.lastSlot==n&&e.value.lt(i)}))||e})).sort((function(e,t){return e.firstSlot==t.firstSlot?e.lastSlot>t.lastSlot?1:-1:e.firstSlot>t.firstSlot?1:-1}))}function EO(e){return IO.apply(this,arguments)}function IO(){return(IO=yO(regeneratorRuntime.mark((function e(t){var r,n,i,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([null===(r=t.query.auctions)||void 0===r?void 0:r.auctionCounter(),null===(n=t.query.auctions)||void 0===n?void 0:n.auctionInfo()]);case 2:return i=e.sent,f=i[1].unwrapOr([null,null]),e.abrupt("return",{numAuctions:i[0].toJSON(),leasePeriod:f[0],endBlock:f[1]});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function TO(){return(TO=yO(regeneratorRuntime.mark((function e(t){var r,n,i,f,c,a,o,s,d,u,h,l,p,b,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.consts.crowdloan.minContribution,f=SO(t),e.next=4,Promise.all([t.derive.chain.bestNumber(),EO(t),t.query.crowdloan.funds.entries(),t.query.slots.leases.entries(),null===(r=t.query.auctions)||void 0===r?void 0:r.winning.entries()]);case 4:return c=e.sent,a=vO(c,5),o=a[0],s=a[1],d=a[2],u=a[3],h=a[4],l=u.map((function(e){return vO(e,1)[0].toHuman()[0].replace(/,/g,"")})),p=d.map((function(e){var t=vO(e,2),r=t[0],n=t[1];return jO(o,i,{info:n.unwrapOr(null),paraId:r.toHuman()[0].replace(/,/g,"")},l)})).filter((function(e){return!!e})),b=PO(s,p,new ig.a(f[f.length-1][1])),m=kO(f,s,h),e.abrupt("return",{auction:pO(pO({},s),{},{bestNumber:o.toString(),leasePeriod:s.leasePeriod.toNumber(),leaseEnd:s.leasePeriod.add(t.consts.auctions.leasePeriodsPerSlot).isub($t).toNumber()}),funds:p,winners:AO((null===(n=m[0])||void 0===n?void 0:n.winners)||[],b)});case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function RO(){return(RO=yO(regeneratorRuntime.mark((function e(t,r,n){var i,f,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.query.crowdloan.funds(r);case 2:return i=e.sent,f=NO(i.unwrap().trieIndex),e.next=6,t.rpc.childstate.getStorage(f,n);case 6:if(!(c=e.sent).isSome){e.next=9;break}return e.abrupt("return",t.createType("(Balance, Vec<u8>)",c.unwrap()).toJSON()[0].toString());case 9:return e.abrupt("return","0");case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NO(e){return Object(ve.a)(Ae(":child_storage:default:",$i(Ae("crowdloan",e.toU8a()))))}var _O={queryAuctionWithWinners:function(e){return TO.apply(this,arguments)},queryUserContributions:function(e,t,r){return RO.apply(this,arguments)}},CO=["proposal/councilmotion"],BO={Commonwealth:{chains:{Edgeware:"edgeware",Kusama:"kusama","Kusama CC3":"kusama"},create:function(e,t,r,n){return"https://commonwealth.im/".concat(e,"/").concat(t,"/").concat(CO.includes(t)?n||"":r.toString())},isActive:!0,paths:{council:"proposal/councilmotion",proposal:"proposal/democracyproposal",referendum:"proposal/referendum",treasury:"proposal/treasuryproposal"},url:"https://commonwealth.im/"},Polkascan:{chains:{Kusama:"kusama",Polkadot:"polkadot","Polkadot CC1":"polkadot-cc1"},create:function(e,t,r){return"https://polkascan.io/".concat(e,"/").concat(t,"/").concat(r.toString())},isActive:!0,paths:{address:"account",block:"block",council:"council/motion",extrinsic:"transaction",proposal:"democracy/proposal",referendum:"democracy/referendum",techcomm:"techcomm/proposal",treasury:"treasury/proposal"},url:"https://polkascan.io/"},Polkassembly:{chains:{Kusama:"kusama","Kusama CC3":"kusama",Polkadot:"polkadot"},create:function(e,t,r){return"https://".concat(e,".polkassembly.io/").concat(t,"/").concat(r.toString())},isActive:!0,paths:{council:"motion",proposal:"proposal",referendum:"referendum",treasury:"treasury"},url:"https://polkassembly.io/"},Subscan:{chains:{"Acala Mandala TC4":"acala-testnet",Kusama:"kusama","Kusama CC3":"kusama",Polkadot:"polkadot","Polkadot CC1":"polkadot-cc1",Westend:"westend"},create:function(e,t,r){return"https://".concat(e,".subscan.io/").concat(t,"/").concat(r.toString())},isActive:!0,paths:{address:"account",block:"block",council:"council",extrinsic:"extrinsic",proposal:"democracy_proposal",referendum:"referenda",techcomm:"tech",treasury:"treasury"},url:"https://subscan.io/"}};function HO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,f=void 0;try{for(var c,a=e[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){i=!0,f=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw f}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return DO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return DO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DO(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LO(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function zO(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){LO(f,n,i,c,a,"next",e)}function a(e){LO(f,n,i,c,a,"throw",e)}c(void 0)}))}}function VO(e){return"".concat(e[0]).concat(e[e.length-1])}function qO(){return(qO=zO(regeneratorRuntime.mark((function e(t,r){var n,i,f,c,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.data,i=r.hash,f=r.type,c=r.withShort,e.next=3,t.rpc.system.chain();case 3:return a=e.sent,e.abrupt("return",Object.entries(BO).map((function(e){var t=HO(e,2),r=t[0],o=t[1],s=o.chains,d=o.create,u=o.isActive,h=o.paths,l=(o.url,s[a.toHuman()]),p=h[f];return u&&l&&p?{name:c?VO(r):r,link:d(l,p,n,i)}:null})).filter((function(e){return e})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UO(e,t,r,n,i,f,c){try{var a=e[f](c),o=a.value}catch(e){return void r(e)}a.done?t(o):Promise.resolve(o).then(n,i)}function FO(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var f=e.apply(t,r);function c(e){UO(f,n,i,c,a,"next",e)}function a(e){UO(f,n,i,c,a,"throw",e)}c(void 0)}))}}function WO(e,t){console.log(JSON.stringify({path:e,data:t}))}function KO(){return(KO=FO(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=FO(regeneratorRuntime.mark((function e(r,n){var i,f,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new pe(t),e.prev=1,e.next=4,Wm.create({provider:i});case 4:f=e.sent,window.api=f,c=t[f._options.provider.__private_9_endpointIndex],WO("log","".concat(c," wss connected success")),r(c),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(1),WO("log","connect failed"),i.disconnect(),r(null);case 16:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}WO("log","main js loaded"),window.send=WO;var XO={test:function(){var e=FO(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),connect:function(e){return KO.apply(this,arguments)},subscribeMessage:yy,getNetworkConst:function(e){return vy.apply(this,arguments)},getNetworkProperties:function(e){return wy.apply(this,arguments)},genLinks:function(e,t){return qO.apply(this,arguments)}};window.settings=XO,window.keyring=Ww,window.account=yM,window.staking=hO,window.gov=Cg,window.parachain=_O;t.default=XO},function(e,t,r){"use strict";r.r(t),r.d(t,"audit",(function(){return f})),r.d(t,"auditTime",(function(){return d})),r.d(t,"buffer",(function(){return u})),r.d(t,"bufferCount",(function(){return b})),r.d(t,"bufferTime",(function(){return w})),r.d(t,"bufferToggle",(function(){return I})),r.d(t,"bufferWhen",(function(){return N})),r.d(t,"catchError",(function(){return B})),r.d(t,"combineAll",(function(){return z})),r.d(t,"combineLatest",(function(){return U})),r.d(t,"concat",(function(){return W})),r.d(t,"concatAll",(function(){return K.a})),r.d(t,"concatMap",(function(){return Z})),r.d(t,"concatMapTo",(function(){return G})),r.d(t,"count",(function(){return Y})),r.d(t,"debounce",(function(){return $})),r.d(t,"debounceTime",(function(){return re})),r.d(t,"defaultIfEmpty",(function(){return ce})),r.d(t,"delay",(function(){return ue})),r.d(t,"delayWhen",(function(){return me})),r.d(t,"dematerialize",(function(){return Me})),r.d(t,"distinct",(function(){return Se})),r.d(t,"distinctUntilChanged",(function(){return Pe})),r.d(t,"distinctUntilKeyChanged",(function(){return Ie})),r.d(t,"elementAt",(function(){return qe})),r.d(t,"endWith",(function(){return Fe})),r.d(t,"every",(function(){return We})),r.d(t,"exhaust",(function(){return Ze})),r.d(t,"exhaustMap",(function(){return Qe})),r.d(t,"expand",(function(){return tt})),r.d(t,"filter",(function(){return Re.a})),r.d(t,"finalize",(function(){return it})),r.d(t,"find",(function(){return at})),r.d(t,"findIndex",(function(){return dt})),r.d(t,"first",(function(){return ht})),r.d(t,"groupBy",(function(){return lt.b})),r.d(t,"ignoreElements",(function(){return pt})),r.d(t,"isEmpty",(function(){return yt})),r.d(t,"last",(function(){return xt})),r.d(t,"map",(function(){return Je.a})),r.d(t,"mapTo",(function(){return St})),r.d(t,"materialize",(function(){return Pt})),r.d(t,"max",(function(){return Ct})),r.d(t,"merge",(function(){return Ht})),r.d(t,"mergeAll",(function(){return Dt.a})),r.d(t,"mergeMap",(function(){return X.b})),r.d(t,"flatMap",(function(){return X.a})),r.d(t,"mergeMapTo",(function(){return Lt})),r.d(t,"mergeScan",(function(){return zt})),r.d(t,"min",(function(){return Ut})),r.d(t,"multicast",(function(){return Wt})),r.d(t,"observeOn",(function(){return Xt.b})),r.d(t,"onErrorResumeNext",(function(){return Zt})),r.d(t,"pairwise",(function(){return Jt})),r.d(t,"partition",(function(){return tr})),r.d(t,"pluck",(function(){return rr})),r.d(t,"publish",(function(){return fr})),r.d(t,"publishBehavior",(function(){return ar})),r.d(t,"publishLast",(function(){return sr})),r.d(t,"publishReplay",(function(){return ur})),r.d(t,"race",(function(){return lr})),r.d(t,"reduce",(function(){return _t})),r.d(t,"repeat",(function(){return pr})),r.d(t,"repeatWhen",(function(){return yr})),r.d(t,"retry",(function(){return wr})),r.d(t,"retryWhen",(function(){return xr})),r.d(t,"refCount",(function(){return jr.a})),r.d(t,"sample",(function(){return Pr})),r.d(t,"sampleTime",(function(){return Ir})),r.d(t,"scan",(function(){return It})),r.d(t,"sequenceEqual",(function(){return _r})),r.d(t,"share",(function(){return Lr})),r.d(t,"shareReplay",(function(){return zr})),r.d(t,"single",(function(){return Vr})),r.d(t,"skip",(function(){return Fr})),r.d(t,"skipLast",(function(){return Xr})),r.d(t,"skipUntil",(function(){return Yr})),r.d(t,"skipWhile",(function(){return $r})),r.d(t,"startWith",(function(){return rn})),r.d(t,"subscribeOn",(function(){return an})),r.d(t,"switchAll",(function(){return hn})),r.d(t,"switchMap",(function(){return sn})),r.d(t,"switchMapTo",(function(){return ln})),r.d(t,"take",(function(){return Le})),r.d(t,"takeLast",(function(){return wt})),r.d(t,"takeUntil",(function(){return pn})),r.d(t,"takeWhile",(function(){return yn})),r.d(t,"tap",(function(){return On})),r.d(t,"throttle",(function(){return jn})),r.d(t,"throttleTime",(function(){return En})),r.d(t,"throwIfEmpty",(function(){return _e})),r.d(t,"timeInterval",(function(){return _n})),r.d(t,"timeout",(function(){return Vn})),r.d(t,"timeoutWith",(function(){return Hn})),r.d(t,"timestamp",(function(){return qn})),r.d(t,"toArray",(function(){return Wn})),r.d(t,"window",(function(){return Kn})),r.d(t,"windowCount",(function(){return Gn})),r.d(t,"windowTime",(function(){return Qn})),r.d(t,"windowToggle",(function(){return fi})),r.d(t,"windowWhen",(function(){return oi})),r.d(t,"withLatestFrom",(function(){return ui})),r.d(t,"zip",(function(){return bi})),r.d(t,"zipAll",(function(){return mi}));var n=r(0),i=r(4);function f(e){return function(t){return t.lift(new c(e))}}var c=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.durationSelector))},e}(),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return n.a(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=Object(i.c)(t,new i.a(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(i.b),o=r(17),s=r(180);function d(e,t){return void 0===t&&(t=o.a),f((function(){return Object(s.a)(e,t)}))}function u(e){return function(t){return t.lift(new h(e))}}var h=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingNotifier))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(Object(i.c)(r,new i.a(n))),n}return n.a(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(i.b),p=r(2);function b(e,t){return void 0===t&&(t=null),function(r){return r.lift(new m(e,t))}}var m=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?g:y}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),y=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return n.a(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(p.a),g=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return n.a(t,e),t.prototype._next=function(e){var t=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var f=n.length;f--;){var c=n[f];c.push(e),c.length===t&&(n.splice(f,1),this.destination.next(c))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(p.a),v=r(23);function w(e){var t=arguments.length,r=o.a;Object(v.a)(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(t){return t.lift(new M(e,n,i,r))}}var M=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new x(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),O=function(){return function(){this.buffer=[]}}(),x=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;c.bufferTimeSpan=r,c.bufferCreationInterval=n,c.maxBufferSize=i,c.scheduler=f,c.contexts=[];var a=c.openContext();if(c.timespanOnly=null==n||n<0,c.timespanOnly){var o={subscriber:c,context:a,bufferTimeSpan:r};c.add(a.closeAction=f.schedule(S,r,o))}else{var s={subscriber:c,context:a},d={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:c,scheduler:f};c.add(a.closeAction=f.schedule(j,r,s)),c.add(f.schedule(k,n,d))}return c}return n.a(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var f=r[i],c=f.buffer;c.push(e),c.length==this.maxBufferSize&&(t=f)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(S,r,n))}},t.prototype.openContext=function(){var e=new O;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(p.a);function S(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function k(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,f=n.openContext();n.closed||(n.add(f.closeAction=i.schedule(j,r,{subscriber:n,context:f})),this.schedule(e,t))}function j(e){var t=e.subscriber,r=e.context;t.closeContext(r)}var P=r(10),A=r(33),E=r(38);function I(e,t){return function(r){return r.lift(new T(e,t))}}var T=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new R(e,this.openings,this.closingSelector))},e}(),R=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(Object(A.a)(i,r)),i}return n.a(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new P.a,n={buffer:[],subscription:r};t.push(n);var i=Object(A.a)(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(E.a);function N(e){return function(t){return t.lift(new _(e))}}var _=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new C(e,this.closingSelector))},e}(),C=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return n.a(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{t=(0,this.closingSelector)()}catch(e){return this.error(e)}e=new P.a,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(Object(i.c)(t,new i.a(this))),this.subscribing=!1},t}(i.b);function B(e){return function(t){var r=new H(e),n=t.lift(r);return r.caught=n}}var H=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new D(e,this.selector,this.caught))},e}(),D=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return n.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var n=new i.a(this);this.add(n);var f=Object(i.c)(r,n);f!==n&&this.add(f)}},t}(i.b),L=r(125);function z(e){return function(t){return t.lift(new L.a(e))}}var V=r(18),q=r(29);function U(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&Object(V.a)(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(Object(q.a)([t].concat(e)),new L.a(r))}}var F=r(81);function W(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(F.a.apply(void 0,[t].concat(e)))}}var K=r(177),X=r(68);function Z(e,t){return Object(X.b)(e,t,1)}function G(e,t){return Z((function(){return e}),t)}function Y(e){return function(t){return t.lift(new J(e,t))}}var J=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Q(e,this.predicate,this.source))},e}(),Q=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return n.a(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(p.a);function $(e){return function(t){return t.lift(new ee(e))}}var ee=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new te(e,this.durationSelector))},e}(),te=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return n.a(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=Object(i.c)(t,new i.a(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(i.b);function re(e,t){return void 0===t&&(t=o.a),function(r){return r.lift(new ne(e,t))}}var ne=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new ie(e,this.dueTime,this.scheduler))},e}(),ie=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return n.a(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(fe,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(p.a);function fe(e){e.debouncedNext()}function ce(e){return void 0===e&&(e=null),function(t){return t.lift(new ae(e))}}var ae=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new oe(e,this.defaultValue))},e}(),oe=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return n.a(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(p.a);function se(e){return e instanceof Date&&!isNaN(+e)}var de=r(41);function ue(e,t){void 0===t&&(t=o.a);var r=se(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new he(r,t))}}var he=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new le(e,this.delay,this.scheduler))},e}(),le=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return n.a(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var f=Math.max(0,r[0].time-n.now());this.schedule(e,f)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new pe(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(de.a.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(de.a.createComplete()),this.unsubscribe()},t}(p.a),pe=function(){return function(e,t){this.time=e,this.notification=t}}(),be=r(7);function me(e,t){return t?function(r){return new ve(r,t).lift(new ye(e))}:function(t){return t.lift(new ye(e))}}var ye=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new ge(e,this.delayDurationSelector))},e}(),ge=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return n.a(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return-1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=Object(A.a)(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(E.a),ve=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return n.a(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new we(e,this.source))},t}(be.a),we=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return n.a(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(p.a);function Me(){return function(e){return e.lift(new Oe)}}var Oe=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new xe(e))},e}(),xe=function(e){function t(t){return e.call(this,t)||this}return n.a(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(p.a);function Se(e,t){return function(r){return r.lift(new ke(e,t))}}var ke=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new je(e,this.keySelector,this.flushes))},e}(),je=function(e){function t(t,r,n){var f=e.call(this,t)||this;return f.keySelector=r,f.values=new Set,n&&f.add(Object(i.c)(n,new i.a(f))),f}return n.a(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){return void r.error(e)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(i.b);function Pe(e,t){return function(r){return r.lift(new Ae(e,t))}}var Ae=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Ee(e,this.compare,this.keySelector))},e}(),Ee=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return n.a(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(p.a);function Ie(e,t){return Pe((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}var Te=r(57),Re=r(39),Ne=r(67);function _e(e){return void 0===e&&(e=He),function(t){return t.lift(new Ce(e))}}var Ce=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new Be(e,this.errorFactory))},e}(),Be=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return n.a(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(p.a);function He(){return new Ne.a}var De=r(27);function Le(e){return function(t){return 0===e?Object(De.b)():t.lift(new ze(e))}}var ze=function(){function e(e){if(this.total=e,this.total<0)throw new Te.a}return e.prototype.call=function(e,t){return t.subscribe(new Ve(e,this.total))},e}(),Ve=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return n.a(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(p.a);function qe(e,t){if(e<0)throw new Te.a;var r=arguments.length>=2;return function(n){return n.pipe(Object(Re.a)((function(t,r){return r===e})),Le(1),r?ce(t):_e((function(){return new Te.a})))}}var Ue=r(88);function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return Object(F.a)(t,Ue.a.apply(void 0,e))}}function We(e,t){return function(r){return r.lift(new Ke(e,t,r))}}var Ke=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new Xe(e,this.predicate,this.thisArg,this.source))},e}(),Xe=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f.predicate=r,f.thisArg=n,f.source=i,f.index=0,f.thisArg=n||f,f}return n.a(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(p.a);function Ze(){return function(e){return e.lift(new Ge)}}var Ge=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Ye(e))},e}(),Ye=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return n.a(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(i.c)(e,new i.a(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.b),Je=r(22);function Qe(e,t){return t?function(r){return r.pipe(Qe((function(r,n){return Object(q.a)(e(r,n)).pipe(Object(Je.a)((function(e,i){return t(r,e,n,i)})))})))}:function(t){return t.lift(new $e(e))}}var $e=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new et(e,this.project))},e}(),et=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return n.a(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new i.a(this),r=this.destination;r.add(t);var n=Object(i.c)(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(i.b);function tt(e,t,r){return void 0===t&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(n){return n.lift(new rt(e,t,r))}}var rt=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new nt(e,this.project,this.concurrent,this.scheduler))},e}(),nt=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f.project=r,f.concurrent=n,f.scheduler=i,f.index=0,f.active=0,f.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(f.buffer=[]),f}return n.a(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)this._complete();else{var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);if(this.scheduler){var f={subscriber:this,result:i,value:e,index:n};this.destination.add(this.scheduler.schedule(t.dispatch,0,f))}else this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)}},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(Object(i.c)(e,new i.a(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(i.b);function it(e){return function(t){return t.lift(new ft(e))}}var ft=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new ct(e,this.callback))},e}(),ct=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new P.a(r)),n}return n.a(t,e),t}(p.a);function at(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(r){return r.lift(new ot(e,r,!1,t))}}var ot=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new st(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),st=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;return c.predicate=r,c.source=n,c.yieldIndex=i,c.thisArg=f,c.index=0,c}return n.a(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(p.a);function dt(e,t){return function(r){return r.lift(new ot(e,r,!0,t))}}var ut=r(36);function ht(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?Object(Re.a)((function(t,r){return e(t,r,n)})):ut.a,Le(1),r?ce(t):_e((function(){return new Ne.a})))}}var lt=r(170);function pt(){return function(e){return e.lift(new bt)}}var bt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new mt(e))},e}(),mt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.a(t,e),t.prototype._next=function(e){},t}(p.a);function yt(){return function(e){return e.lift(new gt)}}var gt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new vt(e))},e}(),vt=function(e){function t(t){return e.call(this,t)||this}return n.a(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(p.a);function wt(e){return function(t){return 0===e?Object(De.b)():t.lift(new Mt(e))}}var Mt=function(){function e(e){if(this.total=e,this.total<0)throw new Te.a}return e.prototype.call=function(e,t){return t.subscribe(new Ot(e,this.total))},e}(),Ot=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=new Array,n.count=0,n}return n.a(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var f=t++%r;e.next(n[f])}e.complete()},t}(p.a);function xt(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?Object(Re.a)((function(t,r){return e(t,r,n)})):ut.a,wt(1),r?ce(t):_e((function(){return new Ne.a})))}}function St(e){return function(t){return t.lift(new kt(e))}}var kt=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new jt(e,this.value))},e}(),jt=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return n.a(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(p.a);function Pt(){return function(e){return e.lift(new At)}}var At=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Et(e))},e}(),Et=function(e){function t(t){return e.call(this,t)||this}return n.a(t,e),t.prototype._next=function(e){this.destination.next(de.a.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(de.a.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(de.a.createComplete()),e.complete()},t}(p.a);function It(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new Tt(e,t,r))}}var Tt=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new Rt(e,this.accumulator,this.seed,this.hasSeed))},e}(),Rt=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f.accumulator=r,f._seed=n,f.hasSeed=i,f.index=0,f}return n.a(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(p.a),Nt=r(106);function _t(e,t){return arguments.length>=2?function(r){return Object(Nt.a)(It(e,t),wt(1),ce(t))(r)}:function(t){return Object(Nt.a)(It((function(t,r,n){return e(t,r,n+1)})),wt(1))(t)}}function Ct(e){return _t("function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}var Bt=r(178);function Ht(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(Bt.a.apply(void 0,[t].concat(e)))}}var Dt=r(126);function Lt(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?Object(X.b)((function(){return e}),t,r):("number"==typeof t&&(r=t),Object(X.b)((function(){return e}),r))}function zt(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new Vt(e,t,r))}}var Vt=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new qt(e,this.accumulator,this.seed,this.concurrent))},e}(),qt=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f.accumulator=r,f.acc=n,f.concurrent=i,f.hasValue=!1,f.hasCompleted=!1,f.buffer=[],f.active=0,f.index=0,f}return n.a(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new i.a(this),r=this.destination;r.add(t);var n=Object(i.c)(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(i.b);function Ut(e){return _t("function"==typeof e?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}var Ft=r(173);function Wt(e,t){return function(r){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new Kt(n,t));var i=Object.create(r,Ft.b);return i.source=r,i.subjectFactory=n,i}}var Kt=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}(),Xt=r(175);function Zt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&Object(V.a)(e[0])&&(e=e[0]),function(t){return t.lift(new Gt(e))}}var Gt=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new Yt(e,this.nextSources))},e}(),Yt=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return n.a(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new i.a(this),r=this.destination;r.add(t);var n=Object(i.c)(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(i.b);function Jt(){return function(e){return e.lift(new Qt)}}var Qt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new $t(e))},e}(),$t=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return n.a(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(p.a),er=r(192);function tr(e,t){return function(r){return[Object(Re.a)(e,t)(r),Object(Re.a)(Object(er.a)(e,t))(r)]}}function rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(t){return Object(Je.a)(nr(e,r))(t)}}function nr(e,t){return function(r){for(var n=r,i=0;i<t;i++){var f=null!=n?n[e[i]]:void 0;if(void 0===f)return;n=f}return n}}var ir=r(12);function fr(e){return e?Wt((function(){return new ir.a}),e):Wt(new ir.a)}var cr=r(174);function ar(e){return function(t){return Wt(new cr.a(e))(t)}}var or=r(72);function sr(){return function(e){return Wt(new or.a)(e)}}var dr=r(123);function ur(e,t,r,n){r&&"function"!=typeof r&&(n=r);var i="function"==typeof r?r:void 0,f=new dr.a(e,t,n);return function(e){return Wt((function(){return f}),i)(e)}}var hr=r(179);function lr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&Object(V.a)(e[0])&&(e=e[0]),t.lift.call(hr.a.apply(void 0,[t].concat(e)))}}function pr(e){return void 0===e&&(e=-1),function(t){return 0===e?Object(De.b)():e<0?t.lift(new br(-1,t)):t.lift(new br(e-1,t))}}var br=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new mr(e,this.count,this.source))},e}(),mr=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return n.a(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(p.a);function yr(e){return function(t){return t.lift(new gr(e))}}var gr=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new vr(e,this.notifier,t))},e}(),vr=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return n.a(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){var t;this.notifications=new ir.a;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=Object(i.c)(t,new i.a(this))},t}(i.b);function wr(e){return void 0===e&&(e=-1),function(t){return t.lift(new Mr(e,t))}}var Mr=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Or(e,this.count,this.source))},e}(),Or=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return n.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(p.a);function xr(e){return function(t){return t.lift(new Sr(e,t))}}var Sr=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new kr(e,this.notifier,this.source))},e}(),kr=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return n.a(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,f=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new ir.a;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}f=Object(i.c)(n,new i.a(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=f,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(i.b),jr=r(122);function Pr(e){return function(t){return t.lift(new Ar(e))}}var Ar=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new Er(e),n=t.subscribe(r);return n.add(Object(i.c)(this.notifier,new i.a(r))),n},e}(),Er=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return n.a(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(i.b);function Ir(e,t){return void 0===t&&(t=o.a),function(r){return r.lift(new Tr(e,t))}}var Tr=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new Rr(e,this.period,this.scheduler))},e}(),Rr=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(Nr,r,{subscriber:i,period:r})),i}return n.a(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(p.a);function Nr(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}function _r(e,t){return function(r){return r.lift(new Cr(e,t))}}var Cr=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new Br(e,this.compareTo,this.comparator))},e}(),Br=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new Hr(t,i))),i}return n.a(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,r=this.comparator;e.length>0&&t.length>0;){var n=e.shift(),i=t.shift(),f=!1;try{f=r?r(n,i):n===i}catch(e){this.destination.error(e)}f||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(p.a),Hr=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return n.a(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(p.a);function Dr(){return new ir.a}function Lr(){return function(e){return Object(jr.a)()(Wt(Dr)(e))}}function zr(e,t,r){var n;return n=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){return e.lift(function(e){var t,r,n=e.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,f=e.windowTime,c=void 0===f?Number.POSITIVE_INFINITY:f,a=e.refCount,o=e.scheduler,s=0,d=!1,u=!1;return function(e){var n;s++,!t||d?(d=!1,t=new dr.a(i,c,o),n=t.subscribe(this),r=e.subscribe({next:function(e){t.next(e)},error:function(e){d=!0,t.error(e)},complete:function(){u=!0,r=void 0,t.complete()}}),u&&(r=void 0)):n=t.subscribe(this),this.add((function(){s--,n.unsubscribe(),n=void 0,r&&!u&&a&&0===s&&(r.unsubscribe(),r=void 0,t=void 0)}))}}(n))}}function Vr(e){return function(t){return t.lift(new qr(e,t))}}var qr=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Ur(e,this.predicate,this.source))},e}(),Ur=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return n.a(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new Ne.a)},t}(p.a);function Fr(e){return function(t){return t.lift(new Wr(e))}}var Wr=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new Kr(e,this.total))},e}(),Kr=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return n.a(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(p.a);function Xr(e){return function(t){return t.lift(new Zr(e))}}var Zr=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new Te.a}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new p.a(e)):t.subscribe(new Gr(e,this._skipCount))},e}(),Gr=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=new Array(r),n}return n.a(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,f=i[n];i[n]=e,this.destination.next(f)}},t}(p.a);function Yr(e){return function(t){return t.lift(new Jr(e))}}var Jr=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new Qr(e,this.notifier))},e}(),Qr=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var f=new i.a(n);n.add(f),n.innerSubscription=f;var c=Object(i.c)(r,f);return c!==f&&(n.add(c),n.innerSubscription=c),n}return n.a(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(i.b);function $r(e){return function(t){return t.lift(new en(e))}}var en=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new tn(e,this.predicate))},e}(),tn=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return n.a(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},t}(p.a);function rn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return Object(v.a)(r)?(e.pop(),function(t){return Object(F.a)(e,t,r)}):function(t){return Object(F.a)(e,t)}}var nn=r(107),fn=r(74),cn=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=nn.a);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!Object(fn.a)(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=nn.a),i}return n.a(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=nn.a),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(be.a);function an(e,t){return void 0===t&&(t=0),function(r){return r.lift(new on(e,t))}}var on=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new cn(t,this.delay,this.scheduler).subscribe(e)},e}();function sn(e,t){return"function"==typeof t?function(r){return r.pipe(sn((function(r,n){return Object(q.a)(e(r,n)).pipe(Object(Je.a)((function(e,i){return t(r,e,n,i)})))})))}:function(t){return t.lift(new dn(e))}}var dn=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new un(e,this.project))},e}(),un=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return n.a(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new i.a(this),n=this.destination;n.add(r),this.innerSubscription=Object(i.c)(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(i.b);function hn(){return sn(ut.a)}function ln(e,t){return t?sn((function(){return e}),t):sn((function(){return e}))}function pn(e){return function(t){return t.lift(new bn(e))}}var bn=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new mn(e),n=Object(i.c)(this.notifier,new i.a(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),mn=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return n.a(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(i.b);function yn(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new gn(e,t))}}var gn=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new vn(e,this.predicate,this.inclusive))},e}(),vn=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return n.a(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){return void r.error(e)}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;Boolean(t)?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(p.a),wn=r(47),Mn=r(58);function On(e,t,r){return function(n){return n.lift(new xn(e,t,r))}}var xn=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new Sn(e,this.nextOrObserver,this.error,this.complete))},e}(),Sn=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f._tapNext=wn.a,f._tapError=wn.a,f._tapComplete=wn.a,f._tapError=n||wn.a,f._tapComplete=i||wn.a,Object(Mn.a)(r)?(f._context=f,f._tapNext=r):r&&(f._context=r,f._tapNext=r.next||wn.a,f._tapError=r.error||wn.a,f._tapComplete=r.complete||wn.a),f}return n.a(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(p.a),kn={leading:!0,trailing:!1};function jn(e,t){return void 0===t&&(t=kn),function(r){return r.lift(new Pn(e,!!t.leading,!!t.trailing))}}var Pn=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new An(e,this.durationSelector,this.leading,this.trailing))},e}(),An=function(e){function t(t,r,n,i){var f=e.call(this,t)||this;return f.destination=t,f.durationSelector=r,f._leading=n,f._trailing=i,f._hasValue=!1,f}return n.a(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=Object(i.c)(t,new i.a(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(i.b);function En(e,t,r){return void 0===t&&(t=o.a),void 0===r&&(r=kn),function(n){return n.lift(new In(e,t,r.leading,r.trailing))}}var In=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new Tn(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Tn=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;return c.duration=r,c.scheduler=n,c.leading=i,c.trailing=f,c._hasTrailingValue=!1,c._trailingValue=null,c}return n.a(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Rn,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(p.a);function Rn(e){e.subscriber.clearThrottle()}var Nn=r(127);function _n(e){return void 0===e&&(e=o.a),function(t){return Object(Nn.a)((function(){return t.pipe(It((function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}}),{current:e.now(),value:void 0,last:void 0}),Object(Je.a)((function(e){var t=e.current,r=e.last,n=e.value;return new Cn(n,t-r)})))}))}}var Cn=function(){return function(e,t){this.value=e,this.interval=t}}(),Bn=r(176);function Hn(e,t,r){return void 0===r&&(r=o.a),function(n){var i=se(e),f=i?+e-r.now():Math.abs(e);return n.lift(new Dn(f,i,t,r))}}var Dn=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new Ln(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),Ln=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;return c.absoluteTimeout=r,c.waitFor=n,c.withObservable=i,c.scheduler=f,c.scheduleTimeout(),c}return n.a(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(Object(i.c)(t,new i.a(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(i.b),zn=r(124);function Vn(e,t){return void 0===t&&(t=o.a),Hn(e,Object(zn.a)(new Bn.a),t)}function qn(e){return void 0===e&&(e=o.a),Object(Je.a)((function(t){return new Un(t,e.now())}))}var Un=function(){return function(e,t){this.value=e,this.timestamp=t}}();function Fn(e,t,r){return 0===r?[t]:(e.push(t),e)}function Wn(){return _t(Fn,[])}function Kn(e){return function(t){return t.lift(new Xn(e))}}var Xn=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new Zn(e),n=t.subscribe(r);return n.closed||r.add(Object(i.c)(this.windowBoundaries,new i.a(r))),n},e}(),Zn=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new ir.a,t.next(r.window),r}return n.a(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new ir.a;t.next(r)},t}(i.b);function Gn(e,t){return void 0===t&&(t=0),function(r){return r.lift(new Yn(e,t))}}var Yn=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new Jn(e,this.windowSize,this.startWindowEvery))},e}(),Jn=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new ir.a],i.count=0,t.next(i.windows[0]),i}return n.a(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,f=i.length,c=0;c<f&&!this.closed;c++)i[c].next(e);var a=this.count-n+1;if(a>=0&&a%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var o=new ir.a;i.push(o),r.next(o)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(p.a);function Qn(e){var t=o.a,r=null,n=Number.POSITIVE_INFINITY;return Object(v.a)(arguments[3])&&(t=arguments[3]),Object(v.a)(arguments[2])?t=arguments[2]:Object(fn.a)(arguments[2])&&(n=Number(arguments[2])),Object(v.a)(arguments[1])?t=arguments[1]:Object(fn.a)(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new $n(e,r,n,t))}}var $n=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new ti(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),ei=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return n.a(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(ir.a),ti=function(e){function t(t,r,n,i,f){var c=e.call(this,t)||this;c.destination=t,c.windowTimeSpan=r,c.windowCreationInterval=n,c.maxWindowSize=i,c.scheduler=f,c.windows=[];var a=c.openWindow();if(null!==n&&n>=0){var o={subscriber:c,window:a,context:null},s={windowTimeSpan:r,windowCreationInterval:n,subscriber:c,scheduler:f};c.add(f.schedule(ii,r,o)),c.add(f.schedule(ni,n,s))}else{var d={subscriber:c,window:a,windowTimeSpan:r};c.add(f.schedule(ri,r,d))}return c}return n.a(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];i.closed||(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new ei;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(p.a);function ri(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function ni(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,f=r.openWindow(),c={action:this,subscription:null},a={subscriber:r,window:f,context:c};c.subscription=n.schedule(ii,t,a),this.add(c.subscription),this.schedule(e,i)}function ii(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}function fi(e,t){return function(r){return r.lift(new ci(e,t))}}var ci=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new ai(e,this.openings,this.closingSelector))},e}(),ai=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=Object(A.a)(i,r,r)),i}return n.a(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var f=r[i];f.window.error(t),f.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var f=void 0;try{f=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var c=new ir.a,a=new P.a,o={window:c,subscription:a};this.contexts.push(o);var s=Object(A.a)(this,f,o);s.closed?this.closeWindow(this.contexts.length-1):(s.context=o,a.add(s)),this.destination.next(c)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(E.a);function oi(e){return function(t){return t.lift(new si(e))}}var si=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new di(e,this.closingSelector))},e}(),di=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return n.a(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var r,n=this.window=new ir.a;this.destination.next(n);try{r=(0,this.closingSelector)()}catch(e){return this.destination.error(e),void this.window.error(e)}this.add(this.closingNotification=Object(A.a)(this,r))},t}(E.a);function ui(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;"function"==typeof e[e.length-1]&&(r=e.pop());var n=e;return t.lift(new hi(n,r))}}var hi=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new li(e,this.observables,this.project))},e}(),li=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var f=r.length;i.values=new Array(f);for(var c=0;c<f;c++)i.toRespond.push(c);for(c=0;c<f;c++){var a=r[c];i.add(Object(A.a)(i,a,void 0,c))}return i}return n.a(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(E.a),pi=r(128);function bi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(pi.b.apply(void 0,[t].concat(e)))}}function mi(e){return function(t){return t.lift(new pi.a(e))}}},function(e,t,r){"use strict";r.r(t),r.d(t,"Observable",(function(){return n.a})),r.d(t,"ConnectableObservable",(function(){return i.a})),r.d(t,"GroupedObservable",(function(){return f.a})),r.d(t,"observable",(function(){return c.a})),r.d(t,"Subject",(function(){return a.a})),r.d(t,"BehaviorSubject",(function(){return o.a})),r.d(t,"ReplaySubject",(function(){return s.a})),r.d(t,"AsyncSubject",(function(){return d.a})),r.d(t,"asap",(function(){return u.a})),r.d(t,"asapScheduler",(function(){return u.b})),r.d(t,"async",(function(){return h.a})),r.d(t,"asyncScheduler",(function(){return h.b})),r.d(t,"queue",(function(){return l.a})),r.d(t,"queueScheduler",(function(){return l.b})),r.d(t,"animationFrame",(function(){return v})),r.d(t,"animationFrameScheduler",(function(){return g})),r.d(t,"VirtualTimeScheduler",(function(){return w})),r.d(t,"VirtualAction",(function(){return M})),r.d(t,"Scheduler",(function(){return O.a})),r.d(t,"Subscription",(function(){return x.a})),r.d(t,"Subscriber",(function(){return S.a})),r.d(t,"Notification",(function(){return k.a})),r.d(t,"NotificationKind",(function(){return k.b})),r.d(t,"pipe",(function(){return j.a})),r.d(t,"noop",(function(){return P.a})),r.d(t,"identity",(function(){return A.a})),r.d(t,"isObservable",(function(){return E})),r.d(t,"ArgumentOutOfRangeError",(function(){return I.a})),r.d(t,"EmptyError",(function(){return T.a})),r.d(t,"ObjectUnsubscribedError",(function(){return R.a})),r.d(t,"UnsubscriptionError",(function(){return N.a})),r.d(t,"TimeoutError",(function(){return _.a})),r.d(t,"bindCallback",(function(){return L})),r.d(t,"bindNodeCallback",(function(){return q})),r.d(t,"combineLatest",(function(){return K.b})),r.d(t,"concat",(function(){return X.a})),r.d(t,"defer",(function(){return Z.a})),r.d(t,"empty",(function(){return G.b})),r.d(t,"forkJoin",(function(){return Q})),r.d(t,"from",(function(){return J.a})),r.d(t,"fromEvent",(function(){return te})),r.d(t,"fromEventPattern",(function(){return re})),r.d(t,"generate",(function(){return ne})),r.d(t,"iif",(function(){return fe})),r.d(t,"interval",(function(){return ae})),r.d(t,"merge",(function(){return se.a})),r.d(t,"never",(function(){return ue})),r.d(t,"of",(function(){return he.a})),r.d(t,"onErrorResumeNext",(function(){return le})),r.d(t,"pairs",(function(){return pe})),r.d(t,"partition",(function(){return ve})),r.d(t,"race",(function(){return we.a})),r.d(t,"range",(function(){return Me})),r.d(t,"throwError",(function(){return xe.a})),r.d(t,"timer",(function(){return Se.a})),r.d(t,"using",(function(){return ke})),r.d(t,"zip",(function(){return je.b})),r.d(t,"scheduled",(function(){return Pe.a})),r.d(t,"EMPTY",(function(){return G.a})),r.d(t,"NEVER",(function(){return de})),r.d(t,"config",(function(){return Ae.a}));var n=r(7),i=r(173),f=r(170),c=r(53),a=r(12),o=r(174),s=r(123),d=r(72),u=r(107),h=r(17),l=r(148),p=r(0),b=r(73),m=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return p.a(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(cancelAnimationFrame(r),t.scheduled=void 0)},t}(b.a),y=r(71),g=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p.a(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(y.a))(m),v=g,w=function(e){function t(t,r){void 0===t&&(t=M),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return p.a(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(y.a),M=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return p.a(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(b.a),O=r(150),x=r(10),S=r(2),k=r(41),j=r(106),P=r(47),A=r(36);function E(e){return!!e&&(e instanceof n.a||"function"==typeof e.lift&&"function"==typeof e.subscribe)}var I=r(57),T=r(67),R=r(54),N=r(109),_=r(176),C=r(22),B=r(132),H=r(18),D=r(23);function L(e,t,r){if(t){if(!Object(D.a)(t))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return L(e,r).apply(void 0,n).pipe(Object(C.a)((function(e){return Object(H.a)(e)?t.apply(void 0,e):t(e)})))};r=t}return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var f,c=this,a={context:c,subject:f,callbackFunc:e,scheduler:r};return new n.a((function(n){if(r){var i={args:t,subscriber:n,params:a};return r.schedule(z,0,i)}if(!f){f=new d.a;try{e.apply(c,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];f.next(e.length<=1?e[0]:e),f.complete()}]))}catch(e){Object(B.a)(f)?f.error(e):console.warn(e)}}return f.subscribe(n)}))}}function z(e){var t=this,r=e.args,n=e.subscriber,i=e.params,f=i.callbackFunc,c=i.context,a=i.scheduler,o=i.subject;if(!o){o=i.subject=new d.a;try{f.apply(c,r.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e.length<=1?e[0]:e;t.add(a.schedule(V,0,{value:n,subject:o}))}]))}catch(e){o.error(e)}}this.add(o.subscribe(n))}function V(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function q(e,t,r){if(t){if(!Object(D.a)(t))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return q(e,r).apply(void 0,n).pipe(Object(C.a)((function(e){return Object(H.a)(e)?t.apply(void 0,e):t(e)})))};r=t}return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var f={subject:void 0,args:t,callbackFunc:e,scheduler:r,context:this};return new n.a((function(n){var i=f.context,c=f.subject;if(r)return r.schedule(U,0,{params:f,subscriber:n,context:i});if(!c){c=f.subject=new d.a;try{e.apply(i,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.shift();r?c.error(r):(c.next(e.length<=1?e[0]:e),c.complete())}]))}catch(e){Object(B.a)(c)?c.error(e):console.warn(e)}}return c.subscribe(n)}))}}function U(e){var t=this,r=e.params,n=e.subscriber,i=e.context,f=r.callbackFunc,c=r.args,a=r.scheduler,o=r.subject;if(!o){o=r.subject=new d.a;try{f.apply(i,c.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e.shift();if(n)t.add(a.schedule(W,0,{err:n,subject:o}));else{var i=e.length<=1?e[0]:e;t.add(a.schedule(F,0,{value:i,subject:o}))}}]))}catch(e){this.add(a.schedule(W,0,{err:e,subject:o}))}}this.add(o.subscribe(n))}function F(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function W(e){var t=e.err;e.subject.error(t)}var K=r(125),X=r(81),Z=r(127),G=r(27),Y=r(131),J=r(29);function Q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var r=e[0];if(Object(H.a)(r))return $(r,null);if(Object(Y.a)(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return $(n.map((function(e){return r[e]})),n)}}if("function"==typeof e[e.length-1]){var i=e.pop();return $(e=1===e.length&&Object(H.a)(e[0])?e[0]:e,null).pipe(Object(C.a)((function(e){return i.apply(void 0,e)})))}return $(e,null)}function $(e,t){return new n.a((function(r){var n=e.length;if(0!==n)for(var i=new Array(n),f=0,c=0,a=function(a){var o=Object(J.a)(e[a]),s=!1;r.add(o.subscribe({next:function(e){s||(s=!0,c++),i[a]=e},error:function(e){return r.error(e)},complete:function(){++f!==n&&s||(c===n&&r.next(t?t.reduce((function(e,t,r){return e[t]=i[r],e}),{}):i),r.complete())}}))},o=0;o<n;o++)a(o);else r.complete()}))}var ee=r(58);function te(e,t,r,i){return Object(ee.a)(r)&&(i=r,r=void 0),i?te(e,t,r).pipe(Object(C.a)((function(e){return Object(H.a)(e)?i.apply(void 0,e):i(e)}))):new n.a((function(n){!function e(t,r,n,i,f){var c;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var a=t;t.addEventListener(r,n,f),c=function(){return a.removeEventListener(r,n,f)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var o=t;t.on(r,n),c=function(){return o.off(r,n)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var s=t;t.addListener(r,n),c=function(){return s.removeListener(r,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var d=0,u=t.length;d<u;d++)e(t[d],r,n,i,f)}i.add(c)}(e,t,(function(e){arguments.length>1?n.next(Array.prototype.slice.call(arguments)):n.next(e)}),n,r)}))}function re(e,t,r){return r?re(e,t).pipe(Object(C.a)((function(e){return Object(H.a)(e)?r.apply(void 0,e):r(e)}))):new n.a((function(r){var n,i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)};try{n=e(i)}catch(e){return void r.error(e)}if(Object(ee.a)(t))return function(){return t(i,n)}}))}function ne(e,t,r,i,f){var c,a;if(1==arguments.length){var o=e;a=o.initialState,t=o.condition,r=o.iterate,c=o.resultSelector||A.a,f=o.scheduler}else void 0===i||Object(D.a)(i)?(a=e,c=A.a,f=i):(a=e,c=i);return new n.a((function(e){var n=a;if(f)return f.schedule(ie,0,{subscriber:e,iterate:r,condition:t,resultSelector:c,state:n});for(;;){if(t){var i=void 0;try{i=t(n)}catch(t){return void e.error(t)}if(!i){e.complete();break}}var o=void 0;try{o=c(n)}catch(t){return void e.error(t)}if(e.next(o),e.closed)break;try{n=r(n)}catch(t){return void e.error(t)}}}))}function ie(e){var t=e.subscriber,r=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(e){return void t.error(e)}else e.needIterate=!0;if(r){var n=void 0;try{n=r(e.state)}catch(e){return void t.error(e)}if(!n)return void t.complete();if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(e){return void t.error(e)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}function fe(e,t,r){return void 0===t&&(t=G.a),void 0===r&&(r=G.a),Object(Z.a)((function(){return e()?t:r}))}var ce=r(74);function ae(e,t){return void 0===e&&(e=0),void 0===t&&(t=h.a),(!Object(ce.a)(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=h.a),new n.a((function(r){return r.add(t.schedule(oe,e,{subscriber:r,counter:0,period:e})),r}))}function oe(e){var t=e.subscriber,r=e.counter,n=e.period;t.next(r),this.schedule({subscriber:t,counter:r+1,period:n},n)}var se=r(178),de=new n.a(P.a);function ue(){return de}var he=r(88);function le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return G.a;var r=e[0],i=e.slice(1);return 1===e.length&&Object(H.a)(r)?le.apply(void 0,r):new n.a((function(e){var t=function(){return e.add(le.apply(void 0,i).subscribe(e))};return Object(J.a)(r).subscribe({next:function(t){e.next(t)},error:t,complete:t})}))}function pe(e,t){return t?new n.a((function(r){var n=Object.keys(e),i=new x.a;return i.add(t.schedule(be,0,{keys:n,index:0,subscriber:r,subscription:i,obj:e})),i})):new n.a((function(t){for(var r=Object.keys(e),n=0;n<r.length&&!t.closed;n++){var i=r[n];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()}))}function be(e){var t=e.keys,r=e.index,n=e.subscriber,i=e.subscription,f=e.obj;if(!n.closed)if(r<t.length){var c=t[r];n.next([c,f[c]]),i.add(this.schedule({keys:t,index:r+1,subscriber:n,subscription:i,obj:f}))}else n.complete()}var me=r(192),ye=r(82),ge=r(39);function ve(e,t,r){return[Object(ge.a)(t,r)(new n.a(Object(ye.a)(e))),Object(ge.a)(Object(me.a)(t,r))(new n.a(Object(ye.a)(e)))]}var we=r(179);function Me(e,t,r){return void 0===e&&(e=0),new n.a((function(n){void 0===t&&(t=e,e=0);var i=0,f=e;if(r)return r.schedule(Oe,0,{index:i,count:t,start:e,subscriber:n});for(;;){if(i++>=t){n.complete();break}if(n.next(f++),n.closed)break}}))}function Oe(e){var t=e.start,r=e.index,n=e.count,i=e.subscriber;r>=n?i.complete():(i.next(t),i.closed||(e.index=r+1,e.start=t+1,this.schedule(e)))}var xe=r(124),Se=r(180);function ke(e,t){return new n.a((function(r){var n,i;try{n=e()}catch(e){return void r.error(e)}try{i=t(n)}catch(e){return void r.error(e)}var f=(i?Object(J.a)(i):G.a).subscribe(r);return function(){f.unsubscribe(),n&&n.unsubscribe()}}))}var je=r(128),Pe=r(182),Ae=r(34)},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 f(e,t,r){if(f.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 c;"object"==typeof e?e.exports=f:t.BN=f,f.BN=f,f.wordSize=26;try{c=r(568).Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),f=t;f<i;f++){var c=e.charCodeAt(f)-48;n<<=4,n|=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return n}function o(e,t,r,n){for(var i=0,f=Math.min(e.length,r),c=t;c<f;c++){var a=e.charCodeAt(c)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}f.isBN=function(e){return e instanceof f||null!==e&&"object"==typeof e&&e.constructor.wordSize===f.wordSize&&Array.isArray(e.words)},f.max=function(e,t){return e.cmp(t)>0?e:t},f.min=function(e,t){return e.cmp(t)<0?e:t},f.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++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},f.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)},f.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 f,c,a=0;if("be"===r)for(i=e.length-1,f=0;i>=0;i-=3)c=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(i=0,f=0;i<e.length;i+=3)c=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[f]|=c<<a&67108863,this.words[f+1]=c>>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,f=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303,(f+=24)>=26&&(f-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<f&67108863,this.words[n+1]|=i>>>26-f&4194303),this.strip()},f.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 f=e.length-r,c=f%n,a=Math.min(f,f-c)+r,s=0,d=r;d<a;d+=n)s=o(e,d,d+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==c){var u=1;for(s=o(e,d,e.length,t),d=0;d<c;d++)u*=t;this.imuln(u),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}},f.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},f.prototype.clone=function(){var e=new f(null);return this.copy(e),e},f.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var s=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(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],f=0|t.words[0],c=i*f,a=67108863&c,o=c/67108864|0;r.words[0]=a;for(var s=1;s<n;s++){for(var d=o>>>26,u=67108863&o,h=Math.min(s,t.length-1),l=Math.max(0,s-e.length+1);l<=h;l++){var p=s-l|0;d+=(c=(i=0|e.words[p])*(f=0|t.words[l])+u)/67108864|0,u=67108863&c}r.words[s]=0|u,o=0|d}return 0!==o?r.words[s]=0|o:r.length--,r.strip()}f.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,f=0,c=0;c<this.length;c++){var a=this.words[c],o=(16777215&(a<<i|f)).toString(16);r=0!==(f=a>>>24-i&16777215)||c!==this.length-1?s[6-o.length]+o+r:o+r,(i+=2)>=26&&(i-=26,c--)}for(0!==f&&(r=f.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 h=d[e],l=u[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:s[h-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")},f.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},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(e,t){return n(void 0!==c),this.toArrayLike(c,e,t)},f.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},f.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),f=r||Math.max(1,i);n(i<=f,"byte array longer than desired length"),n(f>0,"Requested array length <= 0"),this.strip();var c,a,o="le"===t,s=new e(f),d=this.clone();if(o){for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[a]=c;for(;a<f;a++)s[a]=0}else{for(a=0;a<f-i;a++)s[a]=0;for(a=0;!d.isZero();a++)c=d.andln(255),d.iushrn(8),s[f-a-1]=c}return s},Math.clz32?f.prototype._countBits=function(e){return 32-Math.clz32(e)}:f.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},f.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},f.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},f.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},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},f.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.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()},f.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},f.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},f.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},f.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()},f.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},f.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},f.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},f.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()},f.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},f.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},f.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},f.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()},f.prototype.notn=function(e){return this.clone().inotn(e)},f.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()},f.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,f=0;f<n.length;f++)t=(0|r.words[f])+(0|n.words[f])+i,this.words[f]=67108863&t,i=t>>>26;for(;0!==i&&f<r.length;f++)t=(0|r.words[f])+i,this.words[f]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;f<r.length;f++)this.words[f]=r.words[f];return this},f.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)},f.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 f=0,c=0;c<n.length;c++)f=(t=(0|r.words[c])-(0|n.words[c])+f)>>26,this.words[c]=67108863&t;for(;0!==f&&c<r.length;c++)f=(t=(0|r.words[c])+f)>>26,this.words[c]=67108863&t;if(0===f&&c<r.length&&r!==this)for(;c<r.length;c++)this.words[c]=r.words[c];return this.length=Math.max(this.length,c),r!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(e){return this.clone().isub(e)};var l=function(e,t,r){var n,i,f,c=e.words,a=t.words,o=r.words,s=0,d=0|c[0],u=8191&d,h=d>>>13,l=0|c[1],p=8191&l,b=l>>>13,m=0|c[2],y=8191&m,g=m>>>13,v=0|c[3],w=8191&v,M=v>>>13,O=0|c[4],x=8191&O,S=O>>>13,k=0|c[5],j=8191&k,P=k>>>13,A=0|c[6],E=8191&A,I=A>>>13,T=0|c[7],R=8191&T,N=T>>>13,_=0|c[8],C=8191&_,B=_>>>13,H=0|c[9],D=8191&H,L=H>>>13,z=0|a[0],V=8191&z,q=z>>>13,U=0|a[1],F=8191&U,W=U>>>13,K=0|a[2],X=8191&K,Z=K>>>13,G=0|a[3],Y=8191&G,J=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],fe=8191&ie,ce=ie>>>13,ae=0|a[7],oe=8191&ae,se=ae>>>13,de=0|a[8],ue=8191&de,he=de>>>13,le=0|a[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(s+(n=Math.imul(u,V))|0)+((8191&(i=(i=Math.imul(u,q))+Math.imul(h,V)|0))<<13)|0;s=((f=Math.imul(h,q))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,q))+Math.imul(b,V)|0,f=Math.imul(b,q);var ye=(s+(n=n+Math.imul(u,F)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(h,F)|0))<<13)|0;s=((f=f+Math.imul(h,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,q))+Math.imul(g,V)|0,f=Math.imul(g,q),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,F)|0,f=f+Math.imul(b,W)|0;var ge=(s+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Z)|0)+Math.imul(h,X)|0))<<13)|0;s=((f=f+Math.imul(h,Z)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,q))+Math.imul(M,V)|0,f=Math.imul(M,q),n=n+Math.imul(y,F)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,F)|0,f=f+Math.imul(g,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,X)|0,f=f+Math.imul(b,Z)|0;var ve=(s+(n=n+Math.imul(u,Y)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(h,Y)|0))<<13)|0;s=((f=f+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,q))+Math.imul(S,V)|0,f=Math.imul(S,q),n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(M,F)|0,f=f+Math.imul(M,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(g,X)|0,f=f+Math.imul(g,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,f=f+Math.imul(b,J)|0;var we=(s+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(h,$)|0))<<13)|0;s=((f=f+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,q))+Math.imul(P,V)|0,f=Math.imul(P,q),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,F)|0,f=f+Math.imul(S,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(M,X)|0,f=f+Math.imul(M,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,$)|0,f=f+Math.imul(b,ee)|0;var Me=(s+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(h,re)|0))<<13)|0;s=((f=f+Math.imul(h,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,q))+Math.imul(I,V)|0,f=Math.imul(I,q),n=n+Math.imul(j,F)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(P,F)|0,f=f+Math.imul(P,W)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,X)|0,f=f+Math.imul(S,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,f=f+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,f=f+Math.imul(b,ne)|0;var Oe=(s+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ce)|0)+Math.imul(h,fe)|0))<<13)|0;s=((f=f+Math.imul(h,ce)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,q))+Math.imul(N,V)|0,f=Math.imul(N,q),n=n+Math.imul(E,F)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(I,F)|0,f=f+Math.imul(I,W)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(P,X)|0,f=f+Math.imul(P,Z)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,f=f+Math.imul(M,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,f=f+Math.imul(g,ne)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,fe)|0,f=f+Math.imul(b,ce)|0;var xe=(s+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;s=((f=f+Math.imul(h,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,V),i=(i=Math.imul(C,q))+Math.imul(B,V)|0,f=Math.imul(B,q),n=n+Math.imul(R,F)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,F)|0,f=f+Math.imul(N,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(I,X)|0,f=f+Math.imul(I,Z)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(P,Y)|0,f=f+Math.imul(P,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,f=f+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,f=f+Math.imul(M,ne)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(g,fe)|0,f=f+Math.imul(g,ce)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,f=f+Math.imul(b,se)|0;var Se=(s+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;s=((f=f+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,q))+Math.imul(L,V)|0,f=Math.imul(L,q),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,F)|0,f=f+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,X)|0,f=f+Math.imul(N,Z)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,J)|0,n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(P,$)|0,f=f+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,f=f+Math.imul(S,ne)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(M,fe)|0,f=f+Math.imul(M,ce)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(g,oe)|0,f=f+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,ue)|0,f=f+Math.imul(b,he)|0;var ke=(s+(n=n+Math.imul(u,pe)|0)|0)+((8191&(i=(i=i+Math.imul(u,be)|0)+Math.imul(h,pe)|0))<<13)|0;s=((f=f+Math.imul(h,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,W))+Math.imul(L,F)|0,f=Math.imul(L,W),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,f=f+Math.imul(B,Z)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,Y)|0,f=f+Math.imul(N,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(I,$)|0,f=f+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(P,re)|0,f=f+Math.imul(P,ne)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,fe)|0,f=f+Math.imul(S,ce)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(M,oe)|0,f=f+Math.imul(M,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ue)|0,f=f+Math.imul(g,he)|0;var je=(s+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;s=((f=f+Math.imul(b,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,Z))+Math.imul(L,X)|0,f=Math.imul(L,Z),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,Y)|0,f=f+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,$)|0,f=f+Math.imul(N,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(I,re)|0,f=f+Math.imul(I,ne)|0,n=n+Math.imul(j,fe)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(P,fe)|0,f=f+Math.imul(P,ce)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(S,oe)|0,f=f+Math.imul(S,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(M,ue)|0,f=f+Math.imul(M,he)|0;var Pe=(s+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,pe)|0))<<13)|0;s=((f=f+Math.imul(g,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,J))+Math.imul(L,Y)|0,f=Math.imul(L,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,$)|0,f=f+Math.imul(B,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,f=f+Math.imul(N,ne)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(I,fe)|0,f=f+Math.imul(I,ce)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(P,oe)|0,f=f+Math.imul(P,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,ue)|0,f=f+Math.imul(S,he)|0;var Ae=(s+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(M,pe)|0))<<13)|0;s=((f=f+Math.imul(M,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(L,$)|0,f=Math.imul(L,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,f=f+Math.imul(B,ne)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,fe)|0,f=f+Math.imul(N,ce)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(I,oe)|0,f=f+Math.imul(I,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(P,ue)|0,f=f+Math.imul(P,he)|0;var Ee=(s+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(S,pe)|0))<<13)|0;s=((f=f+Math.imul(S,be)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(L,re)|0,f=Math.imul(L,ne),n=n+Math.imul(C,fe)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,fe)|0,f=f+Math.imul(B,ce)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,oe)|0,f=f+Math.imul(N,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(I,ue)|0,f=f+Math.imul(I,he)|0;var Ie=(s+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(P,pe)|0))<<13)|0;s=((f=f+Math.imul(P,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,ce))+Math.imul(L,fe)|0,f=Math.imul(L,ce),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,f=f+Math.imul(B,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,ue)|0,f=f+Math.imul(N,he)|0;var Te=(s+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(I,pe)|0))<<13)|0;s=((f=f+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,se))+Math.imul(L,oe)|0,f=Math.imul(L,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,ue)|0,f=f+Math.imul(B,he)|0;var Re=(s+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(N,pe)|0))<<13)|0;s=((f=f+Math.imul(N,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,he))+Math.imul(L,ue)|0,f=Math.imul(L,he);var Ne=(s+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(B,pe)|0))<<13)|0;s=((f=f+Math.imul(B,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var _e=(s+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(L,pe)|0))<<13)|0;return s=((f=Math.imul(L,be))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o[0]=me,o[1]=ye,o[2]=ge,o[3]=ve,o[4]=we,o[5]=Me,o[6]=Oe,o[7]=xe,o[8]=Se,o[9]=ke,o[10]=je,o[11]=Pe,o[12]=Ae,o[13]=Ee,o[14]=Ie,o[15]=Te,o[16]=Re,o[17]=Ne,o[18]=_e,0!==s&&(o[19]=s,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(l=h),f.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,f=0;f<r.length-1;f++){var c=i;i=0;for(var a=67108863&n,o=Math.min(f,t.length-1),s=Math.max(0,f-e.length+1);s<=o;s++){var d=f-s,u=(0|e.words[d])*(0|t.words[s]),h=67108863&u;a=67108863&(h=h+a|0),i+=(c=(c=c+(u/67108864|0)|0)+(h>>>26)|0)>>>26,c&=67108863}r.words[f]=a,n=c,c=i}return 0!==n?r.words[f]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=f.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.prototype.permute=function(e,t,r,n,i,f){for(var c=0;c<f;c++)n[c]=t[e[c]],i[c]=r[e[c]]},b.prototype.transform=function(e,t,r,n,i,f){this.permute(f,e,t,r,n,i);for(var c=1;c<i;c<<=1)for(var a=c<<1,o=Math.cos(2*Math.PI/a),s=Math.sin(2*Math.PI/a),d=0;d<i;d+=a)for(var u=o,h=s,l=0;l<c;l++){var p=r[d+l],b=n[d+l],m=r[d+l+c],y=n[d+l+c],g=u*m-h*y;y=u*y+h*m,m=g,r[d+l]=p+m,n[d+l]=b+y,r[d+l+c]=p-m,n[d+l+c]=b-y,l!==a&&(g=o*u-s*h,h=o*h+s*u,u=g)}},b.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},b.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}},b.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},b.prototype.convert13b=function(e,t,r,i){for(var f=0,c=0;c<t;c++)f+=0|e[c],r[2*c]=8191&f,f>>>=13,r[2*c+1]=8191&f,f>>>=13;for(c=2*t;c<i;++c)r[c]=0;n(0===f),n(0==(-8192&f))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),f=this.stub(n),c=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n),d=new Array(n),u=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,c,n),this.convert13b(t.words,t.length,s,n),this.transform(c,f,a,o,n,i),this.transform(s,f,d,u,n,i);for(var l=0;l<n;l++){var p=a[l]*d[l]-o[l]*u[l];o[l]=a[l]*u[l]+o[l]*d[l],a[l]=p}return this.conjugate(a,o,n),this.transform(a,o,h,f,n,i),this.conjugate(h,f,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},f.prototype.mul=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},f.prototype.mulf=function(e){var t=new f(null);return t.words=new Array(this.length+e.length),p(this,e,t)},f.prototype.imul=function(e){return this.clone().mulTo(e,this)},f.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,f=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=f>>>26,this.words[r]=67108863&f}return 0!==t&&(this.words[r]=t,this.length++),this},f.prototype.muln=function(e){return this.clone().imuln(e)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.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]&1<<i)>>>i}return t}(e);if(0===t.length)return new f(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},f.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t<this.length;t++){var a=this.words[t]&f,o=(0|this.words[t])-a<<r;this.words[t]=o|c,c=a>>>26-r}c&&(this.words[t]=c,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()},f.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},f.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var f=e%26,c=Math.min((e-f)/26,this.length),a=67108863^67108863>>>f<<f,o=r;if(i-=c,i=Math.max(0,i),o){for(var s=0;s<c;s++)o.words[s]=this.words[s];o.length=c}if(0===c);else if(this.length>c)for(this.length-=c,s=0;s<this.length;s++)this.words[s]=this.words[s+c];else this.words[0]=0,this.length=1;var d=0;for(s=this.length-1;s>=0&&(0!==d||s>=i);s--){var u=0|this.words[s];this.words[s]=d<<26-f|u>>>f,d=u&a}return o&&0!==d&&(o.words[o.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},f.prototype.shln=function(e){return this.clone().ishln(e)},f.prototype.ushln=function(e){return this.clone().iushln(e)},f.prototype.shrn=function(e){return this.clone().ishrn(e)},f.prototype.ushrn=function(e){return this.clone().iushrn(e)},f.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)},f.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()},f.prototype.maskn=function(e){return this.clone().imaskn(e)},f.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)},f.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},f.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()},f.prototype.addn=function(e){return this.clone().iaddn(e)},f.prototype.subn=function(e){return this.clone().isubn(e)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(e,t,r){var i,f,c=e.length+r;this._expand(c);var a=0;for(i=0;i<e.length;i++){f=(0|this.words[i+r])+a;var o=(0|e.words[i])*t;a=((f-=67108863&o)>>26)-(o/67108864|0),this.words[i+r]=67108863&f}for(;i<this.length-r;i++)a=(f=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&f;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(f=-(0|this.words[i])+a)>>26,this.words[i]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,c=0|i.words[i.length-1];0!==(r=26-this._countBits(c))&&(i=i.ushln(r),n.iushln(r),c=0|i.words[i.length-1]);var a,o=n.length-i.length;if("mod"!==t){(a=new f(null)).length=o+1,a.words=new Array(a.length);for(var s=0;s<a.length;s++)a.words[s]=0}var d=n.clone()._ishlnsubmul(i,1,o);0===d.negative&&(n=d,a&&(a.words[o]=1));for(var u=o-1;u>=0;u--){var h=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(h=Math.min(h/c|0,67108863),n._ishlnsubmul(i,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},f.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.iadd(e)),{div:i,mod:c}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(c=a.mod.neg(),r&&0!==c.negative&&c.isub(e)),{div:a.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new f(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new f(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new f(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,c,a},f.prototype.div=function(e){return this.divmod(e,"div",!1).div},f.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},f.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},f.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),f=r.cmp(n);return f<0||1===i&&0===f?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},f.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},f.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},f.prototype.divn=function(e){return this.clone().idivn(e)},f.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 f(1),c=new f(0),a=new f(0),o=new f(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var d=r.clone(),u=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()||c.isOdd())&&(i.iadd(d),c.isub(u)),i.iushrn(1),c.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;)(a.isOdd()||o.isOdd())&&(a.iadd(d),o.isub(u)),a.iushrn(1),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),c.isub(o)):(r.isub(t),a.isub(i),o.isub(c))}return{a:a,b:o,gcd:r.iushln(s)}},f.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,c=new f(1),a=new f(0),o=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var s=0,d=1;0==(t.words[0]&d)&&s<26;++s,d<<=1);if(s>0)for(t.iushrn(s);s-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(o),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),c.isub(a)):(r.isub(t),a.isub(c))}return(i=0===t.cmpn(1)?c:a).cmpn(0)<0&&i.iadd(e),i},f.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 f=t;t=r,r=f}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},f.prototype.invm=function(e){return this.egcd(e).a.umod(e)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(e){return this.words[0]&e},f.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 f=i,c=r;0!==f&&c<this.length;c++){var a=0|this.words[c];f=(a+=f)>>>26,a&=67108863,this.words[c]=a}return 0!==f&&(this.words[c]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.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},f.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},f.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},f.prototype.gtn=function(e){return 1===this.cmpn(e)},f.prototype.gt=function(e){return 1===this.cmp(e)},f.prototype.gten=function(e){return this.cmpn(e)>=0},f.prototype.gte=function(e){return this.cmp(e)>=0},f.prototype.ltn=function(e){return-1===this.cmpn(e)},f.prototype.lt=function(e){return-1===this.cmp(e)},f.prototype.lten=function(e){return this.cmpn(e)<=0},f.prototype.lte=function(e){return this.cmp(e)<=0},f.prototype.eqn=function(e){return 0===this.cmpn(e)},f.prototype.eq=function(e){return 0===this.cmp(e)},f.red=function(e){return new O(e)},f.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)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(e){return this.red=e,this},f.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},f.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},f.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},f.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},f.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},f.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},f.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},f.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=f._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 f(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)}y.prototype._tmp=function(){var e=new f(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.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},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.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 f=0|e.words[n];e.words[n-10]=(4194303&f)<<4|i>>>22,i=f}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.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(v,y),i(w,y),i(M,y),M.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},f._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return m[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):e.umod(this.m)._forceRed(this)},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 f(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),c=0;!i.isZero()&&0===i.andln(1);)c++,i.iushrn(1);n(!i.isZero());var a=new f(1).toRed(this),o=a.redNeg(),s=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new f(2*d*d).toRed(this);0!==this.pow(d,s).cmp(o);)d.redIAdd(o);for(var u=this.pow(d,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=c;0!==l.cmp(a);){for(var b=l,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var y=this.pow(u,new f(1).iushln(p-m-1));h=h.redMul(y),u=y.redSqr(),l=l.redMul(u),p=m}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 f(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new f(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],c=0,a=0,o=t.bitLength()%26;for(0===o&&(o=26),n=t.length-1;n>=0;n--){for(var s=t.words[n],d=o-1;d>=0;d--){var u=s>>d&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==c?(c<<=1,c|=u,(4===++a||0===n&&0===d)&&(i=this.mul(i,r[c]),a=0,c=0)):a=0}o=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},f.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),f=i;return i.cmp(this.m)>=0?f=i.isub(this.m):i.cmpn(0)<0&&(f=i.iadd(this.m)),f._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new f(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),c=i;return i.cmp(this.m)>=0?c=i.isub(this.m):i.cmpn(0)<0&&(c=i.iadd(this.m)),c._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(78)(e))},,,,,,,,,,,,,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return b}));var n=r(353),i=r(352),f=r(183),c=r(89),a=r(351),o=r(194),s=r(134),d=r(40);const u={debug:"log",error:"error",log:"log",warn:"warn"};function h(e){return Array.isArray(e)?e.map(h):Object(i.a)(e)?e.toString():Object(o.a)(e)||Object(f.a)(e)?Object(s.a)(Object(d.a)(e)):function(e){return e&&Object(a.a)(e)&&e.constructor===Object?Object.keys(e).reduce((t,r)=>(t[r]=h(e[r]),t),{}):e}(e)}function l(e,t,r,i=-1){if(1===r.length&&Object(c.a)(r[0])){const n=r[0]();return l(e,t,Array.isArray(n)?n:[n],i)}console[u[e]](Object(n.a)(new Date),t,...r.map(h).map(e=>{if(i<=0)return e;const t=""+e;return t.length<i?e:t.substr(0,i)+" ..."}))}function p(){}function b(t){const r=(t.toUpperCase()+":").padStart(16),[n,i]=function(t){const r=("object"==typeof e?e:{}).env||{},n=parseInt(r.DEBUG_MAX||"-1",10);let i=!1;return(r.DEBUG||"").toLowerCase().split(",").forEach(e=>{e&&("*"===e||t===e||e.endsWith("*")&&t.startsWith(e.slice(0,-1)))&&(i=!0),e&&e.startsWith("-")&&(t===e.slice(1)||e.endsWith("*")&&t.startsWith(e.slice(1,-1)))&&(i=!1)}),[i,isNaN(n)?-1:n]}(t.toLowerCase());return{debug:n?(...e)=>l("debug",r,e,i):p,error:(...e)=>l("error",r,e),log:(...e)=>l("log",r,e),noop:p,warn:(...e)=>l("warn",r,e)}}}).call(this,r(26))},function(e,t,r){"use strict";(function(e){function n(t){return e.from(t||[])}r.d(t,"a",(function(){return n}))}).call(this,r(19).Buffer)},function(e,t,r){const n=r(697);t.Observable=n.Observable,t.ConnectableObservable=n.ConnectableObservable,t.GroupedObservable=n.GroupedObservable,t.observable=n.observable,t.Subject=n.Subject,t.BehaviorSubject=n.BehaviorSubject,t.ReplaySubject=n.ReplaySubject,t.AsyncSubject=n.AsyncSubject,t.asap=n.asap,t.asapScheduler=n.asapScheduler,t.async=n.async,t.asyncScheduler=n.asyncScheduler,t.queue=n.queue,t.queueScheduler=n.queueScheduler,t.animationFrame=n.animationFrame,t.animationFrameScheduler=n.animationFrameScheduler,t.VirtualTimeScheduler=n.VirtualTimeScheduler,t.VirtualAction=n.VirtualAction,t.Scheduler=n.Scheduler,t.Subscription=n.Subscription,t.Subscriber=n.Subscriber,t.Notification=n.Notification,t.NotificationKind=n.NotificationKind,t.pipe=n.pipe,t.noop=n.noop,t.identity=n.identity,t.isObservable=n.isObservable,t.ArgumentOutOfRangeError=n.ArgumentOutOfRangeError,t.EmptyError=n.EmptyError,t.ObjectUnsubscribedError=n.ObjectUnsubscribedError,t.UnsubscriptionError=n.UnsubscriptionError,t.TimeoutError=n.TimeoutError,t.bindCallback=n.bindCallback,t.bindNodeCallback=n.bindNodeCallback,t.combineLatest=n.combineLatest,t.concat=n.concat,t.defer=n.defer,t.empty=n.empty,t.forkJoin=n.forkJoin,t.from=n.from,t.fromEvent=n.fromEvent,t.fromEventPattern=n.fromEventPattern,t.generate=n.generate,t.iif=n.iif,t.interval=n.interval,t.merge=n.merge,t.never=n.never,t.of=n.of,t.onErrorResumeNext=n.onErrorResumeNext,t.pairs=n.pairs,t.partition=n.partition,t.race=n.race,t.range=n.range,t.throwError=n.throwError,t.timer=n.timer,t.using=n.using,t.zip=n.zip,t.scheduled=n.scheduled,t.EMPTY=n.EMPTY,t.NEVER=n.NEVER,t.config=n.config},function(e,t,r){const n=r(696);t.audit=n.audit,t.auditTime=n.auditTime,t.buffer=n.buffer,t.bufferCount=n.bufferCount,t.bufferTime=n.bufferTime,t.bufferToggle=n.bufferToggle,t.bufferWhen=n.bufferWhen,t.catchError=n.catchError,t.combineAll=n.combineAll,t.combineLatest=n.combineLatest,t.concat=n.concat,t.concatAll=n.concatAll,t.concatMap=n.concatMap,t.concatMapTo=n.concatMapTo,t.count=n.count,t.debounce=n.debounce,t.debounceTime=n.debounceTime,t.defaultIfEmpty=n.defaultIfEmpty,t.delay=n.delay,t.delayWhen=n.delayWhen,t.dematerialize=n.dematerialize,t.distinct=n.distinct,t.distinctUntilChanged=n.distinctUntilChanged,t.distinctUntilKeyChanged=n.distinctUntilKeyChanged,t.elementAt=n.elementAt,t.endWith=n.endWith,t.every=n.every,t.exhaust=n.exhaust,t.exhaustMap=n.exhaustMap,t.expand=n.expand,t.filter=n.filter,t.finalize=n.finalize,t.find=n.find,t.findIndex=n.findIndex,t.first=n.first,t.groupBy=n.groupBy,t.ignoreElements=n.ignoreElements,t.isEmpty=n.isEmpty,t.last=n.last,t.map=n.map,t.mapTo=n.mapTo,t.materialize=n.materialize,t.max=n.max,t.merge=n.merge,t.mergeAll=n.mergeAll,t.mergeMap=n.mergeMap,t.flatMap=n.flatMap,t.mergeMapTo=n.mergeMapTo,t.mergeScan=n.mergeScan,t.min=n.min,t.multicast=n.multicast,t.observeOn=n.observeOn,t.onErrorResumeNext=n.onErrorResumeNext,t.pairwise=n.pairwise,t.partition=n.partition,t.pluck=n.pluck,t.publish=n.publish,t.publishBehavior=n.publishBehavior,t.publishLast=n.publishLast,t.publishReplay=n.publishReplay,t.race=n.race,t.reduce=n.reduce,t.repeat=n.repeat,t.repeatWhen=n.repeatWhen,t.retry=n.retry,t.retryWhen=n.retryWhen,t.refCount=n.refCount,t.sample=n.sample,t.sampleTime=n.sampleTime,t.scan=n.scan,t.sequenceEqual=n.sequenceEqual,t.share=n.share,t.shareReplay=n.shareReplay,t.single=n.single,t.skip=n.skip,t.skipLast=n.skipLast,t.skipUntil=n.skipUntil,t.skipWhile=n.skipWhile,t.startWith=n.startWith,t.subscribeOn=n.subscribeOn,t.switchAll=n.switchAll,t.switchMap=n.switchMap,t.switchMapTo=n.switchMapTo,t.take=n.take,t.takeLast=n.takeLast,t.takeUntil=n.takeUntil,t.takeWhile=n.takeWhile,t.tap=n.tap,t.throttle=n.throttle,t.throttleTime=n.throttleTime,t.throwIfEmpty=n.throwIfEmpty,t.timeInterval=n.timeInterval,t.timeout=n.timeout,t.timeoutWith=n.timeoutWith,t.timestamp=n.timestamp,t.toArray=n.toArray,t.window=n.window,t.windowCount=n.windowCount,t.windowTime=n.windowTime,t.windowToggle=n.windowToggle,t.windowWhen=n.windowWhen,t.withLatestFrom=n.withLatestFrom,t.zip=n.zip,t.zipAll=n.zipAll}]);