minterjs-tx
Version:
A simple module for creating, manipulating and signing Minter transactions
3 lines • 369 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).minterTx={})}(this,(function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function h(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h(this,r)}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(t,e)||d(t,e)||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 d(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}var b="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m=[],g=[],v="undefined"!=typeof Uint8Array?Uint8Array:Array,y=!1;function w(){y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)m[e]=t[e],g[t.charCodeAt(e)]=e;g["-".charCodeAt(0)]=62,g["_".charCodeAt(0)]=63}function _(t,e,r){for(var n,i,o=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],o.push(m[(i=n)>>18&63]+m[i>>12&63]+m[i>>6&63]+m[63&i]);return o.join("")}function M(t){var e;y||w();for(var r=t.length,n=r%3,i="",o=[],a=16383,s=0,f=r-n;s<f;s+=a)o.push(_(t,s,s+a>f?f:s+a));return 1===n?(e=t[r-1],i+=m[e>>2],i+=m[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=m[e>>10],i+=m[e>>4&63],i+=m[e<<2&63],i+="="),o.push(i),o.join("")}function S(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,h=f>>1,u=-7,c=r?i-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-u)-1,l>>=-u,u+=s;u>0;o=256*o+t[e+c],c+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===f)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=h}return(l?-1:1)*a*Math.pow(2,o-n)}function E(t,e,r,n,i,o){var a,s,f,h=8*o-i-1,u=(1<<h)-1,c=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?d/f:d*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(e*f-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<<i|s,h+=i;h>0;t[r+l]=255&a,l+=p,a/=256,h-=8);t[r+l-p]|=128*b}var A={}.toString,x=Array.isArray||function(t){return"[object Array]"==A.call(t)};L.TYPED_ARRAY_SUPPORT=void 0===b.TYPED_ARRAY_SUPPORT||b.TYPED_ARRAY_SUPPORT;var R=k();function k(){return L.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(t,e){if(k()<e)throw new RangeError("Invalid typed array length");return L.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=L.prototype:(null===t&&(t=new L(e)),t.length=e),t}function L(t,e,r){if(!(L.TYPED_ARRAY_SUPPORT||this instanceof L))return new L(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return B(this,t)}return I(this,t,e,r)}function I(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);L.TYPED_ARRAY_SUPPORT?(t=e).__proto__=L.prototype:t=P(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!L.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|D(e,r),i=(t=T(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(N(e)){var r=0|C(e.length);return 0===(t=T(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?T(t,0):P(t,e);if("Buffer"===e.type&&x(e.data))return P(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function O(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function B(t,e){if(O(e),t=T(t,e<0?0:0|C(e)),!L.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function P(t,e){var r=e.length<0?0:0|C(e.length);t=T(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function C(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return 0|t}function N(t){return lt(t)}function D(t,e){if(N(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ut(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ct(t).length;default:if(n)return ut(t).length;e=(""+e).toLowerCase(),n=!0}}function z(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Q(this,e,r);case"utf8":case"utf-8":return J(this,e,r);case"ascii":return G(this,e,r);case"latin1":case"binary":return $(this,e,r);case"base64":return Z(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function j(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function q(t,e,r,n,i){if(0===t.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:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=L.from(e,n)),N(e))return 0===e.length?-1:U(t,e,r,n,i);if("number"==typeof e)return e&=255,L.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):U(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function U(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function h(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=r;o<s;o++)if(h(t,o)===h(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===f)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var c=!0,d=0;d<f;d++)if(h(t,o+d)!==h(e,d)){c=!1;break}if(c)return o}return-1}function K(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function F(t,e,r,n){return dt(ut(e,t.length-r),t,r,n)}function H(t,e,r,n){return dt(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function V(t,e,r,n){return H(t,e,r,n)}function W(t,e,r,n){return dt(ct(e),t,r,n)}function Y(t,e,r,n){return dt(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function Z(t,e,r){return 0===e&&r===t.length?M(t):M(t.slice(e,r))}function J(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,h=t[i],u=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=r)switch(c){case 1:h<128&&(u=h);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&h)<<6|63&o)>127&&(u=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&h)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(u=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&h)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(u=f)}null===u?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=c}return function(t){var e=t.length;if(e<=X)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=X));return r}(n)}L.poolSize=8192,L._augment=function(t){return t.__proto__=L.prototype,t},L.from=function(t,e,r){return I(null,t,e,r)},L.TYPED_ARRAY_SUPPORT&&(L.prototype.__proto__=Uint8Array.prototype,L.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&L[Symbol.species]),L.alloc=function(t,e,r){return function(t,e,r,n){return O(e),e<=0?T(t,e):void 0!==r?"string"==typeof n?T(t,e).fill(r,n):T(t,e).fill(r):T(t,e)}(null,t,e,r)},L.allocUnsafe=function(t){return B(null,t)},L.allocUnsafeSlow=function(t){return B(null,t)},L.isBuffer=lt,L.compare=function(t,e){if(!N(t)||!N(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},L.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},L.concat=function(t,e){if(!x(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return L.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=L.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!N(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},L.byteLength=D,L.prototype._isBuffer=!0,L.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)j(this,e,e+1);return this},L.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)j(this,e,e+3),j(this,e+1,e+2);return this},L.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)j(this,e,e+7),j(this,e+1,e+6),j(this,e+2,e+5),j(this,e+3,e+4);return this},L.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?J(this,0,t):z.apply(this,arguments)},L.prototype.equals=function(t){if(!N(t))throw new TypeError("Argument must be a Buffer");return this===t||0===L.compare(this,t)},L.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},L.prototype.compare=function(t,e,r,n,i){if(!N(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),u=0;u<s;++u)if(f[u]!==h[u]){o=f[u],a=h[u];break}return o<a?-1:a<o?1:0},L.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},L.prototype.indexOf=function(t,e,r){return q(this,t,e,r,!0)},L.prototype.lastIndexOf=function(t,e,r){return q(this,t,e,r,!1)},L.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return K(this,t,e,r);case"utf8":case"utf-8":return F(this,t,e,r);case"ascii":return H(this,t,e,r);case"latin1":case"binary":return V(this,t,e,r);case"base64":return W(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},L.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;function G(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function $(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Q(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=ht(t[o]);return i}function tt(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function et(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function rt(t,e,r,n,i,o){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function nt(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function it(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function ot(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function at(t,e,r,n,i){return i||ot(t,0,r,4),E(t,e,r,n,23,4),r+4}function st(t,e,r,n,i){return i||ot(t,0,r,8),E(t,e,r,n,52,8),r+8}L.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),L.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=L.prototype;else{var i=e-t;r=new L(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},L.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||et(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},L.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||et(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},L.prototype.readUInt8=function(t,e){return e||et(t,1,this.length),this[t]},L.prototype.readUInt16LE=function(t,e){return e||et(t,2,this.length),this[t]|this[t+1]<<8},L.prototype.readUInt16BE=function(t,e){return e||et(t,2,this.length),this[t]<<8|this[t+1]},L.prototype.readUInt32LE=function(t,e){return e||et(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},L.prototype.readUInt32BE=function(t,e){return e||et(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},L.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||et(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},L.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||et(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},L.prototype.readInt8=function(t,e){return e||et(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},L.prototype.readInt16LE=function(t,e){e||et(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt16BE=function(t,e){e||et(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},L.prototype.readInt32LE=function(t,e){return e||et(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},L.prototype.readInt32BE=function(t,e){return e||et(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},L.prototype.readFloatLE=function(t,e){return e||et(t,4,this.length),S(this,t,!0,23,4)},L.prototype.readFloatBE=function(t,e){return e||et(t,4,this.length),S(this,t,!1,23,4)},L.prototype.readDoubleLE=function(t,e){return e||et(t,8,this.length),S(this,t,!0,52,8)},L.prototype.readDoubleBE=function(t,e){return e||et(t,8,this.length),S(this,t,!1,52,8)},L.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||rt(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},L.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||rt(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},L.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,1,255,0),L.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},L.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):nt(this,t,e,!0),e+2},L.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,2,65535,0),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):nt(this,t,e,!1),e+2},L.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):it(this,t,e,!0),e+4},L.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,4,4294967295,0),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):it(this,t,e,!1),e+4},L.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);rt(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},L.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);rt(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},L.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,1,127,-128),L.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},L.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):nt(this,t,e,!0),e+2},L.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,2,32767,-32768),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):nt(this,t,e,!1),e+2},L.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,4,2147483647,-2147483648),L.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):it(this,t,e,!0),e+4},L.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||rt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),L.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):it(this,t,e,!1),e+4},L.prototype.writeFloatLE=function(t,e,r){return at(this,t,e,!0,r)},L.prototype.writeFloatBE=function(t,e,r){return at(this,t,e,!1,r)},L.prototype.writeDoubleLE=function(t,e,r){return st(this,t,e,!0,r)},L.prototype.writeDoubleBE=function(t,e,r){return st(this,t,e,!1,r)},L.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!L.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},L.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!L.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=N(t)?t:ut(new L(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var ft=/[^+\/0-9A-Za-z-_]/g;function ht(t){return t<16?"0"+t.toString(16):t.toString(16)}function ut(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function ct(t){return function(t){var e,r,n,i,o,a;y||w();var s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[s-2]?2:"="===t[s-1]?1:0,a=new v(3*s/4-o),n=o>0?s-4:s;var f=0;for(e=0,r=0;e<n;e+=4,r+=3)i=g[t.charCodeAt(e)]<<18|g[t.charCodeAt(e+1)]<<12|g[t.charCodeAt(e+2)]<<6|g[t.charCodeAt(e+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=g[t.charCodeAt(e)]<<2|g[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=g[t.charCodeAt(e)]<<10|g[t.charCodeAt(e+1)]<<4|g[t.charCodeAt(e+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(ft,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function dt(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function lt(t){return null!=t&&(!!t._isBuffer||pt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&pt(t.slice(0,0))}(t))}function pt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var gt={},vt={exports:{}},yt=mt(Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:R,Buffer:L,SlowBuffer:function(t){return+t!=t&&(t=0),L.alloc(+t)},isBuffer:lt}));!function(t){!function(t,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:yt.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function f(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,i){for(var o=0,a=0,s=Math.min(t.length,r),f=e;f<s;f++){var h=t.charCodeAt(f)-48;o*=i,a=h>=49?h-49+10:h>=17?h-17+10:h,n(h>=0&&a<i,"Invalid character"),o+=a}return o}function u(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"===e(t)&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,r,i){if("number"==typeof t)return this._initNumber(t,r,i);if("object"===e(t))return this._initArray(t,r,i);"hex"===r&&(r=16),n(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,i):(this._parseBase(t,r,o),"le"===i&&this._initArray(this.toArray(),r,i)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,u=r;u<s;u+=n)f=h(t,u,u+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var c=1;for(f=h(t,u,t.length,e),u=0;u<a;u++)c*=e;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){u(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],f=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-f.length]+f+r:f+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],u=p[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var b=c.modrn(u).toString(t);r=(c=c.idivn(u)).isZero()?b+r:d[h-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function b(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var h=1;h<n;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(a=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;t[r++]=255&a,r<t.length&&(t[r++]=a>>8&255),r<t.length&&(t[r++]=a>>16&255),6===o?(r<t.length&&(t[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;t[r--]=255&a,r>=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a<n.length;a++)o=(e=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,o,a=t.words,s=e.words,f=r.words,h=0,u=0|a[0],c=8191&u,d=u>>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,M=0|a[4],S=8191&M,E=M>>>13,A=0|a[5],x=8191&A,R=A>>>13,k=0|a[6],T=8191&k,L=k>>>13,I=0|a[7],O=8191&I,B=I>>>13,P=0|a[8],C=8191&P,N=P>>>13,D=0|a[9],z=8191&D,j=D>>>13,q=0|s[0],U=8191&q,K=q>>>13,F=0|s[1],H=8191&F,V=F>>>13,W=0|s[2],Y=8191&W,Z=W>>>13,J=0|s[3],X=8191&J,G=J>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ft=8191&st,ht=st>>>13,ut=0|s[8],ct=8191&ut,dt=ut>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(d,U)|0))<<13)|0;h=((o=Math.imul(d,K))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,K))+Math.imul(b,U)|0,o=Math.imul(b,K);var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,H)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,K))+Math.imul(v,U)|0,o=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Z)|0)+Math.imul(d,Y)|0))<<13)|0;h=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,K))+Math.imul(_,U)|0,o=Math.imul(_,K),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var yt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,K))+Math.imul(E,U)|0,o=Math.imul(E,K),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var wt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,K))+Math.imul(R,U)|0,o=Math.imul(R,K),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,K))+Math.imul(L,U)|0,o=Math.imul(L,K),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,K))+Math.imul(B,U)|0,o=Math.imul(B,K),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var St=(h+(n=n+Math.imul(c,ft)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,K))+Math.imul(N,U)|0,o=Math.imul(N,K),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Et=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,K))+Math.imul(j,U)|0,o=Math.imul(j,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,H),i=(i=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Rt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,G))+Math.imul(j,X)|0,o=Math.imul(j,G),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Tt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var It=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,ft),i=(i=Math.imul(z,ht))+Math.imul(j,ft)|0,o=Math.imul(j,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Ot=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,ct),i=(i=Math.imul(z,dt))+Math.imul(j,ct)|0,o=Math.imul(j,dt);var Bt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Pt=(h+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,bt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,f[0]=mt,f[1]=gt,f[2]=vt,f[3]=yt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=St,f[8]=Et,f[9]=At,f[10]=xt,f[11]=Rt,f[12]=kt,f[13]=Tt,f[14]=Lt,f[15]=It,f[16]=Ot,f[17]=Bt,f[18]=Pt,0!==h&&(f[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;s=67108863&(d=d+s|0),i+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(t,e,r){return g(t,e,r)}Math.imul||(m=b),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?b(this,t,e):r<1024?g(this,t,e):v(this,t,e)},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),v(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,f=(0|this.words[e])-s<<r;this.words[e]=f|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,f=r;if(i-=a,i=Math.max(0,i),f){for(var h=0;h<a;h++)f.words[h]=this.words[h];f.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=i);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var f=(0|t.words[i])*e;s=((o-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==e){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var u=n.clone()._ishlnsubmul(i,1,f);0===u.negative&&(n=u,s&&(s.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=d)}return s&&s._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var u=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(c)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(c)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(f)):(r.isub(e),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<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(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(_,w),_.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(M,w),i(S,w),i(E,w),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new M;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return y[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(u(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(c,new o(1).iushln(p-m-1));d=d.redMul(g),c=g.redSqr(),l=l.redMul(c),p=m}return d},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],a=0,s=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],u=f-1;u>=0;u--){var c=h>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,bt)}(vt);var wt=vt.exports,_t=bt&&bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gt,"__esModule",{value:!0}),gt.getLength=xt=gt.decode=St=gt.encode=void 0;var Mt=_t(vt.exports);var St=gt.encode=function t(e){if(Array.isArray(e)){for(var r=[],n=0;n<e.length;n++)r.push(t(e[n]));var i=L.concat(r);return L.concat([At(i.length,192),i])}var o=Lt(e);return 1===o.length&&o[0]<128?o:L.concat([At(o.length,128),o])};function Et(t,e){if("0"===t[0]&&"0"===t[1])throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function At(t,e){if(t<56)return L.from([t+e]);var r=Tt(t),n=Tt(e+55+r.length/2);return L.from(n+r,"hex")}var xt=gt.decode=function(t,e){if(void 0===e&&(e=!1),!t||0===t.length)return L.from([]);var r=Rt(Lt(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid remainder");return r.data};function Rt(t){var e,r,n,i,o,a=[],s=t[0];if(s<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(s<=183){if(e=s-127,n=128===s?L.from([]):t.slice(1,e),2===e&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:t.slice(e)}}if(s<=191){if(r=s-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if((e=Et(t.slice(1,r).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((n=t.slice(r,e+r)).length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:t.slice(e+r)}}if(s<=247){for(e=s-191,i=t.slice(1,e);i.length;)o=Rt(i),a.push(o.data),i=o.remainder;return{data:a,remainder:t.slice(e)}}var f=(r=s-246)+(e=Et(t.slice(1,r).toString("hex"),16));if(f>t.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(i=t.slice(r,f)).length)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)o=Rt(i),a.push(o.data),i=o.remainder;return{data:a,remainder:t.slice(f)}}function kt(t){return"0x"===t.slice(0,2)}function Tt(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function Lt(t){if(!lt(t)){if("string"==typeof t)return kt(t)?L.from((r="string"!=typeof(n=t)?n:kt(n)?n.slice(2):n).length%2?"0"+r:r,"hex"):L.from(t);if("number"==typeof t||"bigint"==typeof t)return t?(e=Tt(t),L.from(e,"hex")):L.from([]);if(null==t)return L.from([]);if(t instanceof Uint8Array)return L.from(t);if(Mt.default.isBN(t))return L.from(t.toArray());throw new Error("invalid type")}var e,r,n;return t}gt.getLength=function(t){if(!t||0===t.length)return L.from([]);var e=Lt(t),r=e[0];if(r<=127)return e.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var n=r-246;return n+Et(e.slice(1,n).toString("hex"),16)};var It={},Ot={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createHashFunction=function(t){return function(e){var r=t();return r.update(e),L.from(r.digest())}};var Pt={exports:{}};function Ct(){throw new Error("setTimeout has not been defined")}function Nt(){throw new Error("clearTimeout has not been defined")}var Dt=Ct,zt=Nt;function jt(t){if(Dt===setTimeout)return setTimeout(t,0);if((Dt===Ct||!Dt)&&setTimeout)return Dt=setTimeout,setTimeout(t,0);try{return Dt(t,0)}catch(e){try{return Dt.call(null,t,0)}catch(e){return Dt.call(this,t,0)}}}"function"==typeof b.setTimeout&&(Dt=setTimeout),"function"==typeof b.clearTimeout&&(zt=clearTimeout);var qt,Ut=[],Kt=!1,Ft=-1;function Ht(){Kt&&qt&&(Kt=!1,qt.length?Ut=qt.concat(Ut):Ft=-1,Ut.length&&Vt())}function Vt(){if(!Kt){var t=jt(Ht);Kt=!0;for(var e=Ut.length;e;){for(qt=Ut,Ut=[];++Ft<e;)qt&&qt[Ft].run();Ft=-1,e=Ut.length}qt=null,Kt=!1,function(t){if(zt===clearTimeout)return clearTimeout(t);if((zt===Nt||!zt)&&clearTimeout)return zt=clearTimeout,clearTimeout(t);try{zt(t)}catch(e){try{return zt.call(null,t)}catch(e){return zt.call(this,t)}}}(t)}}function Wt(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ut.push(new Yt(t,e)),1!==Ut.length||Kt||jt(Vt)}function Yt(t,e){this.fun=t,this.array=e}Yt.prototype.run=function(){this.fun.apply(null,this.array)};function Zt(){}var Jt=Zt,Xt=Zt,Gt=Zt,$t=Zt,Qt=Zt,te=Zt,ee=Zt;var re=b.performance||{},ne=re.now||re.mozNow||re.msNow||re.oNow||re.webkitNow||function(){return(new Date).getTime()};var ie=new Date;var oe={nextTick:Wt,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Jt,addListener:Xt,once:Gt,off:$t,removeListener:Qt,removeAllListeners:te,emit:ee,binding:function(t){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(t){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*ne.call(re),r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r-=t[0],(n-=t[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ie)/1e3}};function ae(){}function se(){se.init.call(this)}function fe(t){return void 0===t._maxListeners?se.defaultMaxListeners:t._maxListeners}function he(t,e,r){if(e)t.call(r);else for(var n=t.length,i=ge(t,n),o=0;o<n;++o)i[o].call(r)}function ue(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,o=ge(t,i),a=0;a<i;++a)o[a].call(r,n)}function ce(t,e,r,n,i){if(e)t.call(r,n,i);else for(var o=t.length,a=ge(t,o),s=0;s<o;++s)a[s].call(r,n,i)}function de(t,e,r,n,i,o){if(e)t.call(r,n,i,o);else for(var a=t.length,s=ge(t,a),f=0;f<a;++f)s[f].call(r,n,i,o)}function le(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,o=ge(t,i),a=0;a<i;++a)o[a].apply(r,n)}function pe(t,e,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]):(o=t._events=new ae,t._eventsCount=0),a){if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(i=fe(t))&&i>0&&a.length>i){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,s=f,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[e]=r,++t._eventsCount;return t}function be(t,e,r){var n=!1;function i(){t.removeListener(e,i),n||(n=!0,r.apply(t,arguments))}return i.listener=r,i}function me(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function ge(t,e){for(var r=new Array(e);e--;)r[e]=t[e];return r}ae.prototype=Object.create(null),se.EventEmitter=se,se.usingDomains=!1,se.prototype.domain=void 0,se.prototype._events=void 0,se.prototype._maxListeners=void 0,se.defaultMaxListeners=10,se.init=function(){this.domain=null,se.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ae,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},se.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},se.prototype.getMaxListeners=function(){return fe(this)},se.prototype.emit=function(t){var e,r,n,i,o,a,s,f="error"===t;if(a=this._events)f=f&&null==a.error;else if(!f)return!1;if(s=this.domain,f){if(e=arguments[1],!s){if(e instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=s,e.domainThrown=!1,s.emit("error",e),!1}if(!(r=a[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:he(r,u,this);break;case 2:ue(r,u,this,arguments[1]);break;case 3:ce(r,u,this,arguments[1],arguments[2]);break;case 4:de(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];le(r,u,this,i)}return!0},se.prototype.addListener=function(t,e){return pe(this,t,e,!1)},se.prototype.on=se.prototype.addListener,se.prototype.prependListener=function(t,e){return pe(this,t,e,!0)},se.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,be(this,t,e)),this},se.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,be(this,t,e)),this},se.prototype.removeListener=function(t,e){var r,n,i,o,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[t]))return this;if(r===e||r.listener&&r.listener===e)0==--this._eventsCount?this._events=new ae:(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length;o-- >0;)if(r[o]===e||r[o].listener&&r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ae,this;delete n[t]}else!function(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}(r,i);n.removeListener&&this.emit("removeListener",t,a||e)}return this},se.prototype.removeAllListeners=function(t){var e,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new ae,this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=new ae:delete r[t]),this;if(0===arguments.length){for(var n,i=Object.keys(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new ae,this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},se.prototype.listeners=function(t){var e,r=this._events;return r&&(e=r[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(e):[]},se.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):me.call(t,e)},se.prototype.listenerCount=me,se.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var ve=mt(Object.freeze({__proto__:null,default:se,EventEmitter:se})),ye=ve.EventEmitter,we="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},_e=/%[sdj%]/g;function Me(t){if(!ze(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Re(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(_e,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<i;a=n[++r])Ce(a)||!Ke(a)?o+=" "+a:o+=" "+Re(a);return o}function Se(t,e){if(qe(b.process))return function(){return Se(t,e).apply(this,arguments)};if(!0===oe.noDeprecation)return t;var r=!1;return function(){if(!r){if(oe.throwDeprecation)throw new Error(e);oe.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}}var Ee,Ae={};function xe(t){if(qe(Ee)&&(Ee=oe.env.NODE_DEBUG||""),t=t.toUpperCase(),!Ae[t])if(new RegExp("\\b"+t+"\\b","i").test(Ee)){Ae[t]=function(){var e=Me.apply(null,arguments);console.error("%s %d: %s",t,0,e)}}else Ae[t]=function(){};return Ae[t]}function Re(t,e){var r={seen:[],stylize:Te};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Pe(e)?r.showHidden=e:e&&Qe(r,e),qe(r.showHidden)&&(r.showHidden=!1),qe(r.depth)&&(r.depth=2),qe(r.colors)&&(r.colors=!1),qe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=ke),Le(r,t,r.depth)}function ke(t,e){var r=Re.styles[e];return r?"["+Re.colors[r][0]+"m"+t+"["+Re.colors[r][1]+"m":t}function Te(t,e){return t}function Le(t,e,r){if(t.customInspect&&e&&Ve(e.inspect)&&e.inspect!==Re&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return ze(n)||(n=Le(t,n,r)),n}var i=function(t,e){if(qe(e))return t.stylize("undefined","undefined");if(ze(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(De(e))return t.stylize(""+e,"number");if(Pe(e))return t.stylize(""+e,"boolean");if(Ce(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),He(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ie(e);if(0===o.length){if(Ve(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Ue(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Fe(e))return t.stylize(Date.prototype.toString.call(e),"date");if(He(e))return Ie(e)}var f,h="",u=!1,c=["{","}"];(Be(e)&&(u=!0,c=["[","]"]),Ve(e))&&(h=" [Function"+(e.name?": "+e.name:"")+"]");return Ue(e)&&(h=" "+RegExp.prototype.toString.call(e)),Fe(e)&&(h=" "+Date.prototype.toUTCString.call(e)),He(e)&&(h=" "+Ie(e)),0!==o.length||u&&0!=e.length?r<0?Ue(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),f=u?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)tr(e,String(a))?o.push(Oe(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Oe(t,e,r,n,i,!0))})),o}(t,e,r,a,o):o.map((function(n){return Oe(t,e,r,a,n,u)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(f,h,c)):c[0]+h+c[1]}function Ie(t){return"["+Error.prototype.toString.call(t)+"]"}function Oe(t,e,r,n,i,o){var a,s,f;if((f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=f.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):f.set&&(s=t.stylize("[Setter]","special")),tr(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(f.value)<0?(s=Ce(r)?Le(t,f.value,null):Le(t,f.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),qe(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function Be(t){return Array.isArray(t)}function Pe(t){return"boolean"==typeof t}function Ce(t){return null===t}function Ne(t){return null==t}function De(t){return"number"==typeof t}function ze(t){return"string"==typeof t}function je(t){return"symbol"===e(t)}function qe(t){return void 0===t}function Ue(t){return Ke(t)&&"[object RegExp]"===Ze(t)}function Ke(t){return"object"===e(t)&&null!==t}function Fe(t){return Ke(t)&&"[object Date]"===Ze(t)}function He(t){return Ke(t)&&("[object Error]"===Ze(t)||t instanceof Error)}function Ve(t){return"function"==typeof t}function We(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===e(t)||void 0===t}function Ye(t){return lt(t)}function Ze(t){return Object.prototype.toString.call(t)}function Je(t){return t<10?"0"+t.toString(10):t.toString(10)}Re.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Re.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ge(){var t=new Date,e=[Je(t.getHours()),Je(t.getMinutes()),Je(t.getSeconds())].join(":");return[t.getDate(),Xe[t.getMonth()],e].join(" ")}function $e(){console.log("%s - %s",Ge(),Me.apply(null,arguments))}function Qe(t,e){if(!e||!Ke(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function tr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var er,rr,nr={inherits:we,_extend:Qe,log:$e,isBuffer:Ye,isPrimitive:We,isFunction:Ve,isError:He,isDate:Fe,isObject:Ke,isRegExp:Ue,isUndefined:qe,isSymbol:je,isString:ze,isNumber:De,isNullOrUndefined:Ne,isNull:Ce,isBoolean:Pe,isArray:Be,inspect:Re,deprecate:Se,format:Me,debuglog:xe},ir=mt(Object.freeze({__proto__:null,format:Me,deprecate:Se,debuglog:xe,inspect:Re,isArray:Be,isBoolean:Pe,isNull:Ce,isNullOrUndefined:Ne,isNumber:De,isString:ze,isSymbol:je,isUndefined:qe,isRegExp:Ue,isObject:Ke,isDate:Fe,isError:He,isFunction:Ve,isPrimitive:We,isBuffer:Ye,log:$e,inherits:we,_extend:Qe,default:nr}));function or(){if(rr)return er;function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}rr=1;var n=yt.Buffer,i=ir.inspect,o=i&&i.custom||"inspect";function a(t,e,r){n.prototype.copy.call(t,e,r)}return er=function(){function s(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.head=null,this.tail=null,this.length=0}var f,h,u;return f=s,h=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return n.alloc(0);for(var e=n.allocUnsafe(t>>>0),r=this.head,i=0;r;)a(r.data,e,i),i+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=n.allocUnsafe(t),r=this.head,i=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,a),0==(t-=a)){a===o.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++i}return this.length-=i,e}},{key:o,value:function(r,n){return i(this,function(r){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){e(r,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(i,t))}))}return r}({},n,{depth:0,customInspect:!1}))}}],h&&r(f.prototype,h),u&&r(f,u),s}(),er}function ar(t,e){fr(t,e),sr(t)}function sr(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function fr(t,e){t.emit("error",e)}var hr={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Wt(fr,this,t)):Wt(fr,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?Wt(sr,r):(r._writableState.errorEmitted=!0,Wt(ar,r,t)):Wt(ar,r,t):e?(Wt(sr,r),e(t)):Wt(sr,r)})),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(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}},ur={};var cr={};function dr(t,e,r){r||(r=Error);var n=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=t,cr[t]=n}function lr(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}dr("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),dr("ERR_INVALID_ARG_TYPE",(function(t,r,n){var i,o,a,s;if("string"==typeof r&&(o="not ",r.substr(!a||a<0?0:+a,o.length)===o)?(i="must not be",r=r.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(lr(r,"type"));else{var f=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(f," ").concat(i," ").concat(lr(r,"type"))}return s+=". Received type ".concat(e(n))}),TypeError),dr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),dr("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),dr("ERR_STREAM_PREMATURE_CLOSE","Premature close"),dr("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),dr("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),dr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),dr("ERR_STREAM_WRITE_AFTER_END","write after end"),dr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),dr("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),dr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ur.codes=cr;var pr=ur.codes.ERR_INVALID_OPT_VALUE;var br={getHighWaterMark:function(t,e,r,n){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new pr(n?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}},mr={exports:{}};"function"==typeof Object.create?mr.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:mr.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var gr,vr,yr,wr,_r=function(t,e){if(Mr("noDeprecation"))return t;var r=!1;return function(){if(!r){if(Mr("throwDeprecation"))throw new Error(e);Mr("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}};function Mr(t){try{if(!bt.localStorage)return!1}catch(t){return!1}var e=bt.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}function Sr(){if(vr)return gr;function t(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var e;vr=1,gr=_,_.WritableState=w;var r={deprecate:_r},n=ye,i=yt.Buffer,o=bt.Uint8Array||function(){};var a,s=hr,f=br.getHighWaterMark,h=ur.codes,u=h.ERR_INVALID_ARG_TYPE,c=h.ERR_METHOD_NOT_IMPLEMENTED,d=h.ERR_MULTIPLE_CALLBACK,l=h.ERR_STREAM_CANNOT_PIPE,p=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,m=h.ERR_STREAM_WRITE_AFTER_END,g=h.ERR_UNKNOWN_ENCODING,v=s.errorOrDestroy;function y(){}function w(r,n,i){e=e||Er(),r=r||{},"boolean"!=typeof i&&(i=n instanceof e),this.objectMode=!!r.objectMode,i&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=f(this,r,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===r.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new d;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(Wt(i,n),Wt(R,t,e),t._writableState.errorEmitted=!0,v(t,n)):(i(n),t._writableState.errorEmitted=!0,v(t,n),R(t,e))}(t,r,n,e,i);else{var o=A(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||E(t,r),n?Wt(S,t,r,o,i):S(t,r,o,i)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function _(t){var r=this instanceof(e=e||Er());if(!r&&!a.call(_,this))return new _(t);this._writableState=new w(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),n.call(this)}function M(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function S(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),R(t,e)}function E(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),a=r.corkedRequestsFree;a.entry=n;for(var s=0,f=!0;n;)o[s]=n,n.isBuf||(f=!1),n=n.next,s+=1;o.allBuffers=f,M(e,r,!0,r.length,o,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var h=n.chunk,u=n.encoding,c=n.callback;if(M(e,r,!1,r.objectMode?1:h.length,h,u,c),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final((function(r){e.pendingcb--,r&&v(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var r=A(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,Wt(x,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}return mr.exports(_,n),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===_&&(t&&t._writableState instanceof w)}})):a=function(t){return t instanceof this},_.prototype.pipe=function(){v(this,new l)},_.prototype.write=function(t,e,r){var n,a=this._writableState,s=!1,f=!a.objectMode&&(n=t,i.isBuffer(n)||n instanceof o);return f&&!i.isBuffer(t)&&(t=function(t){return i.from(t)}(t)),"function"==typeof e&&(r=e,e=null),f?e="buffer":e||(e=a.defaultEncoding),"function"!=typeof r&&(r=y),a.ending?function(t,e){var r=new m;v(t,r),Wt(e,r)}(this,r):(f||function(t,e,r,n){var i;return null===r?i=new b:"string"==typeof r||e.objectMode||(i=new u("chunk",["string","Buffer"],r)),!i||(v(t,i),Wt(n,i),!1)}(this,a,t,r))&&(a.pendingcb++,s=function(t,e,r,n,o,a){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=i.from(e,r));return e}(e,n,o);n!==s&&(r=!0,o="buffer",n=s)}var f=e.objectMode?1:n.length;e.length+=f;var h=e.length<e.highWaterMark;h||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,f,n,o,a);return h}(this,a,f,t,e,r)),s},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new g(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new c("_write()"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?Wt(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=s.destroy,_.prototype._undestroy=s.undestroy,_.prototype._destroy=function(t,e){e(t)},gr}function Er(){if(wr)return yr;wr=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};yr=a;var e=qr(),r=Sr();mr.exports(a,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];a.prototype[o]||(a.prototype[o]=r.prototype[o])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||Wt(f,this)}function f(t){t.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),yr}var Ar,xr,Rr={},kr={exports:{}};function Tr(){if(xr)return Rr;xr=1;var t=(Ar||(Ar=1,function(t,e){var r=yt,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(kr,kr.exports)),kr.exports).Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=a,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=s,this.end=f,n=3;break;default:return this.write=h,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function s(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function u(t){return t&&t.length?this.write(t):""}return Rr.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var o=n(e[i]);if(o>=0)return o>0&&(t.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if((o=n(e[i]))>=0)return o>0&&(t.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if((o=n(e[i]))>=0)return o>0&&(2===o?o=0:t.lastNeed=o-3),o;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Rr}var Lr=ur.codes.ERR_STREAM_PREMATURE_CLOSE;function Ir(){}var Or,Br,Pr,Cr,Nr,Dr,zr=function t(e,r,n){if("function"==typeof r)return t(e,null,r);r||(r={}),n=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(n||Ir);var i=r.readable||!1!==r.readable&&e.readable,o=r.writable||!1!==r.writable&&e.writable,a=function(){e.writable||f()},s=e._writableState&&e._writableState.finished,f=function(){o=!1,s=!0,i||n.call(e)},h=e._readableState&&e._readableState.endEmitted,u=function(){i=!1,h=!0,o||n.call(e)},c=function(t){n.call(e,t)},d=function(){var t;return i&&!h?(e._readableState&&e._readableState.ended||(t=new Lr),n.call(e,t)):o&&!s?(e._writableState&&e._writableState.ended||(t=new Lr),n.call(e,t)):void 0},l=function(){e.req.on("finish",f)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?o&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",f),e.on("abort",d),e.req?l():e.on("request",l)),e.on("end",u),e.on("finish",f),!1!==r.error&&e.on("error",c),e.on("close",d),function(){e.removeListener("complete",f),e.removeListener("abort",d),e.removeListener("request",l),e.req&&e.req.removeListener("finish",f),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",f),e.removeListener("end",u),e.removeListener("error",c),e.removeListener("close",d)}};function jr(){if(Br)return Or;var t;function e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Br=1;var r=zr,n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function u(t,e){return{value:t,done:e}}function c(t){var e=t[n];if(null!==e){var r=t[h].read();null!==r&&(t[s]=null,t[n]=null,t[i]=null,e(u(r,!1)))}}function d(t){Wt(c,t)}var l=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e(t={get stream(){return this[h]},next:function(){var t=this,e=this[o];if(null!==e)return Promise.reject(e);if(this[a])return Promise.resolve(u(void 0,!0));if(this[h].destroyed)return new Promise((function(e,r){Wt((function(){t[o]?r(t[o]):e(u(void 0,!0))}))}));var r,n=this[s];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[a]?r(u(void 0,!0)):e[f](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(u(i,!1));r=new Promise(this[f])}return this[s]=r,r}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(u(void 0,!0))}))}))})),t),l);return Or=function(t){var c,l=Object.create(p,(e(c={},h,{value:t,writable:!0}),e(c,n,{value:null,writable:!0}),e(c,i,{value:null,writable:!0}),e(c,o,{value:null,writable:!0}),e(c,a,{value:t._readableState.endEmitted,writable:!0}),e(c,f,{value:function(t,e){var r=l[h].read();r?(l[s]=null,l[n]=null,l[i]=null,t(u(r,!1))):(l[n]=t,l[i]=e)},writable:!0}),c));return l[s]=null,r(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=l[i];return null!==e&&(l[s]=null,l[n]=null,l[i]=null,e(t)),void(l[o]=t)}var r=l[n];null!==r&&(l[s]=null,l[n]=null,l[i]=null,r(u(void 0,!0))),l[a]=!0})),t.on("readable",d.bind(null,l)),l},Or}function qr(){if(Dr)return Nr;var t;Dr=1,Nr=_,_.ReadableState=w,ve.EventEmitter;var e=function(t,e){return t.listeners(e).length},r=ye,n=yt.Buffer,i=bt.Uint8Array||function(){};var o,a=ir;o=a&&a.debuglog?a.debuglog("stream"):function(){};var s,f,h,u=or(),c=hr,d=br.getHighWaterMark,l=ur.codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_STREAM_PUSH_AFTER_EOF,m=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;mr.exports(_,r);var v=c.errorOrDestroy,y=["error","close","destroy","pause","resume"];function w(e,r,n){t=t||Er(),e=e||{},"boolean"!=typeof n&&(n=r instanceof t),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=d(this,e,"readableHighWaterMark",n),this.buffer=new u,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&&(s||(s=Tr().StringDecoder),this.decoder=new s(e.encoding),this.encoding=e.encoding)}function _(e){if(t=t||Er(),!(this instanceof _))return new _(e);var n=this instanceof t;this._readableState=new w(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function M(t,e,r,a,s){o("readableAddChunk",e);var f,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(o("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?x(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}(t,h);else if(s||(f=function(t,e){var r;o=e,n.isBuffer(o)||o instanceof i||"string"==typeof e||void 0===e||t.objectMode||(r=new p("chunk",["string","Buffer","Uint8Array"],e));var o;return r}(h,e)),f)v(t,f);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===n.prototype||(e=function(t){return n.from(t)}(e)),a)h.endEmitted?v(t,new g):S(t,h,e,!0);else if(h.ended)v(t,new b);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?S(t,h,e,!1):k(t,h)):S(t,h,e,!1)}else a||(h.reading=!1,k(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function S(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&x(t)),k(t,e)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),_.prototype.destroy=c.destroy,_.prototype._undestroy=c.undestroy,_.prototype._destroy=function(t,e){e(t)},_.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=n.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},_.prototype.unshift=function(t){return M(this,t,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){s||(s=Tr().StringDecoder);var e=new s(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var E=1073741824;function A(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,Wt(R,t))}function R(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function k(t,e){e.readingMore||(e.readingMore=!0,Wt(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){o("readable nexttick read 0"),t.read(0)}function O(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function P(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function C(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Wt(N,e,t))}function N(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function D(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return _.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):x(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=A(r,e))),null===(n=t>0?P(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(t){v(this,new m("_read()"))},_.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,r);var a=(!r||!1!==r.end)&&t!==oe.stdout&&t!==oe.stderr?f:b;function s(e,r){o("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,o("cleanup"),t.removeListener("close",l),t.removeListener("finish",p),t.removeListener("drain",h),t.removeListener("error",d),t.removeListener("unpipe",s),n.removeListener("end",f),n.removeListener("end",b),n.removeListener("data",c),u=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function f(){o("onend"),t.end()}i.endEmitted?Wt(a):n.once("end",a),t.on("unpipe",s);var h=function(t){return function(){var r=t._readableState;o("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&e(t,"data")&&(r.flowing=!0,B(t))}}(n);t.on("drain",h);var u=!1;function c(e){o("ondata");var r=t.write(e);o("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==D(i.pipes,t))&&!u&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(r){o("onerror",r),b(),t.removeListener("error",d),0===e(t,"error")&&v(t,r)}function l(){t.removeListener("finish",p),b()}function p(){o("onfinish"),t.removeListener("close",l),b()}function b(){o("unpipe"),n.unpipe(t)}return n.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",l),t.once("finish",p),t.emit("pipe",n),i.flowing||(o("pipe resume"),n.resume()),t},_.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=D(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},_.prototype.on=function(t,e){var n=r.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?x(this):i.reading||Wt(I,this))),n},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(t,e){var n=r.prototype.removeListener.call(this,t,e);return"readable"===t&&Wt(L,this),n},_.prototype.removeAllListeners=function(t){var e=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||Wt(L,this),e},_.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Wt(O,t,e))}(this,t)),t.paused=!1,this},_.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a<y.length;a++)t.on(y[a],this.emit.bind(this,y[a]));return this._read=function(e){o("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=jr()),f(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),_._fromList=P,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(t,e){return void 0===h&&(h=Cr?Pr:(Cr=1,Pr=function(){throw new Error("Readable.from is not available in the browser")})),h(_,t,e)}),Nr}var Ur=Jr,Kr=ur.codes,Fr=Kr.ERR_METHOD_NOT_IMPLEMENTED,Hr=Kr.ERR_MULTIPLE_CALLBACK,Vr=Kr.ERR_TRANSFORM_ALREADY_TRANSFORMING,Wr=Kr.ERR_TRANSFORM_WITH_LENGTH_0,Yr=Er();function Zr(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new Hr);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Jr(t){if(!(this instanceof Jr))return new Jr(t);Yr.call(this,t),this._transformState={afterTransform:Zr.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",Xr)}function Xr(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?Gr(this,null,null):this._flush((function(e,r){Gr(t,e,r)}))}function Gr(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Wr;if(t._transformState.transforming)throw new Vr;return t.push(null)}mr.exports(Jr,Yr),Jr.prototype.push=function(t,e){return this._transformState.needTransform=!1,Yr.prototype.push.call(this,t,e)},Jr.prototype._transform=function(t,e,r){r(new Fr("_transform()"))},Jr.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Jr.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},Jr.prototype._destroy=function(t,e){Yr.prototype._destroy.call(this,t,(function(t){e(t)}))};var $r,Qr=en,tn=Ur;function en(t){if(!(this instanceof en))return new en(t);tn.call(this,t)}mr.exports(en,tn),en.prototype._transform=function(t,e,r){r(null,t)};var rn=ur.codes,nn=rn.ERR_MISSING_ARGS,on=rn.ERR_STREAM_DESTROYED;function an(t){if(t)throw t}function sn(t,e,r,n){n=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(n);var i=!1;t.on("close",(function(){i=!0})),void 0===$r&&($r=zr),$r(t,{readable:e,writable:r},(function(t){if(t)return n(t);i=!0,n()}));var o=!1;return function(e){if(!i&&!o)return o=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void n(e||new on("pipe"))}}function fn(t){t()}function hn(t,e){return t.pipe(e)}function un(t){return t.length?"function"!=typeof t[t.length-1]?an:t.pop():an}var cn=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=un(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new nn("streams");var o=e.map((function(t,r){var a=r<e.length-1;return sn(t,a,r>0,(function(t){n||(n=t),t&&o.forEach(fn),a||(o.forEach(fn),i(n))}))}));return e.reduce(hn)};!function(t,e){(e=t.exports=qr()).Stream=e,e.Readable=e,e.Writable=Sr(),e.Duplex=Er(),e.Transform=Ur,e.PassThrough=Qr,e.finished=zr,e.pipeline=cn}(Pt,Pt.exports);var dn=Pt.exports.Transform,ln=Pt.exports.Transform,pn=function(t){return function(e){a(o,e);var n=u(o);function o(e,i,a,s,f){var h;return r(this,o),(h=n.call(this,f))._rate=e,h._capacity=i,h._delimitedSuffix=a,h._hashBitLength=s,h._options=f,h._state=new t,h._state.initialize(e,i),h._finalized=!1,h}return i(o,[{key:"_transform",value:function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)}},{key:"_flush",value:function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}},{key:"update",value:function(t,e){if(!lt(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return lt(t)||(t=L.from(t,e)),this._state.absorb(t),this}},{key:"digest",value:function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new o(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),o}(dn)},bn=function(t){return function(e){a(o,e);var n=u(o);function o(e,i,a,s){var f;return r(this,o),(f=n.call(this,s))._rate=e,f._capacity=i,f._delimitedSuffix=a,f._options=s,f._state=new t,f._state.initialize(e,i),f._finalized=!1,f}return i(o,[{key:"_transform",value:function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)}},{key:"_flush",value:function(){}},{key:"_read",value:function(t){this.push(this.squeeze(t))}},{key:"update",value:function(t,e){if(!lt(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return lt(t)||(t=L.from(t,e)),this._state.absorb(t),this}},{key:"squeeze",value:function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}},{key:"_resetState",value:function(){return this._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){var t=new o(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}]),o}(ln)},mn={},gn=[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];mn.p1600=function(t){for(var e=0;e<24;++e){var r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],s=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],c=t[9]^t[19]^t[29]^t[39]^t[49],d=u^(i<<1|o>>>31),l=c^(o<<1|i>>>31),p=t[0]^d,b=t[1]^l,m=t[10]^d,g=t[11]^l,v=t[20]^d,y=t[21]^l,w=t[30]^d,_=t[31]^l,M=t[40]^d,S=t[41]^l;d=r^(a<<1|s>>>31),l=n^(s<<1|a>>>31);var E=t[2]^d,A=t[3]^l,x=t[12]^d,R=t[13]^l,k=t[22]^d,T=t[23]^l,L=t[32]^d,I=t[33]^l,O=t[42]^d,B=t[43]^l;d=i^(f<<1|h>>>31),l=o^(h<<1|f>>>31);var P=t[4]^d,C=t[5]^l,N=t[14]^d,D=t[15]^l,z=t[24]^d,j=t[25]^l,q=t[34]^d,U=t[35]^l,K=t[44]^d,F=t[45]^l;d=a^(u<<1|c>>>31),l=s^(c<<1|u>>>31);var H=t[6]^d,V=t[7]^l,W=t[16]^d,Y=t[17]^l,Z=t[26]^d,J=t[27]^l,X=t[36]^d,G=t[37]^l,$=t[46]^d,Q=t[47]^l;d=f^(r<<1|n>>>31),l=h^(n<<1|r>>>31);var tt=t[8]^d,et=t[9]^l,rt=t[18]^d,nt=t[19]^l,it=t[28]^d,ot=t[29]^l,at=t[38]^d,st=t[39]^l,ft=t[48]^d,ht=t[49]^l,ut=p,ct=b,dt=g<<4|m>>>28,lt=m<<4|g>>>28,pt=v<<3|y>>>29,bt=y<<3|v>>>29,mt=_<<9|w>>>23,gt=w<<9|_>>>23,vt=M<<18|S>>>14,yt=S<<18|M>>>14,wt=E<<1|A>>>31,_t=A<<1|E>>>31,Mt=R<<12|x>>>20,St=x<<12|R>>>20,Et=k<<10|T>>>22,At=T<<10|k>>>22,xt=I<<13|L>>>19,Rt=L<<13|I>>>19,kt=O<<2|B>>>30,Tt=B<<2|O>>>30,Lt=C<<30|P>>>2,It=P<<30|C>>>2,Ot=N<<6|D>>>26,Bt=D<<6|N>>>26,Pt=j<<11|z>>>21,Ct=z<<11|j>>>21,Nt=q<<15|U>>>17,Dt=U<<15|q>>>17,zt=F<<29|K>>>3,jt=K<<29|F>>>3,qt=H<<28|V>>>4,Ut=V<<28|H>>>4,Kt=Y<<23|W>>>9,Ft=W<<23|Y>>>9,Ht=Z<<25|J>>>7,Vt=J<<25|Z>>>7,Wt=X<<21|G>>>11,Yt=G<<21|X>>>11,Zt=Q<<24|$>>>8,Jt=$<<24|Q>>>8,Xt=tt<<27|et>>>5,Gt=et<<27|tt>>>5,$t=rt<<20|nt>>>12,Qt=nt<<20|rt>>>12,te=ot<<7|it>>>25,ee=it<<7|ot>>>25,re=at<<8|st>>>24,ne=st<<8|at>>>24,ie=ft<<14|ht>>>18,oe=ht<<14|ft>>>18;t[0]=ut^~Mt&Pt,t[1]=ct^~St&Ct,t[10]=qt^~$t&pt,t[11]=Ut^~Qt&bt,t[20]=wt^~Ot&Ht,t[21]=_t^~Bt&Vt,t[30]=Xt^~dt&Et,t[31]=Gt^~lt&At,t[40]=Lt^~Kt&te,t[41]=It^~Ft&ee,t[2]=Mt^~Pt&Wt,t[3]=St^~Ct&Yt,t[12]=$t^~pt&xt,t[13]=Qt^~bt&Rt,t[22]=Ot^~Ht&re,t[23]=Bt^~Vt&ne,t[32]=dt^~Et&Nt,t[33]=lt^~At&Dt,t[42]=Kt^~te&mt,t[43]=Ft^~ee>,t[4]=Pt^~Wt&ie,t[5]=Ct^~Yt&oe,t[14]=pt^~xt&zt,t[15]=bt^~Rt&jt,t[24]=Ht^~re&vt,t[25]=Vt^~ne&yt,t[34]=Et^~Nt&Zt,t[35]=At^~Dt&Jt,t[44]=te^~mt&kt,t[45]=ee^~gt&Tt,t[6]=Wt^~ie&ut,t[7]=Yt^~oe&ct,t[16]=xt^~zt&qt,t[17]=Rt^~jt&Ut,t[26]=re^~vt&wt,t[27]=ne^~yt&_t,t[36]=Nt^~Zt&Xt,t[37]=Dt^~Jt&Gt,t[46]=mt^~kt&Lt,t[47]=gt^~Tt&It,t[8]=ie^~ut&Mt,t[9]=oe^~ct&St,t[18]=zt^~qt&$t,t[19]=jt^~Ut&Qt,t[28]=vt^~wt&Ot,t[29]=yt^~_t&Bt,t[38]=Zt^~Xt&dt,t[39]=Jt^~Gt<,t[48]=kt^~Lt&Kt,t[49]=Tt^~It&Ft,t[0]^=gn[2*e],t[1]^=gn[2*e+1]}};var vn=mn;function yn(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}yn.prototype.initialize=function(t,e){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},yn.prototype.absorb=function(t){for(var e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(vn.p1600(this.state),this.count=0)},yn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&vn.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,vn.p1600(this.state),this.count=0,this.squeezing=!0},yn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);for(var e=L.alloc(t),r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(vn.p1600(this.state),this.count=0);return e},yn.prototype.copy=function(t){for(var e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var wn=function(t){var e=pn(t),r=bn(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(yn);Object.defineProperty(Ot,"__esModule",{value:!0});var _n=Bt,Mn=wn;Ot.keccak224=_n.createHashFunction((function(){return Mn("keccak224")})),Ot.keccak256=_n.createHashFunction((function(){return Mn("keccak256")})),Ot.keccak384=_n.createHashFunction((function(){return Mn("keccak384")})),Ot.keccak512=_n.createHashFunction((function(){return Mn("keccak512")}));var Sn={exports:{}};
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */!function(t,e){var r=yt,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(Sn,Sn.exports);var En=Sn.exports.Buffer,An=Pt.exports.Transform;function xn(t){An.call(this),this._block=En.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}(0,mr.exports)(xn,An),xn.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},xn.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},xn.prototype.update=function(t,e){if(function(t,e){if(!En.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");En.isBuffer(t)||(t=En.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=t[n++];this._update(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},xn.prototype._update=function(){throw new Error("_update is not implemented")},xn.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},xn.prototype._digest=function(){throw new Error("_digest is not implemented")};var Rn=xn,kn={exports:{}};!function(t,e){var r=yt,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(kn,kn.exports);var Tn=mr.exports,Ln=Rn,In=kn.exports.Buffer,On=new Array(16);function Bn(){Ln.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Pn(t,e){return t<<e|t>>>32-e}function Cn(t,e,r,n,i,o,a){return Pn(t+(e&r|~e&n)+i+o|0,a)+e|0}function Nn(t,e,r,n,i,o,a){return Pn(t+(e&n|r&~n)+i+o|0,a)+e|0}function Dn(t,e,r,n,i,o,a){return Pn(t+(e^r^n)+i+o|0,a)+e|0}function zn(t,e,r,n,i,o,a){return Pn(t+(r^(e|~n))+i+o|0,a)+e|0}Tn(Bn,Ln),Bn.prototype._update=function(){for(var t=On,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=Cn(r,n,i,o,t[0],3614090360,7),o=Cn(o,r,n,i,t[1],3905402710,12),i=Cn(i,o,r,n,t[2],606105819,17),n=Cn(n,i,o,r,t[3],3250441966,22),r=Cn(r,n,i,o,t[4],4118548399,7),o=Cn(o,r,n,i,t[5],1200080426,12),i=Cn(i,o,r,n,t[6],2821735955,17),n=Cn(n,i,o,r,t[7],4249261313,22),r=Cn(r,n,i,o,t[8],1770035416,7),o=Cn(o,r,n,i,t[9],2336552879,12),i=Cn(i,o,r,n,t[10],4294925233,17),n=Cn(n,i,o,r,t[11],2304563134,22),r=Cn(r,n,i,o,t[12],1804603682,7),o=Cn(o,r,n,i,t[13],4254626195,12),i=Cn(i,o,r,n,t[14],2792965006,17),r=Nn(r,n=Cn(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=Nn(o,r,n,i,t[6],3225465664,9),i=Nn(i,o,r,n,t[11],643717713,14),n=Nn(n,i,o,r,t[0],3921069994,20),r=Nn(r,n,i,o,t[5],3593408605,5),o=Nn(o,r,n,i,t[10],38016083,9),i=Nn(i,o,r,n,t[15],3634488961,14),n=Nn(n,i,o,r,t[4],3889429448,20),r=Nn(r,n,i,o,t[9],568446438,5),o=Nn(o,r,n,i,t[14],3275163606,9),i=Nn(i,o,r,n,t[3],4107603335,14),n=Nn(n,i,o,r,t[8],1163531501,20),r=Nn(r,n,i,o,t[13],2850285829,5),o=Nn(o,r,n,i,t[2],4243563512,9),i=Nn(i,o,r,n,t[7],1735328473,14),r=Dn(r,n=Nn(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=Dn(o,r,n,i,t[8],2272392833,11),i=Dn(i,o,r,n,t[11],1839030562,16),n=Dn(n,i,o,r,t[14],4259657740,23),r=Dn(r,n,i,o,t[1],2763975236,4),o=Dn(o,r,n,i,t[4],1272893353,11),i=Dn(i,o,r,n,t[7],4139469664,16),n=Dn(n,i,o,r,t[10],3200236656,23),r=Dn(r,n,i,o,t[13],681279174,4),o=Dn(o,r,n,i,t[0],3936430074,11),i=Dn(i,o,r,n,t[3],3572445317,16),n=Dn(n,i,o,r,t[6],76029189,23),r=Dn(r,n,i,o,t[9],3654602809,4),o=Dn(o,r,n,i,t[12],3873151461,11),i=Dn(i,o,r,n,t[15],530742520,16),r=zn(r,n=Dn(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=zn(o,r,n,i,t[7],1126891415,10),i=zn(i,o,r,n,t[14],2878612391,15),n=zn(n,i,o,r,t[5],4237533241,21),r=zn(r,n,i,o,t[12],1700485571,6),o=zn(o,r,n,i,t[3],2399980690,10),i=zn(i,o,r,n,t[10],4293915773,15),n=zn(n,i,o,r,t[1],2240044497,21),r=zn(r,n,i,o,t[8],1873313359,6),o=zn(o,r,n,i,t[15],4264355552,10),i=zn(i,o,r,n,t[6],2734768916,15),n=zn(n,i,o,r,t[13],1309151649,21),r=zn(r,n,i,o,t[4],4149444226,6),o=zn(o,r,n,i,t[11],3174756917,10),i=zn(i,o,r,n,t[2],718787259,15),n=zn(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},Bn.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 t=In.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};var jn=Bn,qn=yt.Buffer,Un=mr.exports,Kn=Rn,Fn=new Array(16),Hn=[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],Vn=[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],Wn=[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],Yn=[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],Zn=[0,1518500249,1859775393,2400959708,2840853838],Jn=[1352829926,1548603684,1836072691,2053994217,0];function Xn(){Kn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Gn(t,e){return t<<e|t>>>32-e}function $n(t,e,r,n,i,o,a,s){return Gn(t+(e^r^n)+o+a|0,s)+i|0}function Qn(t,e,r,n,i,o,a,s){return Gn(t+(e&r|~e&n)+o+a|0,s)+i|0}function ti(t,e,r,n,i,o,a,s){return Gn(t+((e|~r)^n)+o+a|0,s)+i|0}function ei(t,e,r,n,i,o,a,s){return Gn(t+(e&n|r&~n)+o+a|0,s)+i|0}function ri(t,e,r,n,i,o,a,s){return Gn(t+(e^(r|~n))+o+a|0,s)+i|0}Un(Xn,Kn),Xn.prototype._update=function(){for(var t=Fn,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,f=0|this._b,h=0|this._c,u=0|this._d,c=0|this._e,d=0;d<80;d+=1){var l,p;d<16?(l=$n(r,n,i,o,a,t[Hn[d]],Zn[0],Wn[d]),p=ri(s,f,h,u,c,t[Vn[d]],Jn[0],Yn[d])):d<32?(l=Qn(r,n,i,o,a,t[Hn[d]],Zn[1],Wn[d]),p=ei(s,f,h,u,c,t[Vn[d]],Jn[1],Yn[d])):d<48?(l=ti(r,n,i,o,a,t[Hn[d]],Zn[2],Wn[d]),p=ti(s,f,h,u,c,t[Vn[d]],Jn[2],Yn[d])):d<64?(l=ei(r,n,i,o,a,t[Hn[d]],Zn[3],Wn[d]),p=Qn(s,f,h,u,c,t[Vn[d]],Jn[3],Yn[d])):(l=ri(r,n,i,o,a,t[Hn[d]],Zn[4],Wn[d]),p=$n(s,f,h,u,c,t[Vn[d]],Jn[4],Yn[d])),r=a,a=o,o=Gn(i,10),i=n,n=l,s=c,c=u,u=Gn(h,10),h=f,f=p}var b=this._b+i+u|0;this._b=this._c+o+c|0,this._c=this._d+a+s|0,this._d=this._e+r+f|0,this._e=this._a+n+h|0,this._a=b},Xn.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 t=qn.alloc?qn.alloc(20):new qn(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};var ni=Xn,ii={exports:{}},oi=kn.exports.Buffer;function ai(t,e){this._block=oi.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}ai.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=oi.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,a=0;a<i;){for(var s=o%n,f=Math.min(i-a,n-s),h=0;h<f;h++)r[s+h]=t[a+h];a+=f,(o+=f)%n==0&&this._update(r)}return this._len+=i,this},ai.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},ai.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var si=ai,fi=mr.exports,hi=si,ui=kn.exports.Buffer,ci=[1518500249,1859775393,-1894007588,-899497514],di=new Array(80);function li(){this.init(),this._w=di,hi.call(this,64,56)}function pi(t){return t<<30|t>>>2}function bi(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}fi(li,hi),li.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},li.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var u=~~(h/20),c=0|((e=n)<<5|e>>>27)+bi(u,i,o,a)+s+r[h]+ci[u];s=a,a=o,o=pi(i),i=n,n=c}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},li.prototype._hash=function(){var t=ui.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var mi=li,gi=mr.exports,vi=si,yi=kn.exports.Buffer,wi=[1518500249,1859775393,-1894007588,-899497514],_i=new Array(80);function Mi(){this.init(),this._w=_i,vi.call(this,64,56)}function Si(t){return t<<5|t>>>27}function Ei(t){return t<<30|t>>>2}function Ai(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}gi(Mi,vi),Mi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Mi.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=(e=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|e>>>31;for(var h=0;h<80;++h){var u=~~(h/20),c=Si(n)+Ai(u,i,o,a)+s+r[h]+wi[u]|0;s=a,a=o,o=Ei(i),i=n,n=c}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Mi.prototype._hash=function(){var t=yi.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var xi=Mi,Ri=mr.exports,ki=si,Ti=kn.exports.Buffer,Li=[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],Ii=new Array(64);function Oi(){this.init(),this._w=Ii,ki.call(this,64,56)}function Bi(t,e,r){return r^t&(e^r)}function Pi(t,e,r){return t&e|r&(t|e)}function Ci(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ni(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Di(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}Ri(Oi,ki),Oi.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},Oi.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,f=0|this._f,h=0|this._g,u=0|this._h,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<64;++c)r[c]=0|(((e=r[c-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[c-7]+Di(r[c-15])+r[c-16];for(var d=0;d<64;++d){var l=u+Ni(s)+Bi(s,f,h)+Li[d]+r[d]|0,p=Ci(n)+Pi(n,i,o)|0;u=h,h=f,f=s,s=a+l|0,a=o,o=i,i=n,n=l+p|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=f+this._f|0,this._g=h+this._g|0,this._h=u+this._h|0},Oi.prototype._hash=function(){var t=Ti.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var zi=Oi,ji=mr.exports,qi=zi,Ui=si,Ki=kn.exports.Buffer,Fi=new Array(64);function Hi(){this.init(),this._w=Fi,Ui.call(this,64,56)}ji(Hi,qi),Hi.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},Hi.prototype._hash=function(){var t=Ki.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Vi=Hi,Wi=mr.exports,Yi=si,Zi=kn.exports.Buffer,Ji=[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],Xi=new Array(160);function Gi(){this.init(),this._w=Xi,Yi.call(this,128,112)}function $i(t,e,r){return r^t&(e^r)}function Qi(t,e,r){return t&e|r&(t|e)}function to(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function eo(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function ro(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function no(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function io(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function oo(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function ao(t,e){return t>>>0<e>>>0?1:0}Wi(Gi,Yi),Gi.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},Gi.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,f=0|this._gh,h=0|this._hh,u=0|this._al,c=0|this._bl,d=0|this._cl,l=0|this._dl,p=0|this._el,b=0|this._fl,m=0|this._gl,g=0|this._hl,v=0;v<32;v+=2)e[v]=t.readInt32BE(4*v),e[v+1]=t.readInt32BE(4*v+4);for(;v<160;v+=2){var y=e[v-30],w=e[v-30+1],_=ro(y,w),M=no(w,y),S=io(y=e[v-4],w=e[v-4+1]),E=oo(w,y),A=e[v-14],x=e[v-14+1],R=e[v-32],k=e[v-32+1],T=M+x|0,L=_+A+ao(T,M)|0;L=(L=L+S+ao(T=T+E|0,E)|0)+R+ao(T=T+k|0,k)|0,e[v]=L,e[v+1]=T}for(var I=0;I<160;I+=2){L=e[I],T=e[I+1];var O=Qi(r,n,i),B=Qi(u,c,d),P=to(r,u),C=to(u,r),N=eo(a,p),D=eo(p,a),z=Ji[I],j=Ji[I+1],q=$i(a,s,f),U=$i(p,b,m),K=g+D|0,F=h+N+ao(K,g)|0;F=(F=(F=F+q+ao(K=K+U|0,U)|0)+z+ao(K=K+j|0,j)|0)+L+ao(K=K+T|0,T)|0;var H=C+B|0,V=P+O+ao(H,C)|0;h=f,g=m,f=s,m=b,s=a,b=p,a=o+F+ao(p=l+K|0,l)|0,o=i,l=d,i=n,d=c,n=r,c=u,r=F+V+ao(u=K+H|0,K)|0}this._al=this._al+u|0,this._bl=this._bl+c|0,this._cl=this._cl+d|0,this._dl=this._dl+l|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+m|0,this._hl=this._hl+g|0,this._ah=this._ah+r+ao(this._al,u)|0,this._bh=this._bh+n+ao(this._bl,c)|0,this._ch=this._ch+i+ao(this._cl,d)|0,this._dh=this._dh+o+ao(this._dl,l)|0,this._eh=this._eh+a+ao(this._el,p)|0,this._fh=this._fh+s+ao(this._fl,b)|0,this._gh=this._gh+f+ao(this._gl,m)|0,this._hh=this._hh+h+ao(this._hl,g)|0},Gi.prototype._hash=function(){var t=Zi.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var so=Gi,fo=mr.exports,ho=so,uo=si,co=kn.exports.Buffer,lo=new Array(160);function po(){this.init(),this._w=lo,uo.call(this,128,112)}fo(po,ho),po.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},po.prototype._hash=function(){var t=co.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var bo=po,mo=ii.exports=function(t){t=t.toLowerCase();var e=mo[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};function go(){this.head=null,this.tail=null,this.length=0}mo.sha=mi,mo.sha1=xi,mo.sha224=Vi,mo.sha256=zi,mo.sha384=bo,mo.sha512=so,go.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},go.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},go.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},go.prototype.clear=function(){this.head=this.tail=null,this.length=0},go.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},go.prototype.concat=function(t){if(0===this.length)return L.alloc(0);if(1===this.length)return this.head.data;for(var e=L.allocUnsafe(t>>>0),r=this.head,n=0;r;)r.data.copy(e,n),n+=r.data.length,r=r.next;return e};var vo=L.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function yo(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!vo(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=_o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Mo;break;default:return void(this.write=wo)}this.charBuffer=new L(6),this.charReceived=0,this.charLength=0}function wo(t){return t.toString(this.encoding)}function _o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function Mo(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}yo.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(t=t.slice(r,t.length),!((i=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},yo.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},yo.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e};var So=Object.freeze({__proto__:null,StringDecoder:yo});xo.ReadableState=Ao;var Eo=xe("stream");function Ao(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof ta&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new go,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.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new yo(t.encoding),this.encoding=t.encoding)}function xo(t){if(!(this instanceof xo))return new xo(t);this._readableState=new Ao(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),se.call(this)}function Ro(t,e,r,n,i){var o=function(t,e){var r=null;lt(e)||"string"==typeof e||null==e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(e,r);if(o)t.emit("error",o);else if(null===r)e.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,Lo(t)}(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else{var f;!e.decoder||i||n||(r=e.decoder.write(r),f=!e.objectMode&&0===r.length),i||(e.reading=!1),f||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Lo(t))),function(t,e){e.readingMore||(e.readingMore=!0,Wt(Oo,t,e))}(t,e)}else i||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(e)}we(xo,se),xo.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding)!==r.encoding&&(t=L.from(t,e),e=""),Ro(this,r,t,e,!1)},xo.prototype.unshift=function(t){return Ro(this,this._readableState,t,"",!0)},xo.prototype.isPaused=function(){return!1===this._readableState.flowing},xo.prototype.setEncoding=function(t){return this._readableState.decoder=new yo(t),this._readableState.encoding=t,this};var ko=8388608;function To(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=ko?t=ko:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function Lo(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Eo("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Wt(Io,t):Io(t))}function Io(t){Eo("emit readable"),t.emit("readable"),Co(t)}function Oo(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Eo("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function Bo(t){Eo("readable nexttick read 0"),t.read(0)}function Po(t,e){e.reading||(Eo("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Co(t),e.flowing&&!e.reading&&t.read(0)}function Co(t){var e=t._readableState;for(Eo("flow",e.flowing);e.flowing&&null!==t.read(););}function No(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=L.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function Do(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Wt(zo,e,t))}function zo(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function jo(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function qo(){}function Uo(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function Ko(t,e){Object.defineProperty(this,"buffer",{get:Se((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof ta&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?Wt(i,n):i(n);t._writableState.errorEmitted=!0,t.emit("error",n)}(t,r,n,e,i);else{var o=Yo(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||Wo(t,r),n?Wt(Vo,t,r,o,i):Vo(t,r,o,i)}}(e,t)},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 Xo(this)}function Fo(t){if(!(this instanceof Fo||this instanceof ta))return new Fo(t);this._writableState=new Ko(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),se.call(this)}function Ho(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Vo(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),Jo(t,e)}function Wo(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;Ho(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Xo(e)}else{for(;r;){var s=r.chunk,f=r.encoding,h=r.callback;if(Ho(t,e,!1,e.objectMode?1:s.length,s,f,h),r=r.next,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function Yo(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function Zo(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function Jo(t,e){var r=Yo(e);return r&&(0===e.pendingcb?(Zo(t,e),e.finished=!0,t.emit("finish")):Zo(t,e)),r}function Xo(t){var e=this;this.next=null,this.entry=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}xo.prototype.read=function(t){Eo("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Eo("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Do(this):Lo(this),null;if(0===(t=To(t,e))&&e.ended)return 0===e.length&&Do(this),null;var n,i=e.needReadable;return Eo("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&Eo("length less than watermark",i=!0),e.ended||e.reading?Eo("reading or ended",i=!1):i&&(Eo("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=To(r,e))),null===(n=t>0?No(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Do(this)),null!==n&&this.emit("data",n),n},xo.prototype._read=function(t){this.emit("error",new Error("not implemented"))},xo.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,Eo("pipe count=%d opts=%j",n.pipesCount,e);var i=!e||!1!==e.end?a:h;function o(t){Eo("onunpipe"),t===r&&h()}function a(){Eo("onend"),t.end()}n.endEmitted?Wt(i):r.once("end",i),t.on("unpipe",o);var s=function(t){return function(){var e=t._readableState;Eo("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,Co(t))}}(r);t.on("drain",s);var f=!1;function h(){Eo("cleanup"),t.removeListener("close",l),t.removeListener("finish",p),t.removeListener("drain",s),t.removeListener("error",d),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",h),r.removeListener("data",c),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||s()}var u=!1;function c(e){Eo("ondata"),u=!1,!1!==t.write(e)||u||((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==jo(n.pipes,t))&&!f&&(Eo("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,u=!0),r.pause())}function d(e){var r;Eo("onerror",e),b(),t.removeListener("error",d),0===(r="error",t.listeners(r).length)&&t.emit("error",e)}function l(){t.removeListener("finish",p),b()}function p(){Eo("onfinish"),t.removeListener("close",l),b()}function b(){Eo("unpipe"),r.unpipe(t)}return r.on("data",c),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",l),t.once("finish",p),t.emit("pipe",r),n.flowing||(Eo("pipe resume"),r.resume()),t},xo.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=jo(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},xo.prototype.on=function(t,e){var r=se.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&Lo(this):Wt(Bo,this))}return r},xo.prototype.addListener=xo.prototype.on,xo.prototype.resume=function(){var t=this._readableState;return t.flowing||(Eo("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Wt(Po,t,e))}(this,t)),this},xo.prototype.pause=function(){return Eo("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Eo("pause"),this._readableState.flowing=!1,this.emit("pause")),this},xo.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;for(var i in t.on("end",(function(){if(Eo("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)})),t.on("data",(function(i){(Eo("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i)||(e.objectMode||i&&i.length)&&(n.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r],r)}(["error","close","destroy","pause","resume"],(function(e){t.on(e,n.emit.bind(n,e))})),n._read=function(e){Eo("wrapped _read",e),r&&(r=!1,t.resume())},n},xo._fromList=No,Fo.WritableState=Ko,we(Fo,se),Ko.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},Fo.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Fo.prototype.write=function(t,e,r){var n=this._writableState,i=!1;return"function"==typeof e&&(r=e,e=null),L.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=qo),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),Wt(e,r)}(this,r):function(t,e,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):L.isBuffer(r)||"string"==typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),Wt(n,o),i=!1),i}(this,n,t,r)&&(n.pendingcb++,i=function(t,e,r,n,i){r=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=L.from(e,r));return e}(e,r,n),L.isBuffer(r)&&(n="buffer");var o=e.objectMode?1:r.length;e.length+=o;var a=e.length<e.highWaterMark;a||(e.needDrain=!0);if(e.writing||e.corked){var s=e.lastBufferedRequest;e.lastBufferedRequest=new Uo(r,n,i),s?s.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Ho(t,e,!1,o,r,n,i);return a}(this,n,t,e,r)),i},Fo.prototype.cork=function(){this._writableState.corked++},Fo.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Wo(this,t))},Fo.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Fo.prototype._write=function(t,e,r){r(new Error("not implemented"))},Fo.prototype._writev=null,Fo.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,Jo(t,e),r&&(e.finished?Wt(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},we(ta,xo);for(var Go=Object.keys(Fo.prototype),$o=0;$o<Go.length;$o++){var Qo=Go[$o];ta.prototype[Qo]||(ta.prototype[Qo]=Fo.prototype[Qo])}function ta(t){if(!(this instanceof ta))return new ta(t);xo.call(this,t),Fo.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",ea)}function ea(){this.allowHalfOpen||this._writableState.ended||Wt(ra,this)}function ra(t){t.end()}function na(t){this.afterTransform=function(e,r){return function(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=r&&t.push(r);i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function ia(t){if(!(this instanceof ia))return new ia(t);ta.call(this,t),this._transformState=new na(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){oa(e,t)})):oa(e)}))}function oa(t,e){if(e)return t.emit("error",e);var r=t._writableState,n=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function aa(t){if(!(this instanceof aa))return new aa(t);ia.call(this,t)}function sa(){se.call(this)}we(ia,ta),ia.prototype.push=function(t,e){return this._transformState.needTransform=!1,ta.prototype.push.call(this,t,e)},ia.prototype._transform=function(t,e,r){throw new Error("Not implemented")},ia.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},ia.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},we(aa,ia),aa.prototype._transform=function(t,e,r){r(null,t)},we(sa,se),sa.Readable=xo,sa.Writable=Fo,sa.Duplex=ta,sa.Transform=ia,sa.PassThrough=aa,sa.Stream=sa,sa.prototype.pipe=function(t,e){var r=this;function n(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),t.on("drain",i),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(h(),0===se.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",f),t.on("error",f),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t};var fa=mt(Object.freeze({__proto__:null,default:sa,Readable:xo,Writable:Fo,Duplex:ta,Transform:ia,PassThrough:aa,Stream:sa})),ha=mt(So),ua=kn.exports.Buffer,ca=fa.Transform,da=ha.StringDecoder;function la(t){ca.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}(0,mr.exports)(la,ca),la.prototype.update=function(t,e,r){"string"==typeof t&&(t=ua.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},la.prototype.setAutoPadding=function(){},la.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},la.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},la.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},la.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},la.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},la.prototype._finalOrDigest=function(t){var e=this.__final()||ua.alloc(0);return t&&(e=this._toString(e,t,!0)),e},la.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new da(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n};var pa=la,ba=mr.exports,ma=jn,ga=ni,va=ii.exports,ya=pa;function wa(t){ya.call(this,"digest"),this._hash=t}ba(wa,ya),wa.prototype._update=function(t){this._hash.update(t)},wa.prototype._final=function(){return this._hash.digest()};var _a=function(t){return"md5"===(t=t.toLowerCase())?new ma:"rmd160"===t||"ripemd160"===t?new ga:new wa(va(t))},Ma={},Sa=bt&&bt.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),Ea=bt&&bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Aa=bt&&bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Sa(e,t,r);return Ea(e,t),e},xa=bt&&bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.rlp=Ma.BN=void 0;var Ra=xa(vt.exports);Ma.BN=Ra.default;var ka=Aa(gt);Ma.rlp=ka;var Ta={},La={};function Ia(t){if("string"!=typeof t)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(e(t)));return"0"===t[0]&&"x"===t[1]}Object.defineProperty(La,"__esModule",{value:!0}),La.isHexString=La.getKeys=La.fromAscii=La.fromUtf8=La.toAscii=La.arrayContainsArray=La.getBinarySize=La.padToEven=La.stripHexPrefix=La.isHexPrefixed=void 0,La.isHexPrefixed=Ia;function Oa(t){var r=t;if("string"!=typeof r)throw new Error("[padToEven] value must be type 'string', received ".concat(e(r)));return r.length%2&&(r="0".concat(r)),r}La.stripHexPrefix=function(t){if("string"!=typeof t)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(e(t)));return Ia(t)?t.slice(2):t},La.padToEven=Oa,La.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(e(t)));return L.byteLength(t,"utf8")},La.arrayContainsArray=function(t,r,n){if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(e(t),"'"));if(!0!==Array.isArray(r))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(e(r),"'"));return r[n?"some":"every"]((function(e){return t.indexOf(e)>=0}))},La.toAscii=function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e},La.fromUtf8=function(t){var e=L.from(t,"utf8");return"0x".concat(Oa(e.toString("hex")).replace(/^0+|0+$/g,""))},La.fromAscii=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);e+=n.length<2?"0".concat(n):n}return"0x".concat(e)},La.getKeys=function(t,r,n){if(!Array.isArray(t))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(e(t)));if("string"!=typeof r)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(e(t)));for(var i=[],o=0;o<t.length;o++){var a=t[o][r];if(n&&!a)a="";else if("string"!=typeof a)throw new Error("invalid abi - expected type 'string', received ".concat(e(a)));i.push(a)}return i},La.isHexString=function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)};var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.assertIsString=Ba.assertIsArray=Ba.assertIsBuffer=Ba.assertIsHexString=void 0;var Pa=La;Ba.assertIsHexString=function(t){if(!(0,Pa.isHexString)(t)){var e="This method only supports 0x-prefixed hex strings but input was: ".concat(t);throw new Error(e)}};Ba.assertIsBuffer=function(t){if(!lt(t)){var e="This method only supports Buffer but input was: ".concat(t);throw new Error(e)}};Ba.assertIsArray=function(t){if(!Array.isArray(t)){var e="This method only supports number arrays but input was: ".concat(t);throw new Error(e)}};Ba.assertIsString=function(t){if("string"!=typeof t){var e="This method only supports strings but input was: ".concat(t);throw new Error(e)}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var e=Ma,r=La,n=Ba;t.intToHex=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Received an invalid integer type: ".concat(t));return"0x".concat(t.toString(16))};t.intToBuffer=function(e){var n=(0,t.intToHex)(e);return L.from((0,r.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return L.allocUnsafe(t).fill(0)};var i=function(e,r,n){var i=(0,t.zeros)(r);return n?e.length<r?(e.copy(i),i):e.slice(0,r):e.length<r?(e.copy(i,r-e.length),i):e.slice(-r)};t.setLengthLeft=function(t,e){return(0,n.assertIsBuffer)(t),i(t,e,!1)};t.setLengthRight=function(t,e){return(0,n.assertIsBuffer)(t),i(t,e,!0)};var o=function(t){for(var e=t[0];t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};t.unpadBuffer=function(t){return(0,n.assertIsBuffer)(t),o(t)};t.unpadArray=function(t){return(0,n.assertIsArray)(t),o(t)};t.unpadHexString=function(t){return(0,n.assertIsHexString)(t),t=(0,r.stripHexPrefix)(t),o(t)};t.toBuffer=function(n){if(null==n)return L.allocUnsafe(0);if(lt(n))return L.from(n);if(Array.isArray(n)||n instanceof Uint8Array)return L.from(n);if("string"==typeof n){if(!(0,r.isHexString)(n))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(n));return L.from((0,r.padToEven)((0,r.stripHexPrefix)(n)),"hex")}if("number"==typeof n)return(0,t.intToBuffer)(n);if(e.BN.isBN(n)){if(n.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(n));return n.toArrayLike(L)}if(n.toArray)return L.from(n.toArray());if(n.toBuffer)return L.from(n.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(r){return new e.BN((0,t.toBuffer)(r)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(t){return new e.BN(t).fromTwos(256)};t.toUnsigned=function(t){return L.from(t.toTwos(256).toArray())};t.addHexPrefix=function(t){return"string"!=typeof t||(0,r.isHexPrefixed)(t)?t:"0x"+t};t.toUtf8=function(t){if((t=(0,r.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return L.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(lt(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n<e.length;n++)r.push((0,t.baToJSON)(e[n]));return r}};t.validateNoLeadingZeroes=function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=c(r[e],2),i=n[0],o=n[1];if(void 0!==o&&o.length>0&&0===o[0])throw new Error("".concat(i," cannot have leading zeroes, received: ").concat(o.toString("hex")))}},t.arrToBufArr=function t(e){return Array.isArray(e)?e.map((function(e){return t(e)})):L.from(e)},t.bufArrToArr=function t(e){return Array.isArray(e)?e.map((function(e){return t(e)})):Uint8Array.from(null!=e?e:[])}}(Ta),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var e=Ot,r=_a,n=Ma,i=Ta,o=Ba;t.keccak=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256;switch((0,o.assertIsBuffer)(t),r){case 224:return(0,e.keccak224)(t);case 256:return(0,e.keccak256)(t);case 384:return(0,e.keccak384)(t);case 512:return(0,e.keccak512)(t);default:throw new Error("Invald algorithm: keccak".concat(r))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256;(0,o.assertIsString)(e);var n=L.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromHexString=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256;return(0,o.assertIsHexString)(e),(0,t.keccak)((0,i.toBuffer)(e),r)};t.keccakFromArray=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256;return(0,o.assertIsArray)(e),(0,t.keccak)((0,i.toBuffer)(e),r)};var a=function(t){return t=(0,i.toBuffer)(t),r("sha256").update(t).digest()};t.sha256=function(t){return(0,o.assertIsBuffer)(t),a(t)};t.sha256FromString=function(t){return(0,o.assertIsString)(t),a(t)};t.sha256FromArray=function(t){return(0,o.assertIsArray)(t),a(t)};var s=function(t,e){t=(0,i.toBuffer)(t);var n=r("rmd160").update(t).digest();return!0===e?(0,i.setLengthLeft)(n,32):n};t.ripemd160=function(t,e){return(0,o.assertIsBuffer)(t),s(t,e)};t.ripemd160FromString=function(t,e){return(0,o.assertIsString)(t),s(t,e)};t.ripemd160FromArray=function(t,e){return(0,o.assertIsArray)(t),s(t,e)};t.rlphash=function(e){return(0,t.keccak)(n.rlp.encode(e))}}(It);var Ca={};function Na(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var Da,za=Object.prototype.hasOwnProperty,ja=Object.keys||function(t){var e=[];for(var r in t)za.call(t,r)&&e.push(r);return e},qa=Array.prototype.slice;function Ua(){return void 0!==Da?Da:Da="foo"===function(){}.name}function Ka(t){return Object.prototype.toString.call(t)}function Fa(t){return!lt(t)&&("function"==typeof b.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function Ha(t,e){t||Xa(t,!0,e,"==",Ga)}var Va=/\s*function\s+([^\(\s]*)\s*/;function Wa(t){if(Ve(t)){if(Ua())return t.name;var e=t.toString().match(Va);return e&&e[1]}}function Ya(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return Za(Ja(t.actual),128)+" "+t.operator+" "+Za(Ja(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||Xa;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=Wa(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}}function Za(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function Ja(t){if(Ua()||!Ve(t))return Re(t);var e=Wa(t);return"[Function"+(e?": "+e:"")+"]"}function Xa(t,e,r,n,i){throw new Ya({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function Ga(t,e){t||Xa(t,!0,e,"==",Ga)}function $a(t,e,r){t!=e&&Xa(t,e,r,"==",$a)}function Qa(t,e,r){t==e&&Xa(t,e,r,"!=",Qa)}function ts(t,e,r){rs(t,e,!1)||Xa(t,e,r,"deepEqual",ts)}function es(t,e,r){rs(t,e,!0)||Xa(t,e,r,"deepStrictEqual",es)}function rs(t,r,n,i){if(t===r)return!0;if(lt(t)&<(r))return 0===Na(t,r);if(Fe(t)&&Fe(r))return t.getTime()===r.getTime();if(Ue(t)&&Ue(r))return t.source===r.source&&t.global===r.global&&t.multiline===r.multiline&&t.lastIndex===r.lastIndex&&t.ignoreCase===r.ignoreCase;if(null!==t&&"object"===e(t)||null!==r&&"object"===e(r)){if(Fa(t)&&Fa(r)&&Ka(t)===Ka(r)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===Na(new Uint8Array(t.buffer),new Uint8Array(r.buffer));if(lt(t)!==lt(r))return!1;var o=(i=i||{actual:[],expected:[]}).actual.indexOf(t);return-1!==o&&o===i.expected.indexOf(r)||(i.actual.push(t),i.expected.push(r),function(t,e,r,n){if(null==t||null==e)return!1;if(We(t)||We(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=ns(t),o=ns(e);if(i&&!o||!i&&o)return!1;if(i)return rs(t=qa.call(t),e=qa.call(e),r);var a,s,f=ja(t),h=ja(e);if(f.length!==h.length)return!1;for(f.sort(),h.sort(),s=f.length-1;s>=0;s--)if(f[s]!==h[s])return!1;for(s=f.length-1;s>=0;s--)if(!rs(t[a=f[s]],e[a],r,n))return!1;return!0}(t,r,n,i))}return n?t===r:t==r}function ns(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function is(t,e,r){rs(t,e,!1)&&Xa(t,e,r,"notDeepEqual",is)}function os(t,e,r){rs(t,e,!0)&&Xa(t,e,r,"notDeepStrictEqual",os)}function as(t,e,r){t!==e&&Xa(t,e,r,"===",as)}function ss(t,e,r){t===e&&Xa(t,e,r,"!==",ss)}function fs(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function hs(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&Xa(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!t&&i&&!r;if((!t&&He(i)&&o&&fs(i,r)||a)&&Xa(i,r,"Got unwanted exception"+n),t&&i&&r&&!fs(i,r)||!t&&i)throw i}function us(t,e,r){hs(!0,t,e,r)}function cs(t,e,r){hs(!1,t,e,r)}function ds(t){if(t)throw t}Ha.AssertionError=Ya,we(Ya,Error),Ha.fail=Xa,Ha.ok=Ga,Ha.equal=$a,Ha.notEqual=Qa,Ha.deepEqual=ts,Ha.deepStrictEqual=es,Ha.notDeepEqual=is,Ha.notDeepStrictEqual=os,Ha.strictEqual=as,Ha.notStrictEqual=ss,Ha.throws=us,Ha.doesNotThrow=cs,Ha.ifError=ds;var ls=mt(Object.freeze({__proto__:null,default:Ha,AssertionError:Ya,fail:Xa,ok:Ga,assert:Ga,equal:$a,notEqual:Qa,deepEqual:ts,deepStrictEqual:es,notDeepEqual:is,notDeepStrictEqual:os,strictEqual:as,notStrictEqual:ss,throws:us,doesNotThrow:cs,ifError:ds})),ps={},bs="Impossible case. Please create issue.",ms="The tweak was out of range or the resulted private key is invalid",gs="The tweak was out of range or equal to zero",vs="Unknow error on context randomization",ys="Private Key is invalid",ws="Public Key could not be parsed",_s="Public Key serialization error",Ms="The sum of the public keys is not valid",Ss="Signature could not be parsed",Es="The nonce generation function failed, or the private key was invalid",As="Public key could not be recover",xs="Scalar was invalid (zero or overflow)";function Rs(t,e){if(!t)throw new Error(e)}function ks(t,e,r){if(Rs(e instanceof Uint8Array,"Expected ".concat(t," to be an Uint8Array")),void 0!==r)if(Array.isArray(r)){var n=r.join(", "),i="Expected ".concat(t," to be an Uint8Array with length [").concat(n,"]");Rs(r.includes(e.length),i)}else{var o="Expected ".concat(t," to be an Uint8Array with length ").concat(r);Rs(e.length===r,o)}}function Ts(t){Rs("Boolean"===Is(t),"Expected compressed to be a Boolean")}function Ls(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return new Uint8Array(t)},e=arguments.length>1?arguments[1]:void 0;return"function"==typeof t&&(t=t(e)),ks("output",t,e),t}function Is(t){return Object.prototype.toString.call(t).slice(8,-1)}var Os={},Bs="6.5.4",Ps={},Cs={exports:{}};!function(t){!function(t,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===e(t)?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:yt.Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function f(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===e(t)&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,r,i){if("number"==typeof t)return this._initNumber(t,r,i);if("object"===e(t))return this._initArray(t,r,i);"hex"===r&&(r=16),n(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<t.length&&(16===r?this._parseHex(t,o,i):(this._parseBase(t,r,o),"le"===i&&this._initArray(this.toArray(),r,i)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,u=r;u<s;u+=n)f=h(t,u,u+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var c=1;for(f=h(t,u,t.length,e),u=0;u<a;u++)c*=e;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[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],d=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var h=1;h<n;h++){for(var u=f>>>26,c=67108863&f,d=Math.min(h,e.length-1),l=Math.max(0,h-t.length+1);l<=d;l++){var p=h-l|0;u+=(a=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],f=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?u[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:u[h-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===e,h=new t(o),u=this.clone();if(f){for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),h[s]=a;for(;s<o;s++)h[s]=0}else{for(s=0;s<o-i;s++)h[s]=0;for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),h[o-s-1]=a}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a<n.length;a++)o=(e=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,a=t.words,s=e.words,f=r.words,h=0,u=0|a[0],c=8191&u,d=u>>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,_=y>>>13,M=0|a[4],S=8191&M,E=M>>>13,A=0|a[5],x=8191&A,R=A>>>13,k=0|a[6],T=8191&k,L=k>>>13,I=0|a[7],O=8191&I,B=I>>>13,P=0|a[8],C=8191&P,N=P>>>13,D=0|a[9],z=8191&D,j=D>>>13,q=0|s[0],U=8191&q,K=q>>>13,F=0|s[1],H=8191&F,V=F>>>13,W=0|s[2],Y=8191&W,Z=W>>>13,J=0|s[3],X=8191&J,G=J>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ft=8191&st,ht=st>>>13,ut=0|s[8],ct=8191&ut,dt=ut>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,U))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(d,U)|0))<<13)|0;h=((o=Math.imul(d,K))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,K))+Math.imul(b,U)|0,o=Math.imul(b,K);var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,H)|0))<<13)|0;h=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,K))+Math.imul(v,U)|0,o=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var vt=(h+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,Z)|0)+Math.imul(d,Y)|0))<<13)|0;h=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,K))+Math.imul(_,U)|0,o=Math.imul(_,K),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0;var yt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,K))+Math.imul(E,U)|0,o=Math.imul(E,K),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0;var wt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,K))+Math.imul(R,U)|0,o=Math.imul(R,K),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(g,X)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,K))+Math.imul(L,U)|0,o=Math.imul(L,K),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,K))+Math.imul(B,U)|0,o=Math.imul(B,K),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var St=(h+(n=n+Math.imul(c,ft)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(d,ft)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,K))+Math.imul(N,U)|0,o=Math.imul(N,K),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Et=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,K))+Math.imul(j,U)|0,o=Math.imul(j,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var At=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,H),i=(i=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;h=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,Y),i=(i=Math.imul(z,Z))+Math.imul(j,Y)|0,o=Math.imul(j,Z),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Rt=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,G))+Math.imul(j,X)|0,o=Math.imul(j,G),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var kt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Tt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Lt=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,at))+Math.imul(j,ot)|0,o=Math.imul(j,at),n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var It=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,ft),i=(i=Math.imul(z,ht))+Math.imul(j,ft)|0,o=Math.imul(j,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Ot=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,bt)|0)+Math.imul(B,pt)|0))<<13)|0;h=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,ct),i=(i=Math.imul(z,dt))+Math.imul(j,ct)|0,o=Math.imul(j,dt);var Bt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Pt=(h+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,bt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,f[0]=mt,f[1]=gt,f[2]=vt,f[3]=yt,f[4]=wt,f[5]=_t,f[6]=Mt,f[7]=St,f[8]=Et,f[9]=At,f[10]=xt,f[11]=Rt,f[12]=kt,f[13]=Tt,f[14]=Lt,f[15]=It,f[16]=Ot,f[17]=Bt,f[18]=Pt,0!==h&&(f[19]=h,r.length++),r};function b(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=l),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?l(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,f=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=f;h++){var u=o-h,c=(0|t.words[u])*(0|e.words[h]),d=67108863&c;s=67108863&(d=d+s|0),i+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):b(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a<o;a++)n[a]=e[t[a]],i[a]=r[t[a]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,f=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var c=f,d=h,l=0;l<a;l++){var p=r[u+l],b=n[u+l],m=r[u+l+a],g=n[u+l+a],v=c*m-d*g;g=c*g+d*m,m=v,r[u+l]=p+m,n[u+l]=b+g,r[u+l+a]=p-m,n[u+l+a]=b-g,l!==s&&(v=f*c-h*d,d=f*d+h*c,c=v)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),f=new Array(n),h=new Array(n),u=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,h,n),this.transform(a,o,s,f,n,i),this.transform(h,o,u,c,n,i);for(var l=0;l<n;l++){var p=s[l]*u[l]-f[l]*c[l];f[l]=s[l]*c[l]+f[l]*u[l],s[l]=p}return this.conjugate(s,f,n),this.transform(s,f,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,f=(0|this.words[e])-s<<r;this.words[e]=f|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,f=r;if(i-=a,i=Math.max(0,i),f){for(var h=0;h<a;h++)f.words[h]=this.words[h];f.length=a}if(0===a);else if(this.length>a)for(this.length-=a,h=0;h<this.length;h++)this.words[h]=this.words[h+a];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(0!==u||h>=i);h--){var c=0|this.words[h];this.words[h]=u<<26-o|c>>>o,u=c&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var f=(0|t.words[i])*e;s=((o-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==e){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var h=0;h<s.length;h++)s.words[h]=0}var u=n.clone()._ishlnsubmul(i,1,f);0===u.negative&&(n=u,s&&(s.words[f]=1));for(var c=f-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var u=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(c)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(c)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(f)):(r.isub(e),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<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},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,v),i(_,v),i(M,v),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return g[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var c=this.pow(u,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(c,new o(1).iushln(p-m-1));d=d.redMul(g),c=g.redSqr(),l=l.redMul(c),p=m}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],a=0,s=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],u=f-1;u>=0;u--){var c=h>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,bt)}(Cs);var Ns=Ds;function Ds(t,e){if(!t)throw new Error(e||"Assertion failed")}Ds.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var zs={};!function(t){var e=t;function r(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},e.zero2=r,e.toHex=n,e.encode=function(t,e){return"hex"===e?n(t):t}}(zs),function(t){var e=t,r=Cs.exports,n=Ns,i=zs;e.assert=n,e.toArray=i.toArray,e.zero2=i.zero2,e.toHex=i.toHex,e.encode=i.encode,e.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<n.length;a++){var s,f=o.andln(i-1);o.isOdd()?(s=f>(i>>1)-1?(i>>1)-f:f,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,f=t.andln(3)+i&3,h=e.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),a=0==(1&f)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?f:-f,r[0].push(a),s=0==(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==f?h:-h,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},e.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(t){return new r(t,"hex","le")}}(Ps);var js,qs={exports:{}},Us=mt(Object.freeze({__proto__:null,default:{}}));function Ks(t){this.rand=t}if(qs.exports=function(t){return js||(js=new Ks(null)),js.generate(t)},qs.exports.Rand=Ks,Ks.prototype.generate=function(t){return this._rand(t)},Ks.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"===("undefined"==typeof self?"undefined":e(self)))self.crypto&&self.crypto.getRandomValues?Ks.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?Ks.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"===("undefined"==typeof window?"undefined":e(window))&&(Ks.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Fs=Us;if("function"!=typeof Fs.randomBytes)throw new Error("Not supported");Ks.prototype._rand=function(t){return Fs.randomBytes(t)}}catch(t){}var Hs={},Vs=Cs.exports,Ws=Ps,Ys=Ws.getNAF,Zs=Ws.getJSF,Js=Ws.assert;function Xs(t,e){this.type=t,this.p=new Vs(e.p,16),this.red=e.prime?Vs.red(e.prime):Vs.mont(this.p),this.zero=new Vs(0).toRed(this.red),this.one=new Vs(1).toRed(this.red),this.two=new Vs(2).toRed(this.red),this.n=e.n&&new Vs(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var 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))}var Gs=Xs;function $s(t,e){this.curve=t,this.type=e,this.precomputed=null}Xs.prototype.point=function(){throw new Error("Not implemented")},Xs.prototype.validate=function(){throw new Error("Not implemented")},Xs.prototype._fixedNafMul=function(t,e){Js(t.precomputed);var r=t._getDoubles(),n=Ys(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var f=o+r.step-1;f>=o;f--)a=(a<<1)+n[f];s.push(a)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),c=i;c>0;c--){for(o=0;o<s.length;o++)(a=s[o])===c?u=u.mixedAdd(r.points[o]):a===-c&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},Xs.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Ys(e,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var f=0;s>=0&&0===o[s];s--)f++;if(s>=0&&f++,a=a.dblp(f),s<0)break;var h=o[s];Js(0!==h),a="affine"===t.type?h>0?a.mixedAdd(i[h-1>>1]):a.mixedAdd(i[-h-1>>1].neg()):h>0?a.add(i[h-1>>1]):a.add(i[-h-1>>1].neg())}return"affine"===t.type?a.toP():a},Xs.prototype._wnafMulAdd=function(t,e,r,n,i){var o,a,s,f=this._wnafT1,h=this._wnafT2,u=this._wnafT3,c=0;for(o=0;o<n;o++){var d=(s=e[o])._getNAFPoints(t);f[o]=d.wnd,h[o]=d.points}for(o=n-1;o>=1;o-=2){var l=o-1,p=o;if(1===f[l]&&1===f[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=Zs(r[l],r[p]);for(c=Math.max(g[0].length,c),u[l]=new Array(c),u[p]=new Array(c),a=0;a<c;a++){var v=0|g[0][a],y=0|g[1][a];u[l][a]=m[3*(v+1)+(y+1)],u[p][a]=0,h[l]=b}}else u[l]=Ys(r[l],f[l],this._bitLength),u[p]=Ys(r[p],f[p],this._bitLength),c=Math.max(u[l].length,c),c=Math.max(u[p].length,c)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=c;o>=0;o--){for(var M=0;o>=0;){var S=!0;for(a=0;a<n;a++)_[a]=0|u[a][o],0!==_[a]&&(S=!1);if(!S)break;M++,o--}if(o>=0&&M++,w=w.dblp(M),o<0)break;for(a=0;a<n;a++){var E=_[a];0!==E&&(E>0?s=h[a][E-1>>1]:E<0&&(s=h[a][-E-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)h[o]=null;return i?w:w.toP()},Xs.BasePoint=$s,$s.prototype.eq=function(){throw new Error("Not implemented")},$s.prototype.validate=function(){return this.curve.validate(this)},Xs.prototype.decodePoint=function(t,e){t=Ws.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?Js(t[t.length-1]%2==0):7===t[0]&&Js(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},$s.prototype.encodeCompressed=function(t){return this.encode(t,!0)},$s.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},$s.prototype.encode=function(t,e){return Ws.encode(this._encode(e),t)},$s.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},$s.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},$s.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},$s.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},$s.prototype._getBeta=function(){return null},$s.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var Qs=Ps,tf=Cs.exports,ef=mr.exports,rf=Gs,nf=Qs.assert;function of(t){rf.call(this,"short",t),this.a=new tf(t.a,16).toRed(this.red),this.b=new tf(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ef(of,rf);var af=of;function sf(t,e,r,n){rf.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new tf(e,16),this.y=new tf(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 ff(t,e,r,n){rf.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new tf(0)):(this.x=new tf(e,16),this.y=new tf(r,16),this.z=new tf(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}of.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new tf(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new tf(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],nf(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new tf(t.a,16),b:new tf(t.b,16)}})):this._getEndoBasis(r)}}},of.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:tf.mont(t),r=new tf(2).toRed(e).redInvm(),n=r.redNeg(),i=new tf(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},of.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,a,s,f,h,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=t,d=this.n.clone(),l=new tf(1),p=new tf(0),b=new tf(0),m=new tf(1),g=0;0!==c.cmpn(0);){var v=d.div(c);f=d.sub(v.mul(c)),h=b.sub(v.mul(l));var y=m.sub(v.mul(p));if(!n&&f.cmp(u)<0)e=s.neg(),r=l,n=f.neg(),i=h;else if(n&&2==++g)break;s=f,d=c,c=f,b=l,l=h,m=p,p=y}o=f.neg(),a=h;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},of.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),f=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:f.add(h).neg()}},of.prototype.pointFromX=function(t,e){(t=new tf(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},of.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},of.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],f=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),f=f.neg(!0)),n[2*o]=s,n[2*o+1]=f,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return h},ef(sf,rf.BasePoint),of.prototype.point=function(t,e,r){return new sf(this,t,e,r)},of.prototype.pointFromJSON=function(t,e){return sf.fromJSON(this,t,e)},sf.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},sf.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]},sf.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},sf.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)+">"},sf.prototype.isInfinity=function(){return this.inf},sf.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},sf.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},sf.prototype.getX=function(){return this.x.fromRed()},sf.prototype.getY=function(){return this.y.fromRed()},sf.prototype.mul=function(t){return t=new tf(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},sf.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},sf.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},sf.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},sf.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},sf.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ef(ff,rf.BasePoint),of.prototype.jpoint=function(t,e,r){return new ff(this,t,e,r)},ff.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},ff.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ff.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=o.redSub(a);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),u=h.redMul(s),c=n.redMul(h),d=f.redSqr().redIAdd(u).redISub(c).redISub(c),l=f.redMul(c.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},ff.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),h=f.redMul(a),u=r.redMul(f),c=s.redSqr().redIAdd(h).redISub(u).redISub(u),d=s.redMul(u.redISub(c)).redISub(i.redMul(h)),l=this.z.redMul(a);return this.curve.jpoint(c,d,l)},ff.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,f=s.redSqr().redSqr(),h=a.redAdd(a);for(e=0;e<t;e++){var u=o.redSqr(),c=h.redSqr(),d=c.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(f)),p=o.redMul(c),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=l.redMul(m);g=g.redIAdd(g).redISub(d);var v=h.redMul(s);e+1<t&&(f=f.redMul(d)),o=b,s=v,h=g}return this.curve.jpoint(o,h.redMul(i),s)},ff.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ff.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),f=s.redSqr().redISub(a).redISub(a),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=f,e=s.redMul(a.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(u).redISub(d);l=l.redIAdd(l);var p=u.redAdd(u).redIAdd(u),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},ff.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=s.redSqr().redISub(a).redISub(a);t=f;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=s.redMul(a.redISub(f)).redISub(h),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(u);var m=c.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),e=l.redMul(p.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},ff.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e),h=(f=f.redIAdd(f)).redMul(a),u=s.redSqr().redISub(h.redAdd(h)),c=h.redISub(u),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=s.redMul(c).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,p)},ff.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(f),u=e.redMul(h);u=(u=u.redIAdd(u)).redIAdd(u);var c=this.x.redMul(s).redISub(u);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(h.redMul(f.redISub(h)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(c,d,l)},ff.prototype.mul=function(t,e){return t=new tf(t,e),this.curve._wnafMul(this,t)},ff.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},ff.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){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}},ff.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)+">"},ff.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var hf=Cs.exports,uf=mr.exports,cf=Gs,df=Ps;function lf(t){cf.call(this,"mont",t),this.a=new hf(t.a,16).toRed(this.red),this.b=new hf(t.b,16).toRed(this.red),this.i4=new hf(4).toRed(this.red).redInvm(),this.two=new hf(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}uf(lf,cf);var pf=lf;function bf(t,e,r){cf.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new hf(e,16),this.z=new hf(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}lf.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},uf(bf,cf.BasePoint),lf.prototype.decodePoint=function(t,e){return this.point(df.toArray(t,e),1)},lf.prototype.point=function(t,e){return new bf(this,t,e)},lf.prototype.pointFromJSON=function(t){return bf.fromJSON(this,t)},bf.prototype.precompute=function(){},bf.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},bf.fromJSON=function(t,e){return new bf(t,e[0],e[1]||t.one)},bf.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)+">"},bf.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},bf.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},bf.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},bf.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),f=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,f)},bf.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},bf.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},bf.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},bf.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},bf.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},bf.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var mf=Ps,gf=Cs.exports,vf=mr.exports,yf=Gs,wf=mf.assert;function _f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,yf.call(this,"edwards",t),this.a=new gf(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new gf(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new gf(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),wf(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}vf(_f,yf);var Mf=_f;function Sf(t,e,r,n,i){yf.BasePoint.call(this,t,"projective"),null===e&&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 gf(e,16),this.y=new gf(r,16),this.z=n?new gf(n,16):this.curve.one,this.t=i&&new gf(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.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.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},_f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},_f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},_f.prototype.pointFromX=function(t,e){(t=new gf(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(e&&!s||!e&&s)&&(a=a.redNeg()),this.point(t,a)},_f.prototype.pointFromY=function(t,e){(t=new gf(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},_f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},vf(Sf,yf.BasePoint),_f.prototype.pointFromJSON=function(t){return Sf.fromJSON(this,t)},_f.prototype.point=function(t,e,r,n){return new Sf(this,t,e,r,n)},Sf.fromJSON=function(t,e){return new Sf(t,e[0],e[1],e[2])},Sf.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)+">"},Sf.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Sf.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),f=i.redMul(a),h=o.redMul(s),u=i.redMul(s),c=a.redMul(o);return this.curve.point(f,h,c,u)},Sf.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var h=(n=this.curve._mulA(s)).redAdd(f);this.zOne?(t=a.redSub(s).redSub(f).redMul(h.redSub(this.curve.two)),e=h.redMul(n.redSub(f)),r=h.redSqr().redSub(h).redSub(h)):(i=this.z.redSqr(),o=h.redSub(i).redISub(i),t=a.redSub(s).redISub(f).redMul(o),e=h.redMul(n.redSub(f)),r=h.redMul(o))}else n=s.redAdd(f),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(f)),r=n.redMul(o);return this.curve.point(t,e,r)},Sf.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Sf.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),f=r.redAdd(e),h=o.redMul(a),u=s.redMul(f),c=o.redMul(f),d=a.redMul(s);return this.curve.point(h,u,d,c)},Sf.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),f=i.redSub(s),h=i.redAdd(s),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),c=n.redMul(f).redMul(u);return this.curve.twisted?(e=n.redMul(h).redMul(a.redSub(this.curve._mulA(o))),r=f.redMul(h)):(e=n.redMul(h).redMul(a.redSub(o)),r=this.curve._mulC(f).redMul(h)),this.curve.point(c,e,r)},Sf.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Sf.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Sf.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},Sf.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},Sf.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Sf.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Sf.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Sf.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Sf.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Sf.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},Sf.prototype.toP=Sf.prototype.normalize,Sf.prototype.mixedAdd=Sf.prototype.add,function(t){var e=t;e.base=Gs,e.short=af,e.mont=pf,e.edwards=Mf}(Hs);var Ef={},Af={},xf={},Rf=Ns,kf=mr.exports;function Tf(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function Lf(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function If(t){return 1===t.length?"0"+t:t}function Of(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}xf.inherits=kf,xf.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):Tf(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},xf.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=If(t[r].toString(16));return e},xf.htonl=Lf,xf.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=Lf(i)),r+=Of(i.toString(16))}return r},xf.zero2=If,xf.zero8=Of,xf.join32=function(t,e,r,n){var i=r-e;Rf(i%4==0);for(var o=new Array(i/4),a=0,s=e;a<o.length;a++,s+=4){var f;f="big"===n?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],o[a]=f>>>0}return o},xf.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},xf.rotr32=function(t,e){return t>>>e|t<<32-e},xf.rotl32=function(t,e){return t<<e|t>>>32-e},xf.sum32=function(t,e){return t+e>>>0},xf.sum32_3=function(t,e,r){return t+e+r>>>0},xf.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},xf.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},xf.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o},xf.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},xf.sum64_lo=function(t,e,r,n){return e+n>>>0},xf.sum64_4_hi=function(t,e,r,n,i,o,a,s){var f=0,h=e;return f+=(h=h+n>>>0)<e?1:0,f+=(h=h+o>>>0)<o?1:0,t+r+i+a+(f+=(h=h+s>>>0)<s?1:0)>>>0},xf.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},xf.sum64_5_hi=function(t,e,r,n,i,o,a,s,f,h){var u=0,c=e;return u+=(c=c+n>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,u+=(c=c+s>>>0)<s?1:0,t+r+i+a+f+(u+=(c=c+h>>>0)<h?1:0)>>>0},xf.sum64_5_lo=function(t,e,r,n,i,o,a,s,f,h){return e+n+o+s+h>>>0},xf.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},xf.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},xf.shr64_hi=function(t,e,r){return t>>>r},xf.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var Bf={},Pf=xf,Cf=Ns;function Nf(){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}Bf.BlockHash=Nf,Nf.prototype.update=function(t,e){if(t=Pf.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=Pf.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},Nf.prototype.digest=function(t){return this.update(this._pad()),Cf(null===this.pending),this._digest(t)},Nf.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var Df={},zf={},jf=xf.rotr32;function qf(t,e,r){return t&e^~t&r}function Uf(t,e,r){return t&e^t&r^e&r}function Kf(t,e,r){return t^e^r}zf.ft_1=function(t,e,r,n){return 0===t?qf(e,r,n):1===t||3===t?Kf(e,r,n):2===t?Uf(e,r,n):void 0},zf.ch32=qf,zf.maj32=Uf,zf.p32=Kf,zf.s0_256=function(t){return jf(t,2)^jf(t,13)^jf(t,22)},zf.s1_256=function(t){return jf(t,6)^jf(t,11)^jf(t,25)},zf.g0_256=function(t){return jf(t,7)^jf(t,18)^t>>>3},zf.g1_256=function(t){return jf(t,17)^jf(t,19)^t>>>10};var Ff=xf,Hf=Bf,Vf=zf,Wf=Ff.rotl32,Yf=Ff.sum32,Zf=Ff.sum32_5,Jf=Vf.ft_1,Xf=Hf.BlockHash,Gf=[1518500249,1859775393,2400959708,3395469782];function $f(){if(!(this instanceof $f))return new $f;Xf.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ff.inherits($f,Xf);var Qf=$f;$f.blockSize=512,$f.outSize=160,$f.hmacStrength=80,$f.padLength=64,$f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=Wf(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var h=~~(n/20),u=Zf(Wf(i,5),Jf(h,o,a,s),f,r[n],Gf[h]);f=s,s=a,a=Wf(o,30),o=i,i=u}this.h[0]=Yf(this.h[0],i),this.h[1]=Yf(this.h[1],o),this.h[2]=Yf(this.h[2],a),this.h[3]=Yf(this.h[3],s),this.h[4]=Yf(this.h[4],f)},$f.prototype._digest=function(t){return"hex"===t?Ff.toHex32(this.h,"big"):Ff.split32(this.h,"big")};var th=xf,eh=Bf,rh=zf,nh=Ns,ih=th.sum32,oh=th.sum32_4,ah=th.sum32_5,sh=rh.ch32,fh=rh.maj32,hh=rh.s0_256,uh=rh.s1_256,ch=rh.g0_256,dh=rh.g1_256,lh=eh.BlockHash,ph=[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 bh(){if(!(this instanceof bh))return new bh;lh.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ph,this.W=new Array(64)}th.inherits(bh,lh);var mh=bh;bh.blockSize=512,bh.outSize=256,bh.hmacStrength=192,bh.padLength=64,bh.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=oh(dh(r[n-2]),r[n-7],ch(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],f=this.h[4],h=this.h[5],u=this.h[6],c=this.h[7];for(nh(this.k.length===r.length),n=0;n<r.length;n++){var d=ah(c,uh(f),sh(f,h,u),this.k[n],r[n]),l=ih(hh(i),fh(i,o,a));c=u,u=h,h=f,f=ih(s,d),s=a,a=o,o=i,i=ih(d,l)}this.h[0]=ih(this.h[0],i),this.h[1]=ih(this.h[1],o),this.h[2]=ih(this.h[2],a),this.h[3]=ih(this.h[3],s),this.h[4]=ih(this.h[4],f),this.h[5]=ih(this.h[5],h),this.h[6]=ih(this.h[6],u),this.h[7]=ih(this.h[7],c)},bh.prototype._digest=function(t){return"hex"===t?th.toHex32(this.h,"big"):th.split32(this.h,"big")};var gh=xf,vh=mh;function yh(){if(!(this instanceof yh))return new yh;vh.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}gh.inherits(yh,vh);var wh=yh;yh.blockSize=512,yh.outSize=224,yh.hmacStrength=192,yh.padLength=64,yh.prototype._digest=function(t){return"hex"===t?gh.toHex32(this.h.slice(0,7),"big"):gh.split32(this.h.slice(0,7),"big")};var _h=xf,Mh=Bf,Sh=Ns,Eh=_h.rotr64_hi,Ah=_h.rotr64_lo,xh=_h.shr64_hi,Rh=_h.shr64_lo,kh=_h.sum64,Th=_h.sum64_hi,Lh=_h.sum64_lo,Ih=_h.sum64_4_hi,Oh=_h.sum64_4_lo,Bh=_h.sum64_5_hi,Ph=_h.sum64_5_lo,Ch=Mh.BlockHash,Nh=[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 Dh(){if(!(this instanceof Dh))return new Dh;Ch.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Nh,this.W=new Array(160)}_h.inherits(Dh,Ch);var zh=Dh;function jh(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function qh(t,e,r,n,i,o){var a=e&n^~e&o;return a<0&&(a+=4294967296),a}function Uh(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function Kh(t,e,r,n,i,o){var a=e&n^e&o^n&o;return a<0&&(a+=4294967296),a}function Fh(t,e){var r=Eh(t,e,28)^Eh(e,t,2)^Eh(e,t,7);return r<0&&(r+=4294967296),r}function Hh(t,e){var r=Ah(t,e,28)^Ah(e,t,2)^Ah(e,t,7);return r<0&&(r+=4294967296),r}function Vh(t,e){var r=Eh(t,e,14)^Eh(t,e,18)^Eh(e,t,9);return r<0&&(r+=4294967296),r}function Wh(t,e){var r=Ah(t,e,14)^Ah(t,e,18)^Ah(e,t,9);return r<0&&(r+=4294967296),r}function Yh(t,e){var r=Eh(t,e,1)^Eh(t,e,8)^xh(t,e,7);return r<0&&(r+=4294967296),r}function Zh(t,e){var r=Ah(t,e,1)^Ah(t,e,8)^Rh(t,e,7);return r<0&&(r+=4294967296),r}function Jh(t,e){var r=Eh(t,e,19)^Eh(e,t,29)^xh(t,e,6);return r<0&&(r+=4294967296),r}function Xh(t,e){var r=Ah(t,e,19)^Ah(e,t,29)^Rh(t,e,6);return r<0&&(r+=4294967296),r}Dh.blockSize=1024,Dh.outSize=512,Dh.hmacStrength=192,Dh.padLength=128,Dh.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=Jh(r[n-4],r[n-3]),o=Xh(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],f=Yh(r[n-30],r[n-29]),h=Zh(r[n-30],r[n-29]),u=r[n-32],c=r[n-31];r[n]=Ih(i,o,a,s,f,h,u,c),r[n+1]=Oh(i,o,a,s,f,h,u,c)}},Dh.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],f=this.h[5],h=this.h[6],u=this.h[7],c=this.h[8],d=this.h[9],l=this.h[10],p=this.h[11],b=this.h[12],m=this.h[13],g=this.h[14],v=this.h[15];Sh(this.k.length===r.length);for(var y=0;y<r.length;y+=2){var w=g,_=v,M=Vh(c,d),S=Wh(c,d),E=jh(c,d,l,p,b),A=qh(c,d,l,p,b,m),x=this.k[y],R=this.k[y+1],k=r[y],T=r[y+1],L=Bh(w,_,M,S,E,A,x,R,k,T),I=Ph(w,_,M,S,E,A,x,R,k,T);w=Fh(n,i),_=Hh(n,i),M=Uh(n,i,o,a,s),S=Kh(n,i,o,a,s,f);var O=Th(w,_,M,S),B=Lh(w,_,M,S);g=b,v=m,b=l,m=p,l=c,p=d,c=Th(h,u,L,I),d=Lh(u,u,L,I),h=s,u=f,s=o,f=a,o=n,a=i,n=Th(L,I,O,B),i=Lh(L,I,O,B)}kh(this.h,0,n,i),kh(this.h,2,o,a),kh(this.h,4,s,f),kh(this.h,6,h,u),kh(this.h,8,c,d),kh(this.h,10,l,p),kh(this.h,12,b,m),kh(this.h,14,g,v)},Dh.prototype._digest=function(t){return"hex"===t?_h.toHex32(this.h,"big"):_h.split32(this.h,"big")};var Gh=xf,$h=zh;function Qh(){if(!(this instanceof Qh))return new Qh;$h.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Gh.inherits(Qh,$h);var tu=Qh;Qh.blockSize=1024,Qh.outSize=384,Qh.hmacStrength=192,Qh.padLength=128,Qh.prototype._digest=function(t){return"hex"===t?Gh.toHex32(this.h.slice(0,12),"big"):Gh.split32(this.h.slice(0,12),"big")},Df.sha1=Qf,Df.sha224=wh,Df.sha256=mh,Df.sha384=tu,Df.sha512=zh;var eu={},ru=xf,nu=Bf,iu=ru.rotl32,ou=ru.sum32,au=ru.sum32_3,su=ru.sum32_4,fu=nu.BlockHash;function hu(){if(!(this instanceof hu))return new hu;fu.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function uu(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function cu(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function du(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}ru.inherits(hu,fu),eu.ripemd160=hu,hu.blockSize=512,hu.outSize=160,hu.hmacStrength=192,hu.padLength=64,hu.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=r,f=n,h=i,u=o,c=a,d=0;d<80;d++){var l=ou(iu(su(r,uu(d,n,i,o),t[lu[d]+e],cu(d)),bu[d]),a);r=a,a=o,o=iu(i,10),i=n,n=l,l=ou(iu(su(s,uu(79-d,f,h,u),t[pu[d]+e],du(d)),mu[d]),c),s=c,c=u,u=iu(h,10),h=f,f=l}l=au(this.h[1],i,u),this.h[1]=au(this.h[2],o,c),this.h[2]=au(this.h[3],a,s),this.h[3]=au(this.h[4],r,f),this.h[4]=au(this.h[0],n,h),this.h[0]=l},hu.prototype._digest=function(t){return"hex"===t?ru.toHex32(this.h,"little"):ru.split32(this.h,"little")};var lu=[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],pu=[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],bu=[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],mu=[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],gu=xf,vu=Ns;function yu(t,e,r){if(!(this instanceof yu))return new yu(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(gu.toArray(e,r))}var wu,_u,Mu=yu;yu.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),vu(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},yu.prototype.update=function(t,e){return this.inner.update(t,e),this},yu.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=xf,e.common=Bf,e.sha=Df,e.ripemd=eu,e.hmac=Mu,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Af),function(t){var e,r=t,n=Af,i=Hs,o=Ps.assert;function a(t){"short"===t.type?this.curve=new i.short(t):"edwards"===t.type?this.curve=new i.edwards(t):this.curve=new i.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){var n=new a(e);return Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,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:n.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:n.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:n.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:n.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:n.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:n.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:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=_u?wu:(_u=1,wu={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"]]}})}catch(t){e=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:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}(Ef);var Su=Af,Eu=zs,Au=Ns;function xu(t){if(!(this instanceof xu))return new xu(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Eu.toArray(t.entropy,t.entropyEnc||"hex"),r=Eu.toArray(t.nonce,t.nonceEnc||"hex"),n=Eu.toArray(t.pers,t.persEnc||"hex");Au(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Ru=xu;xu.prototype._init=function(t,e,r){var n=t.concat(e).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},xu.prototype._hmac=function(){return new Su.hmac(this.hash,this.K)},xu.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},xu.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=Eu.toArray(t,e),r=Eu.toArray(r,n),Au(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},xu.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=Eu.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this._reseed++,Eu.encode(o,e)};var ku=Cs.exports,Tu=Ps.assert;function Lu(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Iu=Lu;Lu.fromPublic=function(t,e,r){return e instanceof Lu?e:new Lu(t,{pub:e,pubEnc:r})},Lu.fromPrivate=function(t,e,r){return e instanceof Lu?e:new Lu(t,{priv:e,privEnc:r})},Lu.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Lu.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Lu.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},Lu.prototype._importPrivate=function(t,e){this.priv=new ku(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Lu.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?Tu(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Tu(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},Lu.prototype.derive=function(t){return t.validate()||Tu(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Lu.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Lu.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Lu.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Ou=Cs.exports,Bu=Ps,Pu=Bu.assert;function Cu(t,e){if(t instanceof Cu)return t;this._importDER(t,e)||(Pu(t.r&&t.s,"Signature without r or s"),this.r=new Ou(t.r,16),this.s=new Ou(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Nu=Cu;function Du(){this.place=0}function zu(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function ju(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function qu(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Cu.prototype._importDER=function(t,e){t=Bu.toArray(t,e);var r=new Du;if(48!==t[r.place++])return!1;var n=zu(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=zu(t,r);if(!1===i)return!1;var o=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var a=zu(t,r);if(!1===a)return!1;if(t.length!==a+r.place)return!1;var s=t.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Ou(o),this.s=new Ou(s),this.recoveryParam=null,!0},Cu.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=ju(e),r=ju(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];qu(n,e.length),(n=n.concat(e)).push(2),qu(n,r.length);var i=n.concat(r),o=[48];return qu(o,i.length),o=o.concat(i),Bu.encode(o,t)};var Uu=Cs.exports,Ku=Ru,Fu=Ps,Hu=Ef,Vu=qs.exports,Wu=Fu.assert,Yu=Iu,Zu=Nu;function Ju(t){if(!(this instanceof Ju))return new Ju(t);"string"==typeof t&&(Wu(Object.prototype.hasOwnProperty.call(Hu,t),"Unknown curve "+t),t=Hu[t]),t instanceof Hu.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Xu=Ju;Ju.prototype.keyPair=function(t){return new Yu(this,t)},Ju.prototype.keyFromPrivate=function(t,e){return Yu.fromPrivate(this,t,e)},Ju.prototype.keyFromPublic=function(t,e){return Yu.fromPublic(this,t,e)},Ju.prototype.genKeyPair=function(t){t||(t={});for(var e=new Ku({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Vu(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Uu(2));;){var i=new Uu(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Ju.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Ju.prototype.sign=function(t,r,n,i){"object"===e(n)&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new Uu(t,16));for(var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),s=t.toArray("be",o),f=new Ku({hash:this.hash,entropy:a,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new Uu(1)),u=0;;u++){var c=i.k?i.k(u):new Uu(f.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(h)>=0)){var d=this.g.mul(c);if(!d.isInfinity()){var l=d.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var b=c.invm(this.n).mul(p.mul(r.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),m^=1),new Zu({r:p,s:b,recoveryParam:m})}}}}}},Ju.prototype.verify=function(t,e,r,n){t=this._truncateToN(new Uu(t,16)),r=this.keyFromPublic(r,n);var i=(e=new Zu(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),f=s.mul(t).umod(this.n),h=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Ju.prototype.recoverPubKey=function(t,e,r,n){Wu((3&r)===r,"The recovery param is more than two bits"),e=new Zu(e,n);var i=this.n,o=new Uu(t),a=e.r,s=e.s,f=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),f):this.curve.pointFromX(a,f);var u=e.r.invm(i),c=i.sub(o).mul(u).umod(i),d=s.mul(u).umod(i);return this.g.mulAdd(c,a,d)},Ju.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new Zu(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Gu=Ps,$u=Gu.assert,Qu=Gu.parseBytes,tc=Gu.cachedProperty;function ec(t,e){this.eddsa=t,this._secret=Qu(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Qu(e.pub)}ec.fromPublic=function(t,e){return e instanceof ec?e:new ec(t,{pub:e})},ec.fromSecret=function(t,e){return e instanceof ec?e:new ec(t,{secret:e})},ec.prototype.secret=function(){return this._secret},tc(ec,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),tc(ec,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),tc(ec,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),tc(ec,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),tc(ec,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),tc(ec,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),ec.prototype.sign=function(t){return $u(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},ec.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},ec.prototype.getSecret=function(t){return $u(this._secret,"KeyPair is public only"),Gu.encode(this.secret(),t)},ec.prototype.getPublic=function(t){return Gu.encode(this.pubBytes(),t)};var rc=ec,nc=Cs.exports,ic=Ps,oc=ic.assert,ac=ic.cachedProperty,sc=ic.parseBytes;function fc(t,r){this.eddsa=t,"object"!==e(r)&&(r=sc(r)),Array.isArray(r)&&(r={R:r.slice(0,t.encodingLength),S:r.slice(t.encodingLength)}),oc(r.R&&r.S,"Signature without R or S"),t.isPoint(r.R)&&(this._R=r.R),r.S instanceof nc&&(this._S=r.S),this._Rencoded=Array.isArray(r.R)?r.R:r.Rencoded,this._Sencoded=Array.isArray(r.S)?r.S:r.Sencoded}ac(fc,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),ac(fc,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),ac(fc,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),ac(fc,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),fc.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},fc.prototype.toHex=function(){return ic.encode(this.toBytes(),"hex").toUpperCase()};var hc=fc,uc=Af,cc=Ef,dc=Ps,lc=dc.assert,pc=dc.parseBytes,bc=rc,mc=hc;function gc(t){if(lc("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof gc))return new gc(t);t=cc[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=uc.sha512}var vc=gc;gc.prototype.sign=function(t,e){t=pc(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},gc.prototype.verify=function(t,e,r){t=pc(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},gc.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return dc.intFromLE(t.digest()).umod(this.curve.n)},gc.prototype.keyFromPublic=function(t){return bc.fromPublic(this,t)},gc.prototype.keyFromSecret=function(t){return bc.fromSecret(this,t)},gc.prototype.makeSignature=function(t){return t instanceof mc?t:new mc(this,t)},gc.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},gc.prototype.decodePoint=function(t){var e=(t=dc.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=dc.intFromLE(r);return this.curve.pointFromY(i,n)},gc.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},gc.prototype.decodeInt=function(t){return dc.intFromLE(t)},gc.prototype.isPoint=function(t){return t instanceof this.pointClass},function(t){var e=t;e.version=Bs,e.utils=Ps,e.rand=qs.exports,e.curve=Hs,e.curves=Ef,e.ec=Xu,e.eddsa=vc}(Os);var yc=new(0,Os.ec)("secp256k1"),wc=yc.curve,_c=wc.n.constructor;function Mc(t){var e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){var r=new _c(e);if(r.cmp(wc.p)>=0)return null;var n=(r=r.toRed(wc.red)).redSqr().redIMul(r).redIAdd(wc.b).redSqrt();return 3===t!==n.isOdd()&&(n=n.redNeg()),yc.keyPair({pub:{x:r,y:n}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var n=new _c(e),i=new _c(r);if(n.cmp(wc.p)>=0||i.cmp(wc.p)>=0)return null;if(n=n.toRed(wc.red),i=i.toRed(wc.red),(6===t||7===t)&&i.isOdd()!==(7===t))return null;var o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(wc.b)).isZero()?yc.keyPair({pub:{x:n,y:i}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function Sc(t,e){for(var r=e.encode(null,33===t.length),n=0;n<t.length;++n)t[n]=r[n]}var Ec={contextRandomize:function(){return 0},privateKeyVerify:function(t){var e=new _c(t);return e.cmp(wc.n)<0&&!e.isZero()?0:1},privateKeyNegate:function(t){var e=new _c(t),r=wc.n.sub(e).umod(wc.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd:function(t,e){var r=new _c(e);if(r.cmp(wc.n)>=0)return 1;if(r.iadd(new _c(t)),r.cmp(wc.n)>=0&&r.isub(wc.n),r.isZero())return 1;var n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul:function(t,e){var r=new _c(e);if(r.cmp(wc.n)>=0||r.isZero())return 1;r.imul(new _c(t)),r.cmp(wc.n)>=0&&(r=r.umod(wc.n));var n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:function(t){return null===Mc(t)?1:0},publicKeyCreate:function(t,e){var r=new _c(e);return r.cmp(wc.n)>=0||r.isZero()?1:(Sc(t,yc.keyFromPrivate(e).getPublic()),0)},publicKeyConvert:function(t,e){var r=Mc(e);return null===r?1:(Sc(t,r.getPublic()),0)},publicKeyNegate:function(t,e){var r=Mc(e);if(null===r)return 1;var n=r.getPublic();return n.y=n.y.redNeg(),Sc(t,n),0},publicKeyCombine:function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n)if(r[n]=Mc(e[n]),null===r[n])return 1;for(var i=r[0].getPublic(),o=1;o<r.length;++o)i=i.add(r[o].pub);return i.isInfinity()?2:(Sc(t,i),0)},publicKeyTweakAdd:function(t,e,r){var n=Mc(e);if(null===n)return 1;if((r=new _c(r)).cmp(wc.n)>=0)return 2;var i=n.getPublic().add(wc.g.mul(r));return i.isInfinity()?2:(Sc(t,i),0)},publicKeyTweakMul:function(t,e,r){var n=Mc(e);return null===n?1:(r=new _c(r)).cmp(wc.n)>=0||r.isZero()?2:(Sc(t,n.getPublic().mul(r)),0)},signatureNormalize:function(t){var e=new _c(t.subarray(0,32)),r=new _c(t.subarray(32,64));return e.cmp(wc.n)>=0||r.cmp(wc.n)>=0?1:(1===r.cmp(yc.nh)&&t.set(wc.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport:function(t,e){var r=e.subarray(0,32),n=e.subarray(32,64);if(new _c(r).cmp(wc.n)>=0)return 1;if(new _c(n).cmp(wc.n)>=0)return 1;var i=t.output,o=i.subarray(4,37);o[0]=0,o.set(r,1);for(var a=33,s=0;a>1&&0===o[s]&&!(128&o[s+1]);--a,++s);if(128&(o=o.subarray(s))[0])return 1;if(a>1&&0===o[0]&&!(128&o[1]))return 1;var f=i.subarray(39,72);f[0]=0,f.set(n,1);for(var h=33,u=0;h>1&&0===f[u]&&!(128&f[u+1]);--h,++u);return 128&(f=f.subarray(u))[0]||h>1&&0===f[0]&&!(128&f[1])?1:(t.outputlen=6+a+h,i[0]=48,i[1]=t.outputlen-2,i[2]=2,i[3]=o.length,i.set(o,4),i[4+a]=2,i[5+a]=f.length,i.set(f,6+a),0)},signatureImport:function(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;var r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;var n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;var i=e.subarray(4,4+r);if(33===i.length&&0===i[0]&&(i=i.subarray(1)),i.length>32)return 1;var o=e.subarray(6+r);if(33===o.length&&0===o[0]&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");var a=new _c(i);a.cmp(wc.n)>=0&&(a=new _c(0));var s=new _c(e.subarray(6+r));return s.cmp(wc.n)>=0&&(s=new _c(0)),t.set(a.toArrayLike(Uint8Array,"be",32),0),t.set(s.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign:function(t,e,r,n,i){if(i){var o=i;i=function(t){var i=o(e,r,null,n,t);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new _c(i)}}var a,s=new _c(r);if(s.cmp(wc.n)>=0||s.isZero())return 1;try{a=yc.sign(e,r,{canonical:!0,k:i,pers:n})}catch(t){return 1}return t.signature.set(a.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(a.s.toArrayLike(Uint8Array,"be",32),32),t.recid=a.recoveryParam,0},ecdsaVerify:function(t,e,r){var n={r:t.subarray(0,32),s:t.subarray(32,64)},i=new _c(n.r),o=new _c(n.s);if(i.cmp(wc.n)>=0||o.cmp(wc.n)>=0)return 1;if(1===o.cmp(yc.nh)||i.isZero()||o.isZero())return 3;var a=Mc(r);if(null===a)return 2;var s=a.getPublic();return yc.verify(e,n,s)?0:3},ecdsaRecover:function(t,e,r,n){var i,o={r:e.slice(0,32),s:e.slice(32,64)},a=new _c(o.r),s=new _c(o.s);if(a.cmp(wc.n)>=0||s.cmp(wc.n)>=0)return 1;if(a.isZero()||s.isZero())return 2;try{i=yc.recoverPubKey(n,o,r)}catch(t){return 2}return Sc(t,i),0},ecdh:function(t,e,r,n,i,o,a){var s=Mc(e);if(null===s)return 1;var f=new _c(r);if(f.cmp(wc.n)>=0||f.isZero())return 2;var h=s.getPublic().mul(f);if(void 0===i)for(var u=h.encode(null,!0),c=yc.hash().update(u).digest(),d=0;d<32;++d)t[d]=c[d];else{o||(o=new Uint8Array(32));for(var l=h.getX().toArray("be",32),p=0;p<32;++p)o[p]=l[p];a||(a=new Uint8Array(32));for(var b=h.getY().toArray("be",32),m=0;m<32;++m)a[m]=b[m];var g=i(o,a,n);if(!(g instanceof Uint8Array&&g.length===t.length))return 2;t.set(g)}return 0}},Ac=function(t){return{contextRandomize:function(e){if(Rs(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&ks("seed",e,32),1===t.contextRandomize(e))throw new Error(vs)},privateKeyVerify:function(e){return ks("private key",e,32),0===t.privateKeyVerify(e)},privateKeyNegate:function(e){switch(ks("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(bs)}},privateKeyTweakAdd:function(e,r){switch(ks("private key",e,32),ks("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(ms)}},privateKeyTweakMul:function(e,r){switch(ks("private key",e,32),ks("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(gs)}},publicKeyVerify:function(e){return ks("public key",e,[33,65]),0===t.publicKeyVerify(e)},publicKeyCreate:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(ks("private key",e,32),Ts(r),n=Ls(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(ys);case 2:throw new Error(_s)}},publicKeyConvert:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(ks("public key",e,[33,65]),Ts(r),n=Ls(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(ws);case 2:throw new Error(_s)}},publicKeyNegate:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(ks("public key",e,[33,65]),Ts(r),n=Ls(n,r?33:65),t.publicKeyNegate(n,e)){case 0:return n;case 1:throw new Error(ws);case 2:throw new Error(bs);case 3:throw new Error(_s)}},publicKeyCombine:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;Rs(Array.isArray(e),"Expected public keys to be an Array"),Rs(e.length>0,"Expected public keys array will have more than zero items");var i,o=p(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;ks("public key",a,[33,65])}}catch(t){o.e(t)}finally{o.f()}switch(Ts(r),n=Ls(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(ws);case 2:throw new Error(Ms);case 3:throw new Error(_s)}},publicKeyTweakAdd:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;switch(ks("public key",e,[33,65]),ks("tweak",r,32),Ts(n),i=Ls(i,n?33:65),t.publicKeyTweakAdd(i,e,r)){case 0:return i;case 1:throw new Error(ws);case 2:throw new Error(ms)}},publicKeyTweakMul:function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;switch(ks("public key",e,[33,65]),ks("tweak",r,32),Ts(n),i=Ls(i,n?33:65),t.publicKeyTweakMul(i,e,r)){case 0:return i;case 1:throw new Error(ws);case 2:throw new Error(gs)}},signatureNormalize:function(e){switch(ks("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(Ss)}},signatureExport:function(e,r){ks("signature",e,64);var n={output:r=Ls(r,72),outputlen:72};switch(t.signatureExport(n,e)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(Ss);case 2:throw new Error(bs)}},signatureImport:function(e,r){switch(ks("signature",e),r=Ls(r,64),t.signatureImport(r,e)){case 0:return r;case 1:throw new Error(Ss);case 2:throw new Error(bs)}},ecdsaSign:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;ks("message",e,32),ks("private key",r,32),Rs("Object"===Is(n),"Expected options to be an Object"),void 0!==n.data&&ks("options.data",n.data),void 0!==n.noncefn&&Rs("Function"===Is(n.noncefn),"Expected options.noncefn to be a Function");var o={signature:i=Ls(i,64),recid:null};switch(t.ecdsaSign(o,e,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(Es);case 2:throw new Error(bs)}},ecdsaVerify:function(e,r,n){switch(ks("signature",e,64),ks("message",r,32),ks("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(Ss);case 2:throw new Error(ws)}},ecdsaRecover:function(e,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0;switch(ks("signature",e,64),Rs("Number"===Is(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),ks("message",n,32),Ts(i),o=Ls(o,i?33:65),t.ecdsaRecover(o,e,r,n)){case 0:return o;case 1:throw new Error(Ss);case 2:throw new Error(As);case 3:throw new Error(bs)}},ecdh:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;switch(ks("public key",e,[33,65]),ks("private key",r,32),Rs("Object"===Is(n),"Expected options to be an Object"),void 0!==n.data&&ks("options.data",n.data),void 0!==n.hashfn?(Rs("Function"===Is(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&ks("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&ks("options.ybuf",n.ybuf,32),ks("output",i)):i=Ls(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(ws);case 2:throw new Error(xs)}}}}(Ec),xc={},Rc={exports:{}},kc=65536,Tc=4294967295;var Lc=kn.exports.Buffer,Ic=bt.crypto||bt.msCrypto;Ic&&Ic.getRandomValues?Rc.exports=function(t,e){if(t>Tc)throw new RangeError("requested too many random bytes");var r=Lc.allocUnsafe(t);if(t>0)if(t>kc)for(var n=0;n<t;n+=kc)Ic.getRandomValues(r.slice(n,n+kc));else Ic.getRandomValues(r);if("function"==typeof e)return Wt((function(){e(null,r)}));return r}:Rc.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},Object.defineProperty(xc,"__esModule",{value:!0});var Oc=Rc.exports;xc.getRandomBytes=function(t){return new Promise((function(e,r){Oc(t,(function(t,n){t?r(t):e(n)}))}))},xc.getRandomBytesSync=function(t){return Oc(t)},function(t){var e=bt&&bt.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},r=bt&&bt.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var n=Ac,i=xc;t.createPrivateKey=function(){return e(this,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,i.getRandomBytes(32)];case 1:return t=e.sent(),n.privateKeyVerify(t)?[2,t]:[3,0];case 2:return[2]}}))}))},t.createPrivateKeySync=function(){for(;;){var t=i.getRandomBytesSync(32);if(n.privateKeyVerify(t))return t}},function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(Ac)}(ps);var Bc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var e=yt,r=Ma;t.MAX_UINT64=new r.BN("ffffffffffffffff",16),t.MAX_INTEGER=new r.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new r.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=e.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=e.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=e.Buffer.from(t.KECCAK256_RLP_S,"hex")}(Bc);var Pc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var e,r=Ma,n=La,i=Ta;function o(t){return(0,i.unpadBuffer)(t.toArrayLike(L))}t.bnToHex=function(t){return"0x".concat(t.toString(16))},t.bnToUnpaddedBuffer=o,t.bnToRlp=function(t){return o(t)},function(t){t[t.Number=0]="Number",t[t.BN=1]="BN",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(e=t.TypeOutput||(t.TypeOutput={})),t.toType=function(t,o){if(null===t)return null;if(void 0!==t){if("string"==typeof t&&!(0,n.isHexString)(t))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(t));if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,i.toBuffer)(t);if(o===e.Buffer)return a;if(o===e.BN)return new r.BN(a);if(o===e.Number){var s=new r.BN(a),f=new r.BN(Number.MAX_SAFE_INTEGER.toString());if(s.gt(f))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return s.toNumber()}return"0x".concat(a.toString("hex"))}}}(Pc),function(t){var e=bt&&bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var n=e(ls),o=Ma,a=ps,s=La,f=Bc,h=Ta,u=It,d=Ba,l=Pc,p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.BN(0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new o.BN(0),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.KECCAK256_RLP,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f.KECCAK256_NULL;r(this,t),this.nonce=e,this.balance=n,this.stateRoot=i,this.codeHash=a,this._validate()}return i(t,[{key:"_validate",value:function(){if(this.nonce.lt(new o.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new o.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}},{key:"raw",value:function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]}},{key:"serialize",value:function(){return o.rlp.encode(this.raw())}},{key:"isContract",value:function(){return!this.codeHash.equals(f.KECCAK256_NULL)}},{key:"isEmpty",value:function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(f.KECCAK256_NULL)}}],[{key:"fromAccountData",value:function(e){var r=e.nonce,n=e.balance,i=e.stateRoot,a=e.codeHash;return new t(r?new o.BN((0,h.toBuffer)(r)):void 0,n?new o.BN((0,h.toBuffer)(n)):void 0,i?(0,h.toBuffer)(i):void 0,a?(0,h.toBuffer)(a):void 0)}},{key:"fromRlpSerializedAccount",value:function(t){var e=o.rlp.decode(t);if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)}},{key:"fromValuesArray",value:function(e){var r=c(e,4),n=r[0],i=r[1],a=r[2],s=r[3];return new t(new o.BN(n),new o.BN(i),a,s)}}]),t}();t.Account=p;t.isValidAddress=function(t){try{(0,d.assertIsString)(t)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)};t.toChecksumAddress=function(t,e){(0,d.assertIsHexString)(t);var r=(0,s.stripHexPrefix)(t).toLowerCase(),n="";e&&(n=(0,l.toType)(e,l.TypeOutput.BN).toString()+"0x");for(var i=(0,u.keccakFromString)(n+r).toString("hex"),o="0x",a=0;a<r.length;a++)parseInt(i[a],16)>=8?o+=r[a].toUpperCase():o+=r[a];return o};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(t,e){(0,d.assertIsBuffer)(t),(0,d.assertIsBuffer)(e);var r=new o.BN(e);return r.isZero()?(0,u.rlphash)([t,null]).slice(-20):(0,u.rlphash)([t,L.from(r.toArray())]).slice(-20)};t.generateAddress2=function(t,e,r){return(0,d.assertIsBuffer)(t),(0,d.assertIsBuffer)(e),(0,d.assertIsBuffer)(r),(0,n.default)(20===t.length),(0,n.default)(32===e.length),(0,u.keccak256)(L.concat([L.from("ff","hex"),t,e,(0,u.keccak256)(r)])).slice(-20)};t.isValidPrivate=function(t){return(0,a.privateKeyVerify)(t)};t.isValidPublic=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,d.assertIsBuffer)(t),64===t.length?(0,a.publicKeyVerify)(L.concat([L.from([4]),t])):!!e&&(0,a.publicKeyVerify)(t)};t.pubToAddress=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,d.assertIsBuffer)(t),e&&64!==t.length&&(t=L.from((0,a.publicKeyConvert)(t,!1).slice(1))),(0,n.default)(64===t.length),(0,u.keccak)(t).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(t){return(0,d.assertIsBuffer)(t),L.from((0,a.publicKeyCreate)(t,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(t){return(0,d.assertIsBuffer)(t),64!==t.length&&(t=L.from((0,a.publicKeyConvert)(t,!1).slice(1))),t};t.zeroAddress=function(){var t=(0,h.zeros)(20);return(0,h.bufferToHex)(t)};t.isZeroAddress=function(e){try{(0,d.assertIsString)(e)}catch(t){return!1}return(0,t.zeroAddress)()===e}}(Ca);var Cc={};Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.hashPersonalMessage=Cc.isValidSignature=Cc.fromRpcSig=Cc.toCompactSig=Cc.toRpcSig=Vc=Cc.ecrecover=Kc=Cc.ecsign=void 0;var Nc=ps,Dc=Ma,zc=Ta,jc=It,qc=Ba,Uc=Pc;var Kc=Cc.ecsign=function(t,e,r){var n=(0,Nc.ecdsaSign)(t,e),i=n.signature,o=n.recid,a=L.from(i.slice(0,32)),s=L.from(i.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:a,s:s,v:r?o+(2*r+35):o+27}}return{r:a,s:s,v:(0,Uc.toType)(r,Uc.TypeOutput.BN).muln(2).addn(35).addn(o).toArrayLike(L)}};function Fc(t,e){var r=(0,Uc.toType)(t,Uc.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,Uc.toType)(t,Uc.TypeOutput.BN);if(!e)return r.subn(27);var n=(0,Uc.toType)(e,Uc.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function Hc(t){var e=new Dc.BN(t);return e.eqn(0)||e.eqn(1)}var Vc=Cc.ecrecover=function(t,e,r,n,i){var o=L.concat([(0,zc.setLengthLeft)(r,32),(0,zc.setLengthLeft)(n,32)],64),a=Fc(e,i);if(!Hc(a))throw new Error("Invalid signature v value");var s=(0,Nc.ecdsaRecover)(o,a.toNumber(),t);return L.from((0,Nc.publicKeyConvert)(s,!1).slice(1))};Cc.toRpcSig=function(t,e,r,n){if(!Hc(Fc(t,n)))throw new Error("Invalid signature v value");return(0,zc.bufferToHex)(L.concat([(0,zc.setLengthLeft)(e,32),(0,zc.setLengthLeft)(r,32),(0,zc.toBuffer)(t)]))};Cc.toCompactSig=function(t,e,r,n){if(!Hc(Fc(t,n)))throw new Error("Invalid signature v value");var i=(0,Uc.toType)(t,Uc.TypeOutput.Number),o=r;return(i>28&&i%2==1||1===i||28===i)&&((o=L.from(r))[0]|=128),(0,zc.bufferToHex)(L.concat([(0,zc.setLengthLeft)(e,32),(0,zc.setLengthLeft)(o,32)]))};Cc.fromRpcSig=function(t){var e,r,n,i=(0,zc.toBuffer)(t);if(i.length>=65)e=i.slice(0,32),r=i.slice(32,64),n=(0,zc.bufferToInt)(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");e=i.slice(0,32),r=i.slice(32,64),n=(0,zc.bufferToInt)(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:e,s:r}};Cc.isValidSignature=function(t,e,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4?arguments[4]:void 0,o=new Dc.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new Dc.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!Hc(Fc(t,i)))return!1;var s=new Dc.BN(e),f=new Dc.BN(r);return!(s.isZero()||s.gt(a)||f.isZero()||f.gt(a))&&(!n||1!==f.cmp(o))};Cc.hashPersonalMessage=function(t){(0,qc.assertIsBuffer)(t);var e=L.from("Ethereum Signed Message:\n".concat(t.length),"utf-8");return(0,jc.keccak)(L.concat([e,t]))};var Wc=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+e(t)+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)},Yc=Wc,Zc=function(t){return"string"!=typeof t?t:Yc(t)?t.slice(2):t};function Jc(t){var r=t;if("string"!=typeof r)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+e(r)+", while padToEven.");return r.length%2&&(r="0"+r),r}function Xc(t){return"0x"+t.toString(16)}var Gc={arrayContainsArray:function(t,r,n){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+e(t)+"'");if(!0!==Array.isArray(r))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+e(r)+"'");return r[Boolean(n)?"some":"every"]((function(e){return t.indexOf(e)>=0}))},intToBuffer:function(t){return new L(Jc(Xc(t).slice(2)),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+e(t)+"'.");return L.byteLength(t,"utf8")},isHexPrefixed:Wc,stripHexPrefix:Zc,padToEven:Jc,intToHex:Xc,fromAscii:function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);e+=n.length<2?"0"+n:n}return"0x"+e},fromUtf8:function(t){return"0x"+Jc(new L(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e},toUtf8:function(t){return new L(Jc(Zc(t).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(t,r,n){if(!Array.isArray(t))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+e(t)+"'");if("string"!=typeof r)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+e(r)+"'.");for(var i=[],o=0;o<t.length;o++){var a=t[o][r];if(n&&!a)a="";else if("string"!=typeof a)throw new Error("invalid abi");i.push(a)}return i},isHexString:function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}};function $c(t){if("string"==typeof t&&Qc(t))return function(t){if("string"!=typeof t)throw new TypeError("Type error: string expected");if(!Qc(t))throw new Error("Not minter prefixed");return t=function(t){return t.replace(/^(Mx|Mp|Mt|Mc|Mh)/,"")}(t),L.from(t,"hex")}(t);if("string"==typeof t&&!Gc.isHexString(t,0))throw new Error("Cannot convert string to buffer. toBuffer only supports Minter-prefixed or 0x-prefixed hex strings. You can pass buffer instead of string.");return Ta.toBuffer(t)}function Qc(t){return/^(Mx|Mp|Mt|Mc|Mh)[0-9a-fA-F]*$/.test(t)}var td=1e6,ed=1e6,rd="[big.js] ",nd=rd+"Invalid ",id=nd+"decimal places",od=rd+"Division by zero",ad={},sd=void 0;function fd(t,e,r,n){var i=t.c;if(r===sd&&(r=t.constructor.RM),0!==r&&1!==r&&2!==r&&3!==r)throw Error("[big.js] Invalid rounding mode");if(e<1)n=3===r&&(n||!!i[0])||0===e&&(1===r&&i[0]>=5||2===r&&(i[0]>5||5===i[0]&&(n||i[1]!==sd))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=1===r&&i[e]>=5||2===r&&(i[e]>5||5===i[e]&&(n||i[e+1]!==sd||1&i[e-1]))||3===r&&(n||!!i[0]),i.length=e,n)for(;++i[--e]>9;)if(i[e]=0,0===e){++t.e,i.unshift(1);break}for(e=i.length;!i[--e];)i.pop()}return t}function hd(t,e,r){var n=t.e,i=t.c.join(""),o=i.length;if(e)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>o)for(n-=o;n--;)i+="0";else n<o&&(i=i.slice(0,n)+"."+i.slice(n));else o>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}ad.abs=function(){var t=new this.constructor(this);return t.s=1,t},ad.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,o=r.s,a=t.s,s=r.e,f=t.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-a:0;if(o!=a)return o;if(e=o<0,s!=f)return s>f^e?1:-1;for(a=(s=n.length)<(f=i.length)?s:f,o=-1;++o<a;)if(n[o]!=i[o])return n[o]>i[o]^e?1:-1;return s==f?0:s>f^e?1:-1},ad.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,o=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>td)throw Error(id);if(!i[0])throw Error(od);if(!n[0])return t.s=o,t.c=[t.e=0],t;var s,f,h,u,c,d=i.slice(),l=s=i.length,p=n.length,b=n.slice(0,s),m=b.length,g=t,v=g.c=[],y=0,w=a+(g.e=e.e-t.e)+1;for(g.s=o,o=w<0?0:w,d.unshift(0);m++<s;)b.push(0);do{for(h=0;h<10;h++){if(s!=(m=b.length))u=s>m?1:-1;else for(c=-1,u=0;++c<s;)if(i[c]!=b[c]){u=i[c]>b[c]?1:-1;break}if(!(u<0))break;for(f=m==s?i:d;m;){if(b[--m]<f[m]){for(c=m;c&&!b[--c];)b[c]=9;--b[c],b[m]+=10}b[m]-=f[m]}for(;!b[0];)b.shift()}v[y++]=u?h:++h,b[0]&&u?b[m]=n[l]||0:b=[n[l]]}while((l++<p||b[0]!==sd)&&o--);return v[0]||1==y||(v.shift(),g.e--,w--),y>w&&fd(g,w,r.RM,b[0]!==sd),g},ad.eq=function(t){return 0===this.cmp(t)},ad.gt=function(t){return this.cmp(t)>0},ad.gte=function(t){return this.cmp(t)>-1},ad.lt=function(t){return this.cmp(t)<0},ad.lte=function(t){return this.cmp(t)<1},ad.minus=ad.sub=function(t){var e,r,n,i,o=this,a=o.constructor,s=o.s,f=(t=new a(t)).s;if(s!=f)return t.s=-f,o.plus(t);var h=o.c.slice(),u=o.e,c=t.c,d=t.e;if(!h[0]||!c[0])return c[0]?t.s=-f:h[0]?t=new a(o):t.s=1,t;if(s=u-d){for((i=s<0)?(s=-s,n=h):(d=u,n=c),n.reverse(),f=s;f--;)n.push(0);n.reverse()}else for(r=((i=h.length<c.length)?h:c).length,s=f=0;f<r;f++)if(h[f]!=c[f]){i=h[f]<c[f];break}if(i&&(n=h,h=c,c=n,t.s=-t.s),(f=(r=c.length)-(e=h.length))>0)for(;f--;)h[e++]=0;for(f=e;r>s;){if(h[--r]<c[r]){for(e=r;e&&!h[--e];)h[e]=9;--h[e],h[r]+=10}h[r]-=c[r]}for(;0===h[--f];)h.pop();for(;0===h[0];)h.shift(),--d;return h[0]||(t.s=1,h=[d=0]),t.c=h,t.e=d,t},ad.mod=function(t){var e,r=this,n=r.constructor,i=r.s,o=(t=new n(t)).s;if(!t.c[0])throw Error(od);return r.s=t.s=1,e=1==t.cmp(r),r.s=i,t.s=o,e?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=o,this.minus(r.times(t)))},ad.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t},ad.plus=ad.add=function(t){var e,r,n,i=this,o=i.constructor;if(t=new o(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var a=i.e,s=i.c,f=t.e,h=t.c;if(!s[0]||!h[0])return h[0]||(s[0]?t=new o(i):t.s=i.s),t;if(s=s.slice(),e=a-f){for(e>0?(f=a,n=h):(e=-e,n=s),n.reverse();e--;)n.push(0);n.reverse()}for(s.length-h.length<0&&(n=h,h=s,s=n),e=h.length,r=0;e;s[e]%=10)r=(s[--e]=s[e]+h[e]+r)/10|0;for(r&&(s.unshift(r),++f),e=s.length;0===s[--e];)s.pop();return t.c=s,t.e=f,t},ad.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-1e6||t>ed)throw Error(nd+"exponent");for(i&&(t=-t);1&t&&(n=n.times(e)),t>>=1;)e=e.times(e);return i?r.div(n):n},ad.prec=function(t,e){if(t!==~~t||t<1||t>td)throw Error(nd+"precision");return fd(new this.constructor(this),t,e)},ad.round=function(t,e){if(t===sd)t=0;else if(t!==~~t||t<-td||t>td)throw Error(id);return fd(new this.constructor(this),t+this.e+1,e)},ad.sqrt=function(){var t,e,r,n=this,i=n.constructor,o=n.s,a=n.e,s=new i("0.5");if(!n.c[0])return new i(n);if(o<0)throw Error(rd+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((e=n.c.join("")).length+a&1||(e+="0"),a=((a+1)/2|0)-(a<0||1&a),t=new i(((o=Math.sqrt(e))==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+a)):t=new i(o+""),a=t.e+(i.DP+=4);do{r=t,t=s.times(r.plus(n.div(r)))}while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return fd(t,(i.DP-=4)+t.e+1,i.RM)},ad.times=ad.mul=function(t){var e,r=this,n=r.constructor,i=r.c,o=(t=new n(t)).c,a=i.length,s=o.length,f=r.e,h=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!o[0])return t.c=[t.e=0],t;for(t.e=f+h,a<s&&(e=i,i=o,o=e,h=a,a=s,s=h),e=new Array(h=a+s);h--;)e[h]=0;for(f=s;f--;){for(s=0,h=a+f;h>f;)s=e[h]+o[f]*i[h-f-1]+s,e[h--]=s%10,s=s/10|0;e[h]=s}for(s?++t.e:e.shift(),f=e.length;!e[--f];)e.pop();return t.c=e,t},ad.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==sd){if(t!==~~t||t<0||t>td)throw Error(id);for(r=fd(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return hd(r,!0,!!n)},ad.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==sd){if(t!==~~t||t<0||t>td)throw Error(id);for(t=t+(r=fd(new r.constructor(r),t+r.e+1,e)).e+1;r.c.length<t;)r.c.push(0)}return hd(r,!1,!!n)},ad[Symbol.for("nodejs.util.inspect.custom")]=ad.toJSON=ad.toString=function(){var t=this,e=t.constructor;return hd(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])},ad.toNumber=function(){var t=Number(hd(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(t.toString()))throw Error(rd+"Imprecise conversion");return t},ad.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==sd){if(t!==~~t||t<1||t>td)throw Error(nd+"precision");for(r=fd(new n(r),t,e);r.c.length<t;)r.c.push(0)}return hd(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)},ad.valueOf=function(){var t=this,e=t.constructor;if(!0===e.strict)throw Error(rd+"valueOf disallowed");return hd(t,t.e<=e.NE||t.e>=e.PE,!0)};var ud={SEND:"0x01",SELL:"0x02",SELL_ALL:"0x03",BUY:"0x04",CREATE_COIN:"0x05",DECLARE_CANDIDACY:"0x06",DELEGATE:"0x07",UNBOND:"0x08",REDEEM_CHECK:"0x09",SET_CANDIDATE_ON:"0x0A",SET_CANDIDATE_OFF:"0x0B",CREATE_MULTISIG:"0x0C",MULTISEND:"0x0D",EDIT_CANDIDATE:"0x0E",SET_HALT_BLOCK:"0x0F",RECREATE_COIN:"0x10",EDIT_TICKER_OWNER:"0x11",EDIT_MULTISIG:"0x12",PRICE_VOTE:"0x13",EDIT_CANDIDATE_PUBLIC_KEY:"0x14",ADD_LIQUIDITY:"0x15",REMOVE_LIQUIDITY:"0x16",SELL_SWAP_POOL:"0x17",BUY_SWAP_POOL:"0x18",SELL_ALL_SWAP_POOL:"0x19",EDIT_CANDIDATE_COMMISSION:"0x1A",MOVE_STAKE:"0x1B",MINT_TOKEN:"0x1C",BURN_TOKEN:"0x1D",CREATE_TOKEN:"0x1E",RECREATE_TOKEN:"0x1F",VOTE_COMMISSION:"0x20",VOTE_UPDATE:"0x21",CREATE_SWAP_POOL:"0x22",ADD_LIMIT_ORDER:"0x23",REMOVE_LIMIT_ORDER:"0x24",LOCK_STAKE:"0x25",LOCK:"0x26"},cd=o({},ud.PRICE_VOTE,!0),dd=Object.fromEntries(Object.entries(ud).map((function(t){var e=c(t,2),r=e[0];return[e[1],r]}))),ld=[];function pd(t,e){var r={};return r.key=dd[t].toLowerCase(),r.name=e||r.key.replace(/_/g," "),r.number=Number(t),r.hex=t,r.isDisabled=!!cd[t],ld[r.number]=r,r}function bd(t){if(!t)throw new Error("Invalid tx type: ".concat(t));if(t.length>0&&"string"!=typeof t&&(t=L.from(t).toString("hex"),t="0x".concat(t)),"string"==typeof t&&0!==t.indexOf("0x")&&0!==t.indexOf("0X")&&(t=Number.parseInt(t,10)),"number"==typeof t&&(t=Gc.padToEven(t.toString(16)),t="0x".concat(t)),t=(t=t.toUpperCase()).replace(/^0X/,"0x"),!Object.values(ud).includes(t))throw new Error("Invalid tx type");return t}function md(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t.raw=[],t._fields=[],t.toJSON=function(e){if(e){var r={};return t._fields.forEach((function(e){r[e]="0x".concat(t[e].toString("hex"))})),r}return Ta.baToJSON(this.raw)},t.serialize=function(){return St(t.raw)},t.serializeToString=function(){return"0x".concat(t.serialize().toString("hex"))},r.forEach((function(e,r){function n(){return t.raw[r]}function o(n){if(void 0===e.isNonBinaryArray&&e.allowNonBinaryArray&&(e.isNonBinaryArray=e.allowNonBinaryArray,console.warn("allowNonBinaryArray is deprecated, use isNonBinaryArray instead")),e.isNonBinaryArray){if(void 0===n&&(n=[]),!Array.isArray(n))throw new TypeError("Invalid value for isNonBinaryArray field");n=(n=e.nonBinaryArrayTransform&&"function"==typeof e.nonBinaryArrayTransform?n.map((function(t){return e.nonBinaryArrayTransform(t)})):n.map((function(t){return $c(t)}))).map((function(t){return"00"===t.toString("hex")?L.from([]):t}))}else void 0===n&&i.forceDefaultValues&&!e.allowLess&&e.length>0?n=L.alloc(e.length,0):e.storeNullAsArray&&(!n&&0!==n||Array.isArray(n)&&0===n.length)?n=[]:("00"!==(n=$c(n)).toString("hex")||e.allowZero||(n=L.from([])),e.allowLess&&e.length>0?(n=Ta.unpadBuffer(n),Ha(e.length>=n.length,"The field ".concat(e.name," must not have more ").concat(e.length," bytes"))):(!e.allowZero||0!==n.length)&&e.length>0&&Ha(e.length===n.length,"The field ".concat(e.name," must have byte length of ").concat(e.length)));t.raw[r]=n}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:n,set:o}),e.default?t[e.name]=e.default:i.forceDefaultValues&&(t[e.name]=void 0),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:o,get:n})})),n)if("string"==typeof n&&(n=L.from(Gc.stripHexPrefix(n),"hex")),lt(n)&&(n=xt(n)),Array.isArray(n)){if(n.length>t._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(e,r){t[t._fields[r]]=e}))}else{if("object"!==e(n))throw new TypeError("invalid data");var o=Object.keys(n);r.forEach((function(e){-1!==o.indexOf(e.name)&&(t[e.name]=n[e.name]),-1!==o.indexOf(e.alias)&&(t[e.alias]=n[e.alias])}))}return t}pd(ud.SEND),pd(ud.SELL),pd(ud.SELL_ALL),pd(ud.BUY),pd(ud.CREATE_COIN),pd(ud.DECLARE_CANDIDACY),pd(ud.DELEGATE),pd(ud.UNBOND),pd(ud.REDEEM_CHECK),pd(ud.SET_CANDIDATE_ON),pd(ud.SET_CANDIDATE_OFF),pd(ud.CREATE_MULTISIG),pd(ud.MULTISEND),pd(ud.EDIT_CANDIDATE),pd(ud.SET_HALT_BLOCK,"vote for halt block"),pd(ud.RECREATE_COIN),pd(ud.EDIT_TICKER_OWNER),pd(ud.EDIT_MULTISIG),pd(ud.PRICE_VOTE,"vote for price"),pd(ud.EDIT_CANDIDATE_PUBLIC_KEY),pd(ud.ADD_LIQUIDITY,"add liquidity to pool"),pd(ud.REMOVE_LIQUIDITY,"remove liquidity from pool"),pd(ud.SELL_SWAP_POOL,"sell within pool"),pd(ud.BUY_SWAP_POOL,"buy within pool"),pd(ud.SELL_ALL_SWAP_POOL,"sell all within pool"),pd(ud.EDIT_CANDIDATE_COMMISSION),pd(ud.MOVE_STAKE),pd(ud.MINT_TOKEN),pd(ud.BURN_TOKEN),pd(ud.CREATE_TOKEN),pd(ud.RECREATE_TOKEN),pd(ud.VOTE_COMMISSION,"vote for commission price"),pd(ud.VOTE_UPDATE,"vote for network update"),pd(ud.CREATE_SWAP_POOL),pd(ud.ADD_LIMIT_ORDER),pd(ud.REMOVE_LIMIT_ORDER),pd(ud.LOCK_STAKE),pd(ud.LOCK);var gd,vd=new wt("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),yd=function(){function t(e){r(this,t),e=e||{},md(this,[{name:"nonce",length:32,allowLess:!0},{name:"chainId",length:1},{name:"gasPrice",length:32,allowLess:!0},{name:"gasCoin",length:4,allowLess:!0},{name:"type",length:1},{name:"data",alias:"input"},{name:"payload",allowZero:!0,default:L.from([])},{name:"serviceData",allowZero:!0,default:L.from([])},{name:"signatureType",length:1,allowLess:!0,default:L.from([])},{name:"signatureData",default:L.from([])}],e),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)})}return i(t,[{key:"hash",value:function(t){var e;return void 0===t&&(t=!0),e=t?this.raw:this.raw.slice(0,-1),It.rlphash(e)}},{key:"isSignatureTypeSingle",value:function(){return 1===Ta.bufferToInt(this.signatureType)}},{key:"isSignatureTypeMulti",value:function(){return 2===Ta.bufferToInt(this.signatureType)}},{key:"getSenderAddress",value:function(){if(this._from)return this._from;if(this.isSignatureTypeMulti()){var t=xt(this.signatureData);return this._from=t[0],this._from}var e=this.getSenderPublicKey();return this._from=Ca.publicToAddress(e),this._from}},{key:"getSenderAddressString",value:function(){return"Mx".concat(this.getSenderAddress().toString("hex"))}},{key:"getSenderPublicKey",value:function(){if(!(this._senderPublicKey&&this._senderPublicKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPublicKey}},{key:"verifySignature",value:function(){var t=this;if(this.isSignatureTypeSingle()){var e=xt(this.signatureData),r=this.hash(!1);return this._verifySignature(r,e)}var n=xt(this.signatureData),i=this.hash(!1);return!n[1].some((function(e){return!t._verifySignature(i,e)}))}},{key:"_verifySignature",value:function(t,e){if(1===new wt(e[2]).cmp(vd))return!1;try{var r=Ta.bufferToInt(e[0]),n=Vc(t,r,e[1],e[2]);return this.isSignatureTypeSingle()&&(this._senderPublicKey=n),!!n}catch(t){return!1}}},{key:"validate",value:function(t){var e=[];return this.verifySignature()||e.push("Invalid Signature"),void 0===t||!1===t?0===e.length:e.join(" ")}}]),t}(),wd=function(){function t(e){r(this,t),e=e||{},md(this,[{name:"v",default:L.from([28])},{name:"r",length:32,allowLess:!0},{name:"s",length:32,allowLess:!0}],e)}return i(t,[{key:"sign",value:function(t,e){var r=Kc(t,e);return Object.assign(this,r),this}}]),t}(),_d=i((function t(e){r(this,t),md(this,[{name:"multisig",length:20},{name:"signatures",isNonBinaryArray:!0,nonBinaryArrayTransform:function(t){return new wd(t).raw}}],e=e||{})})),Md=i((function t(e,n){r(this,t);md(this,[{name:"coin",length:4,allowLess:!0},{name:"to",length:20},{name:"value",length:32,allowLess:!0}],e,n)})),Sd=i((function t(e,n){r(this,t),md(this,[{name:"list",isNonBinaryArray:!0,nonBinaryArrayTransform:function(t){return new Md(t).raw}}],e,n)})),Ed=i((function t(e,n){r(this,t);md(this,[{name:"coinToSell",length:4,allowLess:!0},{name:"valueToSell",length:32,allowLess:!0},{name:"coinToBuy",length:4,allowLess:!0},{name:"minimumValueToBuy",length:32,allowLess:!0}],e,n)})),Ad=i((function t(e,n){r(this,t);md(this,[{name:"coinToBuy",length:4,allowLess:!0},{name:"valueToBuy",length:32,allowLess:!0},{name:"coinToSell",length:4,allowLess:!0},{name:"maximumValueToSell",length:32,allowLess:!0}],e,n)})),xd=i((function t(e,n){r(this,t);md(this,[{name:"coinToSell",length:4,allowLess:!0},{name:"coinToBuy",length:4,allowLess:!0},{name:"minimumValueToBuy",length:32,allowLess:!0}],e,n)})),Rd=i((function t(e,n){r(this,t),md(this,[{name:"name",default:L.from([])},{name:"symbol",length:10},{name:"initialAmount",length:32,allowLess:!0},{name:"initialReserve",length:32,allowLess:!0},{name:"constantReserveRatio",length:1,allowLess:!0},{name:"maxSupply",length:32,allowLess:!0}],e,n)})),kd=i((function t(e,n){r(this,t);md(this,[{name:"symbol",length:10},{name:"newOwner",length:20}],e,n)})),Td=i((function t(e,n){r(this,t),md(this,[{name:"name",default:L.from([])},{name:"symbol",length:10},{name:"initialAmount",length:32,allowLess:!0},{name:"maxSupply",length:32,allowLess:!0},{name:"mintable",length:1,allowLess:!0},{name:"burnable",length:1,allowLess:!0}],e,n)})),Ld=i((function t(e,n){r(this,t);md(this,[{name:"coin",length:4,allowLess:!0},{name:"value",length:32,allowLess:!0}],e,n)})),Id=i((function t(e,n){r(this,t);md(this,[{name:"address",length:20},{name:"publicKey",length:32},{name:"commission",length:1,allowLess:!0},{name:"coin",length:4,allowLess:!0},{name:"stake",length:32,allowLess:!0,default:0}],e,n)})),Od=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"rewardAddress",length:20},{name:"ownerAddress",length:20},{name:"controlAddress",length:20}],e,n)})),Bd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"newPublicKey",length:32}],e,n)})),Pd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"commission",length:1,allowLess:!0}],e,n)})),Cd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"height",length:32,allowLess:!0}],e,n)})),Nd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32}],e,n)})),Dd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"coin",length:4,allowLess:!0},{name:"stake",length:32,allowLess:!0}],e,n)})),zd=i((function t(e,n){r(this,t);md(this,[{name:"from",length:32},{name:"to",length:32},{name:"coin",length:4,allowLess:!0},{name:"stake",length:32,allowLess:!0}],e,n)})),jd=i((function t(e,n){r(this,t);md(this,[{name:"check"},{name:"proof",allowZero:!0,length:65}],e,n)})),qd=i((function t(e,n){r(this,t);md(this,[{name:"threshold"},{name:"weights",isNonBinaryArray:!0},{name:"addresses",isNonBinaryArray:!0}],e,n)})),Ud=i((function t(e,n){r(this,t);md(this,[{name:"price",length:32,allowLess:!0}],e,n)})),Kd=i((function t(e,n){r(this,t);md(this,[{name:"publicKey",length:32},{name:"height",length:32,allowLess:!0},{name:"coin",length:4,allowLess:!0},{name:"payloadByte",length:32,allowLess:!0},{name:"send",length:32,allowLess:!0},{name:"buyBancor",length:32,allowLess:!0},{name:"sellBancor",length:32,allowLess:!0},{name:"sellAllBancor",length:32,allowLess:!0},{name:"buyPoolBase",length:32,allowLess:!0},{name:"buyPoolDelta",length:32,allowLess:!0},{name:"sellPoolBase",length:32,allowLess:!0},{name:"sellPoolDelta",length:32,allowLess:!0},{name:"sellAllPoolBase",length:32,allowLess:!0},{name:"sellAllPoolDelta",length:32,allowLess:!0},{name:"createTicker3",length:32,allowLess:!0},{name:"createTicker4",length:32,allowLess:!0},{name:"createTicker5",length:32,allowLess:!0},{name:"createTicker6",length:32,allowLess:!0},{name:"createTicker7to10",length:32,allowLess:!0},{name:"createCoin",length:32,allowLess:!0},{name:"createToken",length:32,allowLess:!0},{name:"recreateCoin",length:32,allowLess:!0},{name:"recreateToken",length:32,allowLess:!0},{name:"declareCandidacy",length:32,allowLess:!0},{name:"delegate",length:32,allowLess:!0},{name:"unbond",length:32,allowLess:!0},{name:"redeemCheck",length:32,allowLess:!0},{name:"setCandidateOn",length:32,allowLess:!0},{name:"setCandidateOff",length:32,allowLess:!0},{name:"createMultisig",length:32,allowLess:!0},{name:"multisendBase",length:32,allowLess:!0},{name:"multisendDelta",length:32,allowLess:!0},{name:"editCandidate",length:32,allowLess:!0},{name:"setHaltBlock",length:32,allowLess:!0},{name:"editTickerOwner",length:32,allowLess:!0},{name:"editMultisig",length:32,allowLess:!0},{name:"editCandidatePublicKey",length:32,allowLess:!0},{name:"createSwapPool",length:32,allowLess:!0},{name:"addLiquidity",length:32,allowLess:!0},{name:"removeLiquidity",length:32,allowLess:!0},{name:"editCandidateCommission",length:32,allowLess:!0},{name:"mintToken",length:32,allowLess:!0},{name:"burnToken",length:32,allowLess:!0},{name:"voteCommission",length:32,allowLess:!0},{name:"voteUpdate",length:32,allowLess:!0},{name:"failedTx",length:32,allowLess:!0},{name:"addLimitOrder",length:32,allowLess:!0},{name:"removeLimitOrder",length:32,allowLess:!0},{name:"moveStake",length:32,allowLess:!0},{name:"lockStake",length:32,allowLess:!0},{name:"lock",length:32,allowLess:!0}],e,n)})),Fd=i((function t(e,n){r(this,t);md(this,[{name:"version"},{name:"publicKey",length:32},{name:"height",length:32,allowLess:!0}],e,n)})),Hd=i((function t(e,n){r(this,t);md(this,[{name:"coin0",length:4,allowLess:!0},{name:"coin1",length:4,allowLess:!0},{name:"volume0",length:32,allowLess:!0},{name:"volume1",length:32,allowLess:!0}],e,n)})),Vd=i((function t(e,n){r(this,t);md(this,[{name:"coin0",length:4,allowLess:!0},{name:"coin1",length:4,allowLess:!0},{name:"volume0",length:32,allowLess:!0},{name:"maximumVolume1",length:32,allowLess:!0}],e,n)})),Wd=i((function t(e,n){r(this,t);md(this,[{name:"coin0",length:4,allowLess:!0},{name:"coin1",length:4,allowLess:!0},{name:"liquidity",length:32,allowLess:!0},{name:"minimumVolume0",length:32,allowLess:!0},{name:"minimumVolume1",length:32,allowLess:!0}],e,n)})),Yd=i((function t(e,n){r(this,t);md(this,[{name:"coins",isNonBinaryArray:!0},{name:"valueToBuy",length:32,allowLess:!0},{name:"maximumValueToSell",length:32,allowLess:!0}],e,n)})),Zd=i((function t(e,n){r(this,t);md(this,[{name:"coins",isNonBinaryArray:!0},{name:"valueToSell",length:32,allowLess:!0},{name:"minimumValueToBuy",length:32,allowLess:!0}],e,n)})),Jd=i((function t(e,n){r(this,t);md(this,[{name:"coins",isNonBinaryArray:!0},{name:"minimumValueToBuy",length:32,allowLess:!0}],e,n)})),Xd=i((function t(e,n){r(this,t);md(this,[{name:"coinToSell",length:4,allowLess:!0},{name:"valueToSell",length:32,allowLess:!0},{name:"coinToBuy",length:4,allowLess:!0},{name:"valueToBuy",length:32,allowLess:!0}],e,n)})),Gd=i((function t(e,n){r(this,t);md(this,[{name:"id",length:32,allowLess:!0}],e,n)})),$d=i((function t(e,n){r(this,t);md(this,[],e,n)})),Qd=i((function t(e,n){r(this,t);md(this,[{name:"dueBlock",length:32,allowLess:!0},{name:"coin",length:4,allowLess:!0},{name:"value",length:32,allowLess:!0}],e,n)})),tl=(o(gd={},ud.SEND,Md),o(gd,ud.MULTISEND,Sd),o(gd,ud.SELL,Ed),o(gd,ud.BUY,Ad),o(gd,ud.SELL_ALL,xd),o(gd,ud.CREATE_COIN,Rd),o(gd,ud.DECLARE_CANDIDACY,Id),o(gd,ud.EDIT_CANDIDATE,Od),o(gd,ud.SET_CANDIDATE_ON,Nd),o(gd,ud.SET_CANDIDATE_OFF,Nd),o(gd,ud.DELEGATE,Dd),o(gd,ud.UNBOND,Dd),o(gd,ud.REDEEM_CHECK,jd),o(gd,ud.CREATE_MULTISIG,qd),o(gd,ud.SET_HALT_BLOCK,Cd),o(gd,ud.RECREATE_COIN,Rd),o(gd,ud.EDIT_TICKER_OWNER,kd),o(gd,ud.EDIT_MULTISIG,qd),o(gd,ud.PRICE_VOTE,Ud),o(gd,ud.EDIT_CANDIDATE_PUBLIC_KEY,Bd),o(gd,ud.ADD_LIQUIDITY,Vd),o(gd,ud.REMOVE_LIQUIDITY,Wd),o(gd,ud.BUY_SWAP_POOL,Yd),o(gd,ud.SELL_SWAP_POOL,Zd),o(gd,ud.SELL_ALL_SWAP_POOL,Jd),o(gd,ud.EDIT_CANDIDATE_COMMISSION,Pd),o(gd,ud.MOVE_STAKE,zd),o(gd,ud.MINT_TOKEN,Ld),o(gd,ud.BURN_TOKEN,Ld),o(gd,ud.CREATE_TOKEN,Td),o(gd,ud.RECREATE_TOKEN,Td),o(gd,ud.VOTE_COMMISSION,Kd),o(gd,ud.VOTE_UPDATE,Fd),o(gd,ud.CREATE_SWAP_POOL,Hd),o(gd,ud.ADD_LIMIT_ORDER,Xd),o(gd,ud.REMOVE_LIMIT_ORDER,Gd),o(gd,ud.LOCK_STAKE,$d),o(gd,ud.LOCK,Qd),gd);var el=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=L.alloc(10);return L.from(t.toUpperCase()).copy(e,0,0,10),e},rl=function(t){for(var e=t.length;0===t[e-1];)e-=1;return(t=t.slice(0,e)).toString("utf8")},nl=ud,il=ld,ol=bd;t.TX_TYPE=nl,t.Tx=yd,t.TxData=function(t,e,r){return e=bd(e),new(0,tl[e])(t,r)},t.TxDataAddLimitOrder=Xd,t.TxDataAddLiquidity=Vd,t.TxDataBurnToken=Ld,t.TxDataBuy=Ad,t.TxDataBuySwapPool=Yd,t.TxDataCreateCoin=Rd,t.TxDataCreateMultisig=qd,t.TxDataCreateSwapPool=Hd,t.TxDataCreateToken=Td,t.TxDataDeclareCandidacy=Id,t.TxDataDelegate=Dd,t.TxDataEditCandidate=Od,t.TxDataEditCandidateCommission=Pd,t.TxDataEditCandidatePublicKey=Bd,t.TxDataEditMultisig=qd,t.TxDataEditTickerOwner=kd,t.TxDataLock=Qd,t.TxDataLockStake=$d,t.TxDataMintToken=Ld,t.TxDataMoveStake=zd,t.TxDataMultisend=Sd,t.TxDataPriceVote=Ud,t.TxDataRecreateCoin=Rd,t.TxDataRecreateToken=Td,t.TxDataRedeemCheck=jd,t.TxDataRemoveLimitOrder=Gd,t.TxDataRemoveLiquidity=Wd,t.TxDataSell=Ed,t.TxDataSellAll=xd,t.TxDataSellAllSwapPool=Jd,t.TxDataSellSwapPool=Zd,t.TxDataSend=Md,t.TxDataSetCandidateOff=Nd,t.TxDataSetCandidateOn=Nd,t.TxDataSetHaltBlock=Cd,t.TxDataUnbond=Dd,t.TxDataVoteCommission=Kd,t.TxDataVoteUpdate=Fd,t.TxMultisignature=_d,t.TxSignature=wd,t.bufferToCoin=rl,t.coinToBuffer=el,t.default=yd,t.defineProperties=md,t.normalizeTxType=ol,t.txTypeList=il,Object.defineProperty(t,"__esModule",{value:!0})}));