OpChan/dist/assets/index-CqL7mnh0.js
2025-09-11 14:29:55 +05:30

3 lines
210 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{aR as Xf,aS as Kr,aO as af,ai as Qf}from"./index-Cr5N_0pd.js";import{s as ut,r as jf,i as ct,a as ei,b as ti}from"./index-COonna6N.js";function ri(f,t){for(var n=0;n<t.length;n++){const h=t[n];if(typeof h!="string"&&!Array.isArray(h)){for(const d in h)if(d!=="default"&&!(d in f)){const a=Object.getOwnPropertyDescriptor(h,d);a&&Object.defineProperty(f,d,a.get?a:{enumerable:!0,get:()=>h[d]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}var y0=ut.Buffer,fi=9007199254740991;function S0(f){if(f<0||f>fi||f%1!==0)throw new RangeError("value out of range")}function Nr(f,t,n){if(S0(f),t||(t=y0.allocUnsafe(nf(f))),!y0.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");return n||(n=0),f<253?(t.writeUInt8(f,n),Nr.bytes=1):f<=65535?(t.writeUInt8(253,n),t.writeUInt16LE(f,n+1),Nr.bytes=3):f<=4294967295?(t.writeUInt8(254,n),t.writeUInt32LE(f,n+1),Nr.bytes=5):(t.writeUInt8(255,n),t.writeUInt32LE(f>>>0,n+1),t.writeUInt32LE(f/4294967296|0,n+5),Nr.bytes=9),t}function Tr(f,t){if(!y0.isBuffer(f))throw new TypeError("buffer must be a Buffer instance");t||(t=0);var n=f.readUInt8(t);if(n<253)return Tr.bytes=1,n;if(n===253)return Tr.bytes=3,f.readUInt16LE(t+1);if(n===254)return Tr.bytes=5,f.readUInt32LE(t+1);Tr.bytes=9;var h=f.readUInt32LE(t+1),d=f.readUInt32LE(t+5),a=d*4294967296+h;return S0(a),a}function nf(f){return S0(f),f<253?1:f<=65535?3:f<=4294967295?5:9}var ii={encode:Nr,decode:Tr,encodingLength:nf},kr=ut.Buffer,hf=jf.Transform,ai=ct;function ni(f,t){if(!kr.isBuffer(f)&&typeof f!="string")throw new TypeError(t+" must be a string or a buffer")}function gt(f){hf.call(this),this._block=kr.allocUnsafe(f),this._blockSize=f,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}ai(gt,hf);gt.prototype._transform=function(f,t,n){var h=null;try{this.update(f,t)}catch(d){h=d}n(h)};gt.prototype._flush=function(f){var t=null;try{this.push(this.digest())}catch(n){t=n}f(t)};gt.prototype.update=function(f,t){if(ni(f,"Data"),this._finalized)throw new Error("Digest already called");kr.isBuffer(f)||(f=kr.from(f,t));for(var n=this._block,h=0;this._blockOffset+f.length-h>=this._blockSize;){for(var d=this._blockOffset;d<this._blockSize;)n[d++]=f[h++];this._update(),this._blockOffset=0}for(;h<f.length;)n[this._blockOffset++]=f[h++];for(var a=0,m=f.length*8;m>0;++a)this._length[a]+=m,m=this._length[a]/4294967296|0,m>0&&(this._length[a]-=4294967296*m);return this};gt.prototype._update=function(){throw new Error("_update is not implemented")};gt.prototype.digest=function(f){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();f!==void 0&&(t=t.toString(f)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t};gt.prototype._digest=function(){throw new Error("_digest is not implemented")};var sf=gt,hi=ct,df=sf,si=ut.Buffer,di=new Array(16);function Hr(){df.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}hi(Hr,df);Hr.prototype._update=function(){for(var f=di,t=0;t<16;++t)f[t]=this._block.readInt32LE(t*4);var n=this._a,h=this._b,d=this._c,a=this._d;n=ze(n,h,d,a,f[0],3614090360,7),a=ze(a,n,h,d,f[1],3905402710,12),d=ze(d,a,n,h,f[2],606105819,17),h=ze(h,d,a,n,f[3],3250441966,22),n=ze(n,h,d,a,f[4],4118548399,7),a=ze(a,n,h,d,f[5],1200080426,12),d=ze(d,a,n,h,f[6],2821735955,17),h=ze(h,d,a,n,f[7],4249261313,22),n=ze(n,h,d,a,f[8],1770035416,7),a=ze(a,n,h,d,f[9],2336552879,12),d=ze(d,a,n,h,f[10],4294925233,17),h=ze(h,d,a,n,f[11],2304563134,22),n=ze(n,h,d,a,f[12],1804603682,7),a=ze(a,n,h,d,f[13],4254626195,12),d=ze(d,a,n,h,f[14],2792965006,17),h=ze(h,d,a,n,f[15],1236535329,22),n=qe(n,h,d,a,f[1],4129170786,5),a=qe(a,n,h,d,f[6],3225465664,9),d=qe(d,a,n,h,f[11],643717713,14),h=qe(h,d,a,n,f[0],3921069994,20),n=qe(n,h,d,a,f[5],3593408605,5),a=qe(a,n,h,d,f[10],38016083,9),d=qe(d,a,n,h,f[15],3634488961,14),h=qe(h,d,a,n,f[4],3889429448,20),n=qe(n,h,d,a,f[9],568446438,5),a=qe(a,n,h,d,f[14],3275163606,9),d=qe(d,a,n,h,f[3],4107603335,14),h=qe(h,d,a,n,f[8],1163531501,20),n=qe(n,h,d,a,f[13],2850285829,5),a=qe(a,n,h,d,f[2],4243563512,9),d=qe(d,a,n,h,f[7],1735328473,14),h=qe(h,d,a,n,f[12],2368359562,20),n=Ve(n,h,d,a,f[5],4294588738,4),a=Ve(a,n,h,d,f[8],2272392833,11),d=Ve(d,a,n,h,f[11],1839030562,16),h=Ve(h,d,a,n,f[14],4259657740,23),n=Ve(n,h,d,a,f[1],2763975236,4),a=Ve(a,n,h,d,f[4],1272893353,11),d=Ve(d,a,n,h,f[7],4139469664,16),h=Ve(h,d,a,n,f[10],3200236656,23),n=Ve(n,h,d,a,f[13],681279174,4),a=Ve(a,n,h,d,f[0],3936430074,11),d=Ve(d,a,n,h,f[3],3572445317,16),h=Ve(h,d,a,n,f[6],76029189,23),n=Ve(n,h,d,a,f[9],3654602809,4),a=Ve(a,n,h,d,f[12],3873151461,11),d=Ve(d,a,n,h,f[15],530742520,16),h=Ve(h,d,a,n,f[2],3299628645,23),n=Ye(n,h,d,a,f[0],4096336452,6),a=Ye(a,n,h,d,f[7],1126891415,10),d=Ye(d,a,n,h,f[14],2878612391,15),h=Ye(h,d,a,n,f[5],4237533241,21),n=Ye(n,h,d,a,f[12],1700485571,6),a=Ye(a,n,h,d,f[3],2399980690,10),d=Ye(d,a,n,h,f[10],4293915773,15),h=Ye(h,d,a,n,f[1],2240044497,21),n=Ye(n,h,d,a,f[8],1873313359,6),a=Ye(a,n,h,d,f[15],4264355552,10),d=Ye(d,a,n,h,f[6],2734768916,15),h=Ye(h,d,a,n,f[13],1309151649,21),n=Ye(n,h,d,a,f[4],4149444226,6),a=Ye(a,n,h,d,f[11],3174756917,10),d=Ye(d,a,n,h,f[2],718787259,15),h=Ye(h,d,a,n,f[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+h|0,this._c=this._c+d|0,this._d=this._d+a|0};Hr.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 f=si.allocUnsafe(16);return f.writeInt32LE(this._a,0),f.writeInt32LE(this._b,4),f.writeInt32LE(this._c,8),f.writeInt32LE(this._d,12),f};function Gr(f,t){return f<<t|f>>>32-t}function ze(f,t,n,h,d,a,m){return Gr(f+(t&n|~t&h)+d+a|0,m)+t|0}function qe(f,t,n,h,d,a,m){return Gr(f+(t&h|n&~h)+d+a|0,m)+t|0}function Ve(f,t,n,h,d,a,m){return Gr(f+(t^n^h)+d+a|0,m)+t|0}function Ye(f,t,n,h,d,a,m){return Gr(f+(n^(t|~h))+d+a|0,m)+t|0}var oi=Hr,d0=Xf.Buffer,ui=ct,of=sf,ci=new Array(16),wr=[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],Ar=[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],Er=[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],Ir=[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],Sr=[0,1518500249,1859775393,2400959708,2840853838],Lr=[1352829926,1548603684,1836072691,2053994217,0];function Zr(){of.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}ui(Zr,of);Zr.prototype._update=function(){for(var f=ci,t=0;t<16;++t)f[t]=this._block.readInt32LE(t*4);for(var n=this._a|0,h=this._b|0,d=this._c|0,a=this._d|0,m=this._e|0,x=this._a|0,_=this._b|0,A=this._c|0,y=this._d|0,g=this._e|0,M=0;M<80;M+=1){var w,E;M<16?(w=V0(n,h,d,a,m,f[wr[M]],Sr[0],Er[M]),E=U0(x,_,A,y,g,f[Ar[M]],Lr[0],Ir[M])):M<32?(w=Y0(n,h,d,a,m,f[wr[M]],Sr[1],Er[M]),E=$0(x,_,A,y,g,f[Ar[M]],Lr[1],Ir[M])):M<48?(w=k0(n,h,d,a,m,f[wr[M]],Sr[2],Er[M]),E=k0(x,_,A,y,g,f[Ar[M]],Lr[2],Ir[M])):M<64?(w=$0(n,h,d,a,m,f[wr[M]],Sr[3],Er[M]),E=Y0(x,_,A,y,g,f[Ar[M]],Lr[3],Ir[M])):(w=U0(n,h,d,a,m,f[wr[M]],Sr[4],Er[M]),E=V0(x,_,A,y,g,f[Ar[M]],Lr[4],Ir[M])),n=m,m=a,a=Ot(d,10),d=h,h=w,x=g,g=y,y=Ot(A,10),A=_,_=E}var P=this._b+d+y|0;this._b=this._c+a+g|0,this._c=this._d+m+x|0,this._d=this._e+n+_|0,this._e=this._a+h+A|0,this._a=P};Zr.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 f=d0.alloc?d0.alloc(20):new d0(20);return f.writeInt32LE(this._a,0),f.writeInt32LE(this._b,4),f.writeInt32LE(this._c,8),f.writeInt32LE(this._d,12),f.writeInt32LE(this._e,16),f};function Ot(f,t){return f<<t|f>>>32-t}function V0(f,t,n,h,d,a,m,x){return Ot(f+(t^n^h)+a+m|0,x)+d|0}function Y0(f,t,n,h,d,a,m,x){return Ot(f+(t&n|~t&h)+a+m|0,x)+d|0}function k0(f,t,n,h,d,a,m,x){return Ot(f+((t|~n)^h)+a+m|0,x)+d|0}function $0(f,t,n,h,d,a,m,x){return Ot(f+(t&h|n&~h)+a+m|0,x)+d|0}function U0(f,t,n,h,d,a,m,x){return Ot(f+(t^(n|~h))+a+m|0,x)+d|0}var li=Zr,je=ut.Buffer,uf=Kr.Transform,vi=ei.StringDecoder,bi=ct;function Xe(f){uf.call(this),this.hashMode=typeof f=="string",this.hashMode?this[f]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}bi(Xe,uf);var pi=typeof Uint8Array<"u",xi=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(je.prototype instanceof Uint8Array||je.TYPED_ARRAY_SUPPORT);function mi(f,t){if(f instanceof je)return f;if(typeof f=="string")return je.from(f,t);if(xi&&ArrayBuffer.isView(f)){if(f.byteLength===0)return je.alloc(0);var n=je.from(f.buffer,f.byteOffset,f.byteLength);if(n.byteLength===f.byteLength)return n}if(pi&&f instanceof Uint8Array||je.isBuffer(f)&&f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f))return je.from(f);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Xe.prototype.update=function(f,t,n){var h=mi(f,t),d=this._update(h);return this.hashMode?this:(n&&(d=this._toString(d,n)),d)};Xe.prototype.setAutoPadding=function(){};Xe.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Xe.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Xe.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Xe.prototype._transform=function(f,t,n){var h;try{this.hashMode?this._update(f):this.push(this._update(f))}catch(d){h=d}finally{n(h)}};Xe.prototype._flush=function(f){var t;try{this.push(this.__final())}catch(n){t=n}f(t)};Xe.prototype._finalOrDigest=function(f){var t=this.__final()||je.alloc(0);return f&&(t=this._toString(t,f,!0)),t};Xe.prototype._toString=function(f,t,n){if(this._decoder||(this._decoder=new vi(t),this._encoding=t),this._encoding!==t)throw new Error("cant switch encodings");var h=this._decoder.write(f);return n&&(h+=this._decoder.end()),h};var gi=Xe,_i=ct,yi=oi,Mi=li,wi=ti,cf=gi;function Wr(f){cf.call(this,"digest"),this._hash=f}_i(Wr,cf);Wr.prototype._update=function(f){this._hash.update(f)};Wr.prototype._final=function(){return this._hash.digest()};var L0=function(t){return t=t.toLowerCase(),t==="md5"?new yi:t==="rmd160"||t==="ripemd160"?new Mi:new Wr(wi(t))},lf={};const Ai="elliptic",Ei="6.6.1",Ii="EC cryptography",Si="lib/elliptic.js",Li=["lib"],Pi={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},Bi={type:"git",url:"git@github.com:indutny/elliptic"},Ri=["EC","Elliptic","curve","Cryptography"],Ni="Fedor Indutny <fedor@indutny.com>",Ti="MIT",Ci={url:"https://github.com/indutny/elliptic/issues"},Di="https://github.com/indutny/elliptic",zi={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},qi={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},Vi={name:Ai,version:Ei,description:Ii,main:Si,files:Li,scripts:Pi,repository:Bi,keywords:Ri,author:Ni,license:Ti,bugs:Ci,homepage:Di,devDependencies:zi,dependencies:qi};var Oe={},P0={exports:{}};P0.exports;(function(f){(function(t,n){function h(v,e){if(!v)throw new Error(e||"Assertion failed")}function d(v,e){v.super_=e;var i=function(){};i.prototype=e.prototype,v.prototype=new i,v.prototype.constructor=v}function a(v,e,i){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(i=e,e=10),this._init(v||0,e||10,i||"be"))}typeof t=="object"?t.exports=a:n.BN=a,a.BN=a,a.wordSize=26;var m;try{typeof window<"u"&&typeof window.Buffer<"u"?m=window.Buffer:m=Kr.Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,i){return e.cmp(i)>0?e:i},a.min=function(e,i){return e.cmp(i)<0?e:i},a.prototype._init=function(e,i,s){if(typeof e=="number")return this._initNumber(e,i,s);if(typeof e=="object")return this._initArray(e,i,s);i==="hex"&&(i=16),h(i===(i|0)&&i>=2&&i<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(i===16?this._parseHex(e,o,s):(this._parseBase(e,i,o),s==="le"&&this._initArray(this.toArray(),i,s)))},a.prototype._initNumber=function(e,i,s){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(h(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),s==="le"&&this._initArray(this.toArray(),i,s)},a.prototype._initArray=function(e,i,s){if(h(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var l,b,p=0;if(s==="be")for(o=e.length-1,l=0;o>=0;o-=3)b=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[l]|=b<<p&67108863,this.words[l+1]=b>>>26-p&67108863,p+=24,p>=26&&(p-=26,l++);else if(s==="le")for(o=0,l=0;o<e.length;o+=3)b=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[l]|=b<<p&67108863,this.words[l+1]=b>>>26-p&67108863,p+=24,p>=26&&(p-=26,l++);return this.strip()};function x(v,e){var i=v.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function _(v,e,i){var s=x(v,i);return i-1>=e&&(s|=x(v,i-1)<<4),s}a.prototype._parseHex=function(e,i,s){this.length=Math.ceil((e.length-i)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var l=0,b=0,p;if(s==="be")for(o=e.length-1;o>=i;o-=2)p=_(e,i,o)<<l,this.words[b]|=p&67108863,l>=18?(l-=18,b+=1,this.words[b]|=p>>>26):l+=8;else{var u=e.length-i;for(o=u%2===0?i+1:i;o<e.length;o+=2)p=_(e,i,o)<<l,this.words[b]|=p&67108863,l>=18?(l-=18,b+=1,this.words[b]|=p>>>26):l+=8}this.strip()};function A(v,e,i,s){for(var o=0,l=Math.min(v.length,i),b=e;b<l;b++){var p=v.charCodeAt(b)-48;o*=s,p>=49?o+=p-49+10:p>=17?o+=p-17+10:o+=p}return o}a.prototype._parseBase=function(e,i,s){this.words=[0],this.length=1;for(var o=0,l=1;l<=67108863;l*=i)o++;o--,l=l/i|0;for(var b=e.length-s,p=b%o,u=Math.min(b,b-p)+s,r=0,c=s;c<u;c+=o)r=A(e,c,c+o,i),this.imuln(l),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r);if(p!==0){var I=1;for(r=A(e,c,e.length,i),c=0;c<p;c++)I*=i;this.imuln(I),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var i=0;i<this.length;i++)e.words[i]=this.words[i];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","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"],g=[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],M=[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];a.prototype.toString=function(e,i){e=e||10,i=i|0||1;var s;if(e===16||e==="hex"){s="";for(var o=0,l=0,b=0;b<this.length;b++){var p=this.words[b],u=((p<<o|l)&16777215).toString(16);l=p>>>24-o&16777215,o+=2,o>=26&&(o-=26,b--),l!==0||b!==this.length-1?s=y[6-u.length]+u+s:s=u+s}for(l!==0&&(s=l.toString(16)+s);s.length%i!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}if(e===(e|0)&&e>=2&&e<=36){var r=g[e],c=M[e];s="";var I=this.clone();for(I.negative=0;!I.isZero();){var S=I.modn(c).toString(e);I=I.idivn(c),I.isZero()?s=S+s:s=y[r-S.length]+S+s}for(this.isZero()&&(s="0"+s);s.length%i!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}h(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&h(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,i){return h(typeof m<"u"),this.toArrayLike(m,e,i)},a.prototype.toArray=function(e,i){return this.toArrayLike(Array,e,i)},a.prototype.toArrayLike=function(e,i,s){var o=this.byteLength(),l=s||Math.max(1,o);h(o<=l,"byte array longer than desired length"),h(l>0,"Requested array length <= 0"),this.strip();var b=i==="le",p=new e(l),u,r,c=this.clone();if(b){for(r=0;!c.isZero();r++)u=c.andln(255),c.iushrn(8),p[r]=u;for(;r<l;r++)p[r]=0}else{for(r=0;r<l-o;r++)p[r]=0;for(r=0;!c.isZero();r++)u=c.andln(255),c.iushrn(8),p[l-r-1]=u}return p},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var i=e,s=0;return i>=4096&&(s+=13,i>>>=13),i>=64&&(s+=7,i>>>=7),i>=8&&(s+=4,i>>>=4),i>=2&&(s+=2,i>>>=2),s+i},a.prototype._zeroBits=function(e){if(e===0)return 26;var i=e,s=0;return i&8191||(s+=13,i>>>=13),i&127||(s+=7,i>>>=7),i&15||(s+=4,i>>>=4),i&3||(s+=2,i>>>=2),i&1||s++,s},a.prototype.bitLength=function(){var e=this.words[this.length-1],i=this._countBits(e);return(this.length-1)*26+i};function w(v){for(var e=new Array(v.bitLength()),i=0;i<e.length;i++){var s=i/26|0,o=i%26;e[i]=(v.words[s]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,i=0;i<this.length;i++){var s=this._zeroBits(this.words[i]);if(e+=s,s!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]|e.words[i];return this.strip()},a.prototype.ior=function(e){return h((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var i;this.length>e.length?i=e:i=this;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]&e.words[s];return this.length=i.length,this.strip()},a.prototype.iand=function(e){return h((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var i,s;this.length>e.length?(i=this,s=e):(i=e,s=this);for(var o=0;o<s.length;o++)this.words[o]=i.words[o]^s.words[o];if(this!==i)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=i.length,this.strip()},a.prototype.ixor=function(e){return h((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){h(typeof e=="number"&&e>=0);var i=Math.ceil(e/26)|0,s=e%26;this._expand(i),s>0&&i--;for(var o=0;o<i;o++)this.words[o]=~this.words[o]&67108863;return s>0&&(this.words[o]=~this.words[o]&67108863>>26-s),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,i){h(typeof e=="number"&&e>=0);var s=e/26|0,o=e%26;return this._expand(s+1),i?this.words[s]=this.words[s]|1<<o:this.words[s]=this.words[s]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var i;if(this.negative!==0&&e.negative===0)return this.negative=0,i=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,i=this.isub(e),e.negative=1,i._normSign();var s,o;this.length>e.length?(s=this,o=e):(s=e,o=this);for(var l=0,b=0;b<o.length;b++)i=(s.words[b]|0)+(o.words[b]|0)+l,this.words[b]=i&67108863,l=i>>>26;for(;l!==0&&b<s.length;b++)i=(s.words[b]|0)+l,this.words[b]=i&67108863,l=i>>>26;if(this.length=s.length,l!==0)this.words[this.length]=l,this.length++;else if(s!==this)for(;b<s.length;b++)this.words[b]=s.words[b];return this},a.prototype.add=function(e){var i;return e.negative!==0&&this.negative===0?(e.negative=0,i=this.sub(e),e.negative^=1,i):e.negative===0&&this.negative!==0?(this.negative=0,i=e.sub(this),this.negative=1,i):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var i=this.iadd(e);return e.negative=1,i._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var s=this.cmp(e);if(s===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,l;s>0?(o=this,l=e):(o=e,l=this);for(var b=0,p=0;p<l.length;p++)i=(o.words[p]|0)-(l.words[p]|0)+b,b=i>>26,this.words[p]=i&67108863;for(;b!==0&&p<o.length;p++)i=(o.words[p]|0)+b,b=i>>26,this.words[p]=i&67108863;if(b===0&&p<o.length&&o!==this)for(;p<o.length;p++)this.words[p]=o.words[p];return this.length=Math.max(this.length,p),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function E(v,e,i){i.negative=e.negative^v.negative;var s=v.length+e.length|0;i.length=s,s=s-1|0;var o=v.words[0]|0,l=e.words[0]|0,b=o*l,p=b&67108863,u=b/67108864|0;i.words[0]=p;for(var r=1;r<s;r++){for(var c=u>>>26,I=u&67108863,S=Math.min(r,e.length-1),L=Math.max(0,r-v.length+1);L<=S;L++){var B=r-L|0;o=v.words[B]|0,l=e.words[L]|0,b=o*l+I,c+=b/67108864|0,I=b&67108863}i.words[r]=I|0,u=c|0}return u!==0?i.words[r]=u|0:i.length--,i.strip()}var P=function(e,i,s){var o=e.words,l=i.words,b=s.words,p=0,u,r,c,I=o[0]|0,S=I&8191,L=I>>>13,B=o[1]|0,z=B&8191,V=B>>>13,Ce=o[2]|0,Y=Ce&8191,$=Ce>>>13,nr=o[3]|0,U=nr&8191,O=nr>>>13,hr=o[4]|0,F=hr&8191,K=hr>>>13,sr=o[5]|0,H=sr&8191,G=sr>>>13,dr=o[6]|0,Z=dr&8191,W=dr>>>13,or=o[7]|0,J=or&8191,X=or>>>13,ur=o[8]|0,Q=ur&8191,j=ur>>>13,cr=o[9]|0,ee=cr&8191,te=cr>>>13,lr=l[0]|0,re=lr&8191,fe=lr>>>13,vr=l[1]|0,ie=vr&8191,ae=vr>>>13,br=l[2]|0,ne=br&8191,he=br>>>13,pr=l[3]|0,se=pr&8191,de=pr>>>13,xr=l[4]|0,oe=xr&8191,ue=xr>>>13,mr=l[5]|0,ce=mr&8191,le=mr>>>13,gr=l[6]|0,ve=gr&8191,be=gr>>>13,_r=l[7]|0,pe=_r&8191,xe=_r>>>13,yr=l[8]|0,me=yr&8191,ge=yr>>>13,Mr=l[9]|0,_e=Mr&8191,ye=Mr>>>13;s.negative=e.negative^i.negative,s.length=19,u=Math.imul(S,re),r=Math.imul(S,fe),r=r+Math.imul(L,re)|0,c=Math.imul(L,fe);var yt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,u=Math.imul(z,re),r=Math.imul(z,fe),r=r+Math.imul(V,re)|0,c=Math.imul(V,fe),u=u+Math.imul(S,ie)|0,r=r+Math.imul(S,ae)|0,r=r+Math.imul(L,ie)|0,c=c+Math.imul(L,ae)|0;var Mt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,u=Math.imul(Y,re),r=Math.imul(Y,fe),r=r+Math.imul($,re)|0,c=Math.imul($,fe),u=u+Math.imul(z,ie)|0,r=r+Math.imul(z,ae)|0,r=r+Math.imul(V,ie)|0,c=c+Math.imul(V,ae)|0,u=u+Math.imul(S,ne)|0,r=r+Math.imul(S,he)|0,r=r+Math.imul(L,ne)|0,c=c+Math.imul(L,he)|0;var wt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,u=Math.imul(U,re),r=Math.imul(U,fe),r=r+Math.imul(O,re)|0,c=Math.imul(O,fe),u=u+Math.imul(Y,ie)|0,r=r+Math.imul(Y,ae)|0,r=r+Math.imul($,ie)|0,c=c+Math.imul($,ae)|0,u=u+Math.imul(z,ne)|0,r=r+Math.imul(z,he)|0,r=r+Math.imul(V,ne)|0,c=c+Math.imul(V,he)|0,u=u+Math.imul(S,se)|0,r=r+Math.imul(S,de)|0,r=r+Math.imul(L,se)|0,c=c+Math.imul(L,de)|0;var At=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(At>>>26)|0,At&=67108863,u=Math.imul(F,re),r=Math.imul(F,fe),r=r+Math.imul(K,re)|0,c=Math.imul(K,fe),u=u+Math.imul(U,ie)|0,r=r+Math.imul(U,ae)|0,r=r+Math.imul(O,ie)|0,c=c+Math.imul(O,ae)|0,u=u+Math.imul(Y,ne)|0,r=r+Math.imul(Y,he)|0,r=r+Math.imul($,ne)|0,c=c+Math.imul($,he)|0,u=u+Math.imul(z,se)|0,r=r+Math.imul(z,de)|0,r=r+Math.imul(V,se)|0,c=c+Math.imul(V,de)|0,u=u+Math.imul(S,oe)|0,r=r+Math.imul(S,ue)|0,r=r+Math.imul(L,oe)|0,c=c+Math.imul(L,ue)|0;var Et=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,u=Math.imul(H,re),r=Math.imul(H,fe),r=r+Math.imul(G,re)|0,c=Math.imul(G,fe),u=u+Math.imul(F,ie)|0,r=r+Math.imul(F,ae)|0,r=r+Math.imul(K,ie)|0,c=c+Math.imul(K,ae)|0,u=u+Math.imul(U,ne)|0,r=r+Math.imul(U,he)|0,r=r+Math.imul(O,ne)|0,c=c+Math.imul(O,he)|0,u=u+Math.imul(Y,se)|0,r=r+Math.imul(Y,de)|0,r=r+Math.imul($,se)|0,c=c+Math.imul($,de)|0,u=u+Math.imul(z,oe)|0,r=r+Math.imul(z,ue)|0,r=r+Math.imul(V,oe)|0,c=c+Math.imul(V,ue)|0,u=u+Math.imul(S,ce)|0,r=r+Math.imul(S,le)|0,r=r+Math.imul(L,ce)|0,c=c+Math.imul(L,le)|0;var It=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(It>>>26)|0,It&=67108863,u=Math.imul(Z,re),r=Math.imul(Z,fe),r=r+Math.imul(W,re)|0,c=Math.imul(W,fe),u=u+Math.imul(H,ie)|0,r=r+Math.imul(H,ae)|0,r=r+Math.imul(G,ie)|0,c=c+Math.imul(G,ae)|0,u=u+Math.imul(F,ne)|0,r=r+Math.imul(F,he)|0,r=r+Math.imul(K,ne)|0,c=c+Math.imul(K,he)|0,u=u+Math.imul(U,se)|0,r=r+Math.imul(U,de)|0,r=r+Math.imul(O,se)|0,c=c+Math.imul(O,de)|0,u=u+Math.imul(Y,oe)|0,r=r+Math.imul(Y,ue)|0,r=r+Math.imul($,oe)|0,c=c+Math.imul($,ue)|0,u=u+Math.imul(z,ce)|0,r=r+Math.imul(z,le)|0,r=r+Math.imul(V,ce)|0,c=c+Math.imul(V,le)|0,u=u+Math.imul(S,ve)|0,r=r+Math.imul(S,be)|0,r=r+Math.imul(L,ve)|0,c=c+Math.imul(L,be)|0;var St=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(St>>>26)|0,St&=67108863,u=Math.imul(J,re),r=Math.imul(J,fe),r=r+Math.imul(X,re)|0,c=Math.imul(X,fe),u=u+Math.imul(Z,ie)|0,r=r+Math.imul(Z,ae)|0,r=r+Math.imul(W,ie)|0,c=c+Math.imul(W,ae)|0,u=u+Math.imul(H,ne)|0,r=r+Math.imul(H,he)|0,r=r+Math.imul(G,ne)|0,c=c+Math.imul(G,he)|0,u=u+Math.imul(F,se)|0,r=r+Math.imul(F,de)|0,r=r+Math.imul(K,se)|0,c=c+Math.imul(K,de)|0,u=u+Math.imul(U,oe)|0,r=r+Math.imul(U,ue)|0,r=r+Math.imul(O,oe)|0,c=c+Math.imul(O,ue)|0,u=u+Math.imul(Y,ce)|0,r=r+Math.imul(Y,le)|0,r=r+Math.imul($,ce)|0,c=c+Math.imul($,le)|0,u=u+Math.imul(z,ve)|0,r=r+Math.imul(z,be)|0,r=r+Math.imul(V,ve)|0,c=c+Math.imul(V,be)|0,u=u+Math.imul(S,pe)|0,r=r+Math.imul(S,xe)|0,r=r+Math.imul(L,pe)|0,c=c+Math.imul(L,xe)|0;var Lt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u=Math.imul(Q,re),r=Math.imul(Q,fe),r=r+Math.imul(j,re)|0,c=Math.imul(j,fe),u=u+Math.imul(J,ie)|0,r=r+Math.imul(J,ae)|0,r=r+Math.imul(X,ie)|0,c=c+Math.imul(X,ae)|0,u=u+Math.imul(Z,ne)|0,r=r+Math.imul(Z,he)|0,r=r+Math.imul(W,ne)|0,c=c+Math.imul(W,he)|0,u=u+Math.imul(H,se)|0,r=r+Math.imul(H,de)|0,r=r+Math.imul(G,se)|0,c=c+Math.imul(G,de)|0,u=u+Math.imul(F,oe)|0,r=r+Math.imul(F,ue)|0,r=r+Math.imul(K,oe)|0,c=c+Math.imul(K,ue)|0,u=u+Math.imul(U,ce)|0,r=r+Math.imul(U,le)|0,r=r+Math.imul(O,ce)|0,c=c+Math.imul(O,le)|0,u=u+Math.imul(Y,ve)|0,r=r+Math.imul(Y,be)|0,r=r+Math.imul($,ve)|0,c=c+Math.imul($,be)|0,u=u+Math.imul(z,pe)|0,r=r+Math.imul(z,xe)|0,r=r+Math.imul(V,pe)|0,c=c+Math.imul(V,xe)|0,u=u+Math.imul(S,me)|0,r=r+Math.imul(S,ge)|0,r=r+Math.imul(L,me)|0,c=c+Math.imul(L,ge)|0;var Pt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u=Math.imul(ee,re),r=Math.imul(ee,fe),r=r+Math.imul(te,re)|0,c=Math.imul(te,fe),u=u+Math.imul(Q,ie)|0,r=r+Math.imul(Q,ae)|0,r=r+Math.imul(j,ie)|0,c=c+Math.imul(j,ae)|0,u=u+Math.imul(J,ne)|0,r=r+Math.imul(J,he)|0,r=r+Math.imul(X,ne)|0,c=c+Math.imul(X,he)|0,u=u+Math.imul(Z,se)|0,r=r+Math.imul(Z,de)|0,r=r+Math.imul(W,se)|0,c=c+Math.imul(W,de)|0,u=u+Math.imul(H,oe)|0,r=r+Math.imul(H,ue)|0,r=r+Math.imul(G,oe)|0,c=c+Math.imul(G,ue)|0,u=u+Math.imul(F,ce)|0,r=r+Math.imul(F,le)|0,r=r+Math.imul(K,ce)|0,c=c+Math.imul(K,le)|0,u=u+Math.imul(U,ve)|0,r=r+Math.imul(U,be)|0,r=r+Math.imul(O,ve)|0,c=c+Math.imul(O,be)|0,u=u+Math.imul(Y,pe)|0,r=r+Math.imul(Y,xe)|0,r=r+Math.imul($,pe)|0,c=c+Math.imul($,xe)|0,u=u+Math.imul(z,me)|0,r=r+Math.imul(z,ge)|0,r=r+Math.imul(V,me)|0,c=c+Math.imul(V,ge)|0,u=u+Math.imul(S,_e)|0,r=r+Math.imul(S,ye)|0,r=r+Math.imul(L,_e)|0,c=c+Math.imul(L,ye)|0;var Bt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u=Math.imul(ee,ie),r=Math.imul(ee,ae),r=r+Math.imul(te,ie)|0,c=Math.imul(te,ae),u=u+Math.imul(Q,ne)|0,r=r+Math.imul(Q,he)|0,r=r+Math.imul(j,ne)|0,c=c+Math.imul(j,he)|0,u=u+Math.imul(J,se)|0,r=r+Math.imul(J,de)|0,r=r+Math.imul(X,se)|0,c=c+Math.imul(X,de)|0,u=u+Math.imul(Z,oe)|0,r=r+Math.imul(Z,ue)|0,r=r+Math.imul(W,oe)|0,c=c+Math.imul(W,ue)|0,u=u+Math.imul(H,ce)|0,r=r+Math.imul(H,le)|0,r=r+Math.imul(G,ce)|0,c=c+Math.imul(G,le)|0,u=u+Math.imul(F,ve)|0,r=r+Math.imul(F,be)|0,r=r+Math.imul(K,ve)|0,c=c+Math.imul(K,be)|0,u=u+Math.imul(U,pe)|0,r=r+Math.imul(U,xe)|0,r=r+Math.imul(O,pe)|0,c=c+Math.imul(O,xe)|0,u=u+Math.imul(Y,me)|0,r=r+Math.imul(Y,ge)|0,r=r+Math.imul($,me)|0,c=c+Math.imul($,ge)|0,u=u+Math.imul(z,_e)|0,r=r+Math.imul(z,ye)|0,r=r+Math.imul(V,_e)|0,c=c+Math.imul(V,ye)|0;var Rt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u=Math.imul(ee,ne),r=Math.imul(ee,he),r=r+Math.imul(te,ne)|0,c=Math.imul(te,he),u=u+Math.imul(Q,se)|0,r=r+Math.imul(Q,de)|0,r=r+Math.imul(j,se)|0,c=c+Math.imul(j,de)|0,u=u+Math.imul(J,oe)|0,r=r+Math.imul(J,ue)|0,r=r+Math.imul(X,oe)|0,c=c+Math.imul(X,ue)|0,u=u+Math.imul(Z,ce)|0,r=r+Math.imul(Z,le)|0,r=r+Math.imul(W,ce)|0,c=c+Math.imul(W,le)|0,u=u+Math.imul(H,ve)|0,r=r+Math.imul(H,be)|0,r=r+Math.imul(G,ve)|0,c=c+Math.imul(G,be)|0,u=u+Math.imul(F,pe)|0,r=r+Math.imul(F,xe)|0,r=r+Math.imul(K,pe)|0,c=c+Math.imul(K,xe)|0,u=u+Math.imul(U,me)|0,r=r+Math.imul(U,ge)|0,r=r+Math.imul(O,me)|0,c=c+Math.imul(O,ge)|0,u=u+Math.imul(Y,_e)|0,r=r+Math.imul(Y,ye)|0,r=r+Math.imul($,_e)|0,c=c+Math.imul($,ye)|0;var Nt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(ee,se),r=Math.imul(ee,de),r=r+Math.imul(te,se)|0,c=Math.imul(te,de),u=u+Math.imul(Q,oe)|0,r=r+Math.imul(Q,ue)|0,r=r+Math.imul(j,oe)|0,c=c+Math.imul(j,ue)|0,u=u+Math.imul(J,ce)|0,r=r+Math.imul(J,le)|0,r=r+Math.imul(X,ce)|0,c=c+Math.imul(X,le)|0,u=u+Math.imul(Z,ve)|0,r=r+Math.imul(Z,be)|0,r=r+Math.imul(W,ve)|0,c=c+Math.imul(W,be)|0,u=u+Math.imul(H,pe)|0,r=r+Math.imul(H,xe)|0,r=r+Math.imul(G,pe)|0,c=c+Math.imul(G,xe)|0,u=u+Math.imul(F,me)|0,r=r+Math.imul(F,ge)|0,r=r+Math.imul(K,me)|0,c=c+Math.imul(K,ge)|0,u=u+Math.imul(U,_e)|0,r=r+Math.imul(U,ye)|0,r=r+Math.imul(O,_e)|0,c=c+Math.imul(O,ye)|0;var Tt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u=Math.imul(ee,oe),r=Math.imul(ee,ue),r=r+Math.imul(te,oe)|0,c=Math.imul(te,ue),u=u+Math.imul(Q,ce)|0,r=r+Math.imul(Q,le)|0,r=r+Math.imul(j,ce)|0,c=c+Math.imul(j,le)|0,u=u+Math.imul(J,ve)|0,r=r+Math.imul(J,be)|0,r=r+Math.imul(X,ve)|0,c=c+Math.imul(X,be)|0,u=u+Math.imul(Z,pe)|0,r=r+Math.imul(Z,xe)|0,r=r+Math.imul(W,pe)|0,c=c+Math.imul(W,xe)|0,u=u+Math.imul(H,me)|0,r=r+Math.imul(H,ge)|0,r=r+Math.imul(G,me)|0,c=c+Math.imul(G,ge)|0,u=u+Math.imul(F,_e)|0,r=r+Math.imul(F,ye)|0,r=r+Math.imul(K,_e)|0,c=c+Math.imul(K,ye)|0;var Ct=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u=Math.imul(ee,ce),r=Math.imul(ee,le),r=r+Math.imul(te,ce)|0,c=Math.imul(te,le),u=u+Math.imul(Q,ve)|0,r=r+Math.imul(Q,be)|0,r=r+Math.imul(j,ve)|0,c=c+Math.imul(j,be)|0,u=u+Math.imul(J,pe)|0,r=r+Math.imul(J,xe)|0,r=r+Math.imul(X,pe)|0,c=c+Math.imul(X,xe)|0,u=u+Math.imul(Z,me)|0,r=r+Math.imul(Z,ge)|0,r=r+Math.imul(W,me)|0,c=c+Math.imul(W,ge)|0,u=u+Math.imul(H,_e)|0,r=r+Math.imul(H,ye)|0,r=r+Math.imul(G,_e)|0,c=c+Math.imul(G,ye)|0;var Dt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,u=Math.imul(ee,ve),r=Math.imul(ee,be),r=r+Math.imul(te,ve)|0,c=Math.imul(te,be),u=u+Math.imul(Q,pe)|0,r=r+Math.imul(Q,xe)|0,r=r+Math.imul(j,pe)|0,c=c+Math.imul(j,xe)|0,u=u+Math.imul(J,me)|0,r=r+Math.imul(J,ge)|0,r=r+Math.imul(X,me)|0,c=c+Math.imul(X,ge)|0,u=u+Math.imul(Z,_e)|0,r=r+Math.imul(Z,ye)|0,r=r+Math.imul(W,_e)|0,c=c+Math.imul(W,ye)|0;var zt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863,u=Math.imul(ee,pe),r=Math.imul(ee,xe),r=r+Math.imul(te,pe)|0,c=Math.imul(te,xe),u=u+Math.imul(Q,me)|0,r=r+Math.imul(Q,ge)|0,r=r+Math.imul(j,me)|0,c=c+Math.imul(j,ge)|0,u=u+Math.imul(J,_e)|0,r=r+Math.imul(J,ye)|0,r=r+Math.imul(X,_e)|0,c=c+Math.imul(X,ye)|0;var qt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(qt>>>26)|0,qt&=67108863,u=Math.imul(ee,me),r=Math.imul(ee,ge),r=r+Math.imul(te,me)|0,c=Math.imul(te,ge),u=u+Math.imul(Q,_e)|0,r=r+Math.imul(Q,ye)|0,r=r+Math.imul(j,_e)|0,c=c+Math.imul(j,ye)|0;var Vt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,u=Math.imul(ee,_e),r=Math.imul(ee,ye),r=r+Math.imul(te,_e)|0,c=Math.imul(te,ye);var Yt=(p+u|0)+((r&8191)<<13)|0;return p=(c+(r>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b[0]=yt,b[1]=Mt,b[2]=wt,b[3]=At,b[4]=Et,b[5]=It,b[6]=St,b[7]=Lt,b[8]=Pt,b[9]=Bt,b[10]=Rt,b[11]=Nt,b[12]=Tt,b[13]=Ct,b[14]=Dt,b[15]=zt,b[16]=qt,b[17]=Vt,b[18]=Yt,p!==0&&(b[19]=p,s.length++),s};Math.imul||(P=E);function N(v,e,i){i.negative=e.negative^v.negative,i.length=v.length+e.length;for(var s=0,o=0,l=0;l<i.length-1;l++){var b=o;o=0;for(var p=s&67108863,u=Math.min(l,e.length-1),r=Math.max(0,l-v.length+1);r<=u;r++){var c=l-r,I=v.words[c]|0,S=e.words[r]|0,L=I*S,B=L&67108863;b=b+(L/67108864|0)|0,B=B+p|0,p=B&67108863,b=b+(B>>>26)|0,o+=b>>>26,b&=67108863}i.words[l]=p,s=b,b=o}return s!==0?i.words[l]=s:i.length--,i.strip()}function R(v,e,i){var s=new D;return s.mulp(v,e,i)}a.prototype.mulTo=function(e,i){var s,o=this.length+e.length;return this.length===10&&e.length===10?s=P(this,e,i):o<63?s=E(this,e,i):o<1024?s=N(this,e,i):s=R(this,e,i),s};function D(v,e){this.x=v,this.y=e}D.prototype.makeRBT=function(e){for(var i=new Array(e),s=a.prototype._countBits(e)-1,o=0;o<e;o++)i[o]=this.revBin(o,s,e);return i},D.prototype.revBin=function(e,i,s){if(e===0||e===s-1)return e;for(var o=0,l=0;l<i;l++)o|=(e&1)<<i-l-1,e>>=1;return o},D.prototype.permute=function(e,i,s,o,l,b){for(var p=0;p<b;p++)o[p]=i[e[p]],l[p]=s[e[p]]},D.prototype.transform=function(e,i,s,o,l,b){this.permute(b,e,i,s,o,l);for(var p=1;p<l;p<<=1)for(var u=p<<1,r=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),I=0;I<l;I+=u)for(var S=r,L=c,B=0;B<p;B++){var z=s[I+B],V=o[I+B],Ce=s[I+B+p],Y=o[I+B+p],$=S*Ce-L*Y;Y=S*Y+L*Ce,Ce=$,s[I+B]=z+Ce,o[I+B]=V+Y,s[I+B+p]=z-Ce,o[I+B+p]=V-Y,B!==u&&($=r*S-c*L,L=r*L+c*S,S=$)}},D.prototype.guessLen13b=function(e,i){var s=Math.max(i,e)|1,o=s&1,l=0;for(s=s/2|0;s;s=s>>>1)l++;return 1<<l+1+o},D.prototype.conjugate=function(e,i,s){if(!(s<=1))for(var o=0;o<s/2;o++){var l=e[o];e[o]=e[s-o-1],e[s-o-1]=l,l=i[o],i[o]=-i[s-o-1],i[s-o-1]=-l}},D.prototype.normalize13b=function(e,i){for(var s=0,o=0;o<i/2;o++){var l=Math.round(e[2*o+1]/i)*8192+Math.round(e[2*o]/i)+s;e[o]=l&67108863,l<67108864?s=0:s=l/67108864|0}return e},D.prototype.convert13b=function(e,i,s,o){for(var l=0,b=0;b<i;b++)l=l+(e[b]|0),s[2*b]=l&8191,l=l>>>13,s[2*b+1]=l&8191,l=l>>>13;for(b=2*i;b<o;++b)s[b]=0;h(l===0),h((l&-8192)===0)},D.prototype.stub=function(e){for(var i=new Array(e),s=0;s<e;s++)i[s]=0;return i},D.prototype.mulp=function(e,i,s){var o=2*this.guessLen13b(e.length,i.length),l=this.makeRBT(o),b=this.stub(o),p=new Array(o),u=new Array(o),r=new Array(o),c=new Array(o),I=new Array(o),S=new Array(o),L=s.words;L.length=o,this.convert13b(e.words,e.length,p,o),this.convert13b(i.words,i.length,c,o),this.transform(p,b,u,r,o,l),this.transform(c,b,I,S,o,l);for(var B=0;B<o;B++){var z=u[B]*I[B]-r[B]*S[B];r[B]=u[B]*S[B]+r[B]*I[B],u[B]=z}return this.conjugate(u,r,o),this.transform(u,r,L,b,o,l),this.conjugate(L,b,o),this.normalize13b(L,o),s.negative=e.negative^i.negative,s.length=e.length+i.length,s.strip()},a.prototype.mul=function(e){var i=new a(null);return i.words=new Array(this.length+e.length),this.mulTo(e,i)},a.prototype.mulf=function(e){var i=new a(null);return i.words=new Array(this.length+e.length),R(this,e,i)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){h(typeof e=="number"),h(e<67108864);for(var i=0,s=0;s<this.length;s++){var o=(this.words[s]|0)*e,l=(o&67108863)+(i&67108863);i>>=26,i+=o/67108864|0,i+=l>>>26,this.words[s]=l&67108863}return i!==0&&(this.words[s]=i,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var i=w(e);if(i.length===0)return new a(1);for(var s=this,o=0;o<i.length&&i[o]===0;o++,s=s.sqr());if(++o<i.length)for(var l=s.sqr();o<i.length;o++,l=l.sqr())i[o]!==0&&(s=s.mul(l));return s},a.prototype.iushln=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26,o=67108863>>>26-i<<26-i,l;if(i!==0){var b=0;for(l=0;l<this.length;l++){var p=this.words[l]&o,u=(this.words[l]|0)-p<<i;this.words[l]=u|b,b=p>>>26-i}b&&(this.words[l]=b,this.length++)}if(s!==0){for(l=this.length-1;l>=0;l--)this.words[l+s]=this.words[l];for(l=0;l<s;l++)this.words[l]=0;this.length+=s}return this.strip()},a.prototype.ishln=function(e){return h(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,i,s){h(typeof e=="number"&&e>=0);var o;i?o=(i-i%26)/26:o=0;var l=e%26,b=Math.min((e-l)/26,this.length),p=67108863^67108863>>>l<<l,u=s;if(o-=b,o=Math.max(0,o),u){for(var r=0;r<b;r++)u.words[r]=this.words[r];u.length=b}if(b!==0)if(this.length>b)for(this.length-=b,r=0;r<this.length;r++)this.words[r]=this.words[r+b];else this.words[0]=0,this.length=1;var c=0;for(r=this.length-1;r>=0&&(c!==0||r>=o);r--){var I=this.words[r]|0;this.words[r]=c<<26-l|I>>>l,c=I&p}return u&&c!==0&&(u.words[u.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,i,s){return h(this.negative===0),this.iushrn(e,i,s)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26,o=1<<i;if(this.length<=s)return!1;var l=this.words[s];return!!(l&o)},a.prototype.imaskn=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26;if(h(this.negative===0,"imaskn works only with positive numbers"),this.length<=s)return this;if(i!==0&&s++,this.length=Math.min(s,this.length),i!==0){var o=67108863^67108863>>>i<<i;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return h(typeof e=="number"),h(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},a.prototype.isubn=function(e){if(h(typeof e=="number"),h(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,i,s){var o=e.length+s,l;this._expand(o);var b,p=0;for(l=0;l<e.length;l++){b=(this.words[l+s]|0)+p;var u=(e.words[l]|0)*i;b-=u&67108863,p=(b>>26)-(u/67108864|0),this.words[l+s]=b&67108863}for(;l<this.length-s;l++)b=(this.words[l+s]|0)+p,p=b>>26,this.words[l+s]=b&67108863;if(p===0)return this.strip();for(h(p===-1),p=0,l=0;l<this.length;l++)b=-(this.words[l]|0)+p,p=b>>26,this.words[l]=b&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,i){var s=this.length-e.length,o=this.clone(),l=e,b=l.words[l.length-1]|0,p=this._countBits(b);s=26-p,s!==0&&(l=l.ushln(s),o.iushln(s),b=l.words[l.length-1]|0);var u=o.length-l.length,r;if(i!=="mod"){r=new a(null),r.length=u+1,r.words=new Array(r.length);for(var c=0;c<r.length;c++)r.words[c]=0}var I=o.clone()._ishlnsubmul(l,1,u);I.negative===0&&(o=I,r&&(r.words[u]=1));for(var S=u-1;S>=0;S--){var L=(o.words[l.length+S]|0)*67108864+(o.words[l.length+S-1]|0);for(L=Math.min(L/b|0,67108863),o._ishlnsubmul(l,L,S);o.negative!==0;)L--,o.negative=0,o._ishlnsubmul(l,1,S),o.isZero()||(o.negative^=1);r&&(r.words[S]=L)}return r&&r.strip(),o.strip(),i!=="div"&&s!==0&&o.iushrn(s),{div:r||null,mod:o}},a.prototype.divmod=function(e,i,s){if(h(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,l,b;return this.negative!==0&&e.negative===0?(b=this.neg().divmod(e,i),i!=="mod"&&(o=b.div.neg()),i!=="div"&&(l=b.mod.neg(),s&&l.negative!==0&&l.iadd(e)),{div:o,mod:l}):this.negative===0&&e.negative!==0?(b=this.divmod(e.neg(),i),i!=="mod"&&(o=b.div.neg()),{div:o,mod:b.mod}):this.negative&e.negative?(b=this.neg().divmod(e.neg(),i),i!=="div"&&(l=b.mod.neg(),s&&l.negative!==0&&l.isub(e)),{div:b.div,mod:l}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?i==="div"?{div:this.divn(e.words[0]),mod:null}:i==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,i)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var i=this.divmod(e);if(i.mod.isZero())return i.div;var s=i.div.negative!==0?i.mod.isub(e):i.mod,o=e.ushrn(1),l=e.andln(1),b=s.cmp(o);return b<0||l===1&&b===0?i.div:i.div.negative!==0?i.div.isubn(1):i.div.iaddn(1)},a.prototype.modn=function(e){h(e<=67108863);for(var i=(1<<26)%e,s=0,o=this.length-1;o>=0;o--)s=(i*s+(this.words[o]|0))%e;return s},a.prototype.idivn=function(e){h(e<=67108863);for(var i=0,s=this.length-1;s>=0;s--){var o=(this.words[s]|0)+i*67108864;this.words[s]=o/e|0,i=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){h(e.negative===0),h(!e.isZero());var i=this,s=e.clone();i.negative!==0?i=i.umod(e):i=i.clone();for(var o=new a(1),l=new a(0),b=new a(0),p=new a(1),u=0;i.isEven()&&s.isEven();)i.iushrn(1),s.iushrn(1),++u;for(var r=s.clone(),c=i.clone();!i.isZero();){for(var I=0,S=1;!(i.words[0]&S)&&I<26;++I,S<<=1);if(I>0)for(i.iushrn(I);I-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(r),l.isub(c)),o.iushrn(1),l.iushrn(1);for(var L=0,B=1;!(s.words[0]&B)&&L<26;++L,B<<=1);if(L>0)for(s.iushrn(L);L-- >0;)(b.isOdd()||p.isOdd())&&(b.iadd(r),p.isub(c)),b.iushrn(1),p.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(b),l.isub(p)):(s.isub(i),b.isub(o),p.isub(l))}return{a:b,b:p,gcd:s.iushln(u)}},a.prototype._invmp=function(e){h(e.negative===0),h(!e.isZero());var i=this,s=e.clone();i.negative!==0?i=i.umod(e):i=i.clone();for(var o=new a(1),l=new a(0),b=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var p=0,u=1;!(i.words[0]&u)&&p<26;++p,u<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(b),o.iushrn(1);for(var r=0,c=1;!(s.words[0]&c)&&r<26;++r,c<<=1);if(r>0)for(s.iushrn(r);r-- >0;)l.isOdd()&&l.iadd(b),l.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(l)):(s.isub(i),l.isub(o))}var I;return i.cmpn(1)===0?I=o:I=l,I.cmpn(0)<0&&I.iadd(e),I},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var i=this.clone(),s=e.clone();i.negative=0,s.negative=0;for(var o=0;i.isEven()&&s.isEven();o++)i.iushrn(1),s.iushrn(1);do{for(;i.isEven();)i.iushrn(1);for(;s.isEven();)s.iushrn(1);var l=i.cmp(s);if(l<0){var b=i;i=s,s=b}else if(l===0||s.cmpn(1)===0)break;i.isub(s)}while(!0);return s.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){h(typeof e=="number");var i=e%26,s=(e-i)/26,o=1<<i;if(this.length<=s)return this._expand(s+1),this.words[s]|=o,this;for(var l=o,b=s;l!==0&&b<this.length;b++){var p=this.words[b]|0;p+=l,l=p>>>26,p&=67108863,this.words[b]=p}return l!==0&&(this.words[b]=l,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var i=e<0;if(this.negative!==0&&!i)return-1;if(this.negative===0&&i)return 1;this.strip();var s;if(this.length>1)s=1;else{i&&(e=-e),h(e<=67108863,"Number is too big");var o=this.words[0]|0;s=o===e?0:o<e?-1:1}return this.negative!==0?-s|0:s},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var i=this.ucmp(e);return this.negative!==0?-i|0:i},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var i=0,s=this.length-1;s>=0;s--){var o=this.words[s]|0,l=e.words[s]|0;if(o!==l){o<l?i=-1:o>l&&(i=1);break}}return i},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new q(e)},a.prototype.toRed=function(e){return h(!this.red,"Already a number in reduction context"),h(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return h(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return h(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var Me={k256:null,p224:null,p192:null,p25519:null};function k(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}k.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var i=e,s;do this.split(i,this.tmp),i=this.imulK(i),i=i.iadd(this.tmp),s=i.bitLength();while(s>this.n);var o=s<this.n?-1:i.ucmp(this.p);return o===0?(i.words[0]=0,i.length=1):o>0?i.isub(this.p):i.strip!==void 0?i.strip():i._strip(),i},k.prototype.split=function(e,i){e.iushrn(this.n,0,i)},k.prototype.imulK=function(e){return e.imul(this.k)};function Ae(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(Ae,k),Ae.prototype.split=function(e,i){for(var s=4194303,o=Math.min(e.length,9),l=0;l<o;l++)i.words[l]=e.words[l];if(i.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var b=e.words[9];for(i.words[i.length++]=b&s,l=10;l<e.length;l++){var p=e.words[l]|0;e.words[l-10]=(p&s)<<4|b>>>22,b=p}b>>>=22,e.words[l-10]=b,b===0&&e.length>10?e.length-=10:e.length-=9},Ae.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var i=0,s=0;s<e.length;s++){var o=e.words[s]|0;i+=o*977,e.words[s]=i&67108863,i=o*64+(i/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Ie(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(Ie,k);function Ee(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(Ee,k);function Le(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(Le,k),Le.prototype.imulK=function(e){for(var i=0,s=0;s<e.length;s++){var o=(e.words[s]|0)*19+i,l=o&67108863;o>>>=26,e.words[s]=l,i=o}return i!==0&&(e.words[e.length++]=i),e},a._prime=function(e){if(Me[e])return Me[e];var i;if(e==="k256")i=new Ae;else if(e==="p224")i=new Ie;else if(e==="p192")i=new Ee;else if(e==="p25519")i=new Le;else throw new Error("Unknown prime "+e);return Me[e]=i,i};function q(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else h(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}q.prototype._verify1=function(e){h(e.negative===0,"red works only with positives"),h(e.red,"red works only with red numbers")},q.prototype._verify2=function(e,i){h((e.negative|i.negative)===0,"red works only with positives"),h(e.red&&e.red===i.red,"red works only with red numbers")},q.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},q.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},q.prototype.add=function(e,i){this._verify2(e,i);var s=e.add(i);return s.cmp(this.m)>=0&&s.isub(this.m),s._forceRed(this)},q.prototype.iadd=function(e,i){this._verify2(e,i);var s=e.iadd(i);return s.cmp(this.m)>=0&&s.isub(this.m),s},q.prototype.sub=function(e,i){this._verify2(e,i);var s=e.sub(i);return s.cmpn(0)<0&&s.iadd(this.m),s._forceRed(this)},q.prototype.isub=function(e,i){this._verify2(e,i);var s=e.isub(i);return s.cmpn(0)<0&&s.iadd(this.m),s},q.prototype.shl=function(e,i){return this._verify1(e),this.imod(e.ushln(i))},q.prototype.imul=function(e,i){return this._verify2(e,i),this.imod(e.imul(i))},q.prototype.mul=function(e,i){return this._verify2(e,i),this.imod(e.mul(i))},q.prototype.isqr=function(e){return this.imul(e,e.clone())},q.prototype.sqr=function(e){return this.mul(e,e)},q.prototype.sqrt=function(e){if(e.isZero())return e.clone();var i=this.m.andln(3);if(h(i%2===1),i===3){var s=this.m.add(new a(1)).iushrn(2);return this.pow(e,s)}for(var o=this.m.subn(1),l=0;!o.isZero()&&o.andln(1)===0;)l++,o.iushrn(1);h(!o.isZero());var b=new a(1).toRed(this),p=b.redNeg(),u=this.m.subn(1).iushrn(1),r=this.m.bitLength();for(r=new a(2*r*r).toRed(this);this.pow(r,u).cmp(p)!==0;)r.redIAdd(p);for(var c=this.pow(r,o),I=this.pow(e,o.addn(1).iushrn(1)),S=this.pow(e,o),L=l;S.cmp(b)!==0;){for(var B=S,z=0;B.cmp(b)!==0;z++)B=B.redSqr();h(z<L);var V=this.pow(c,new a(1).iushln(L-z-1));I=I.redMul(V),c=V.redSqr(),S=S.redMul(c),L=z}return I},q.prototype.invm=function(e){var i=e._invmp(this.m);return i.negative!==0?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},q.prototype.pow=function(e,i){if(i.isZero())return new a(1).toRed(this);if(i.cmpn(1)===0)return e.clone();var s=4,o=new Array(1<<s);o[0]=new a(1).toRed(this),o[1]=e;for(var l=2;l<o.length;l++)o[l]=this.mul(o[l-1],e);var b=o[0],p=0,u=0,r=i.bitLength()%26;for(r===0&&(r=26),l=i.length-1;l>=0;l--){for(var c=i.words[l],I=r-1;I>=0;I--){var S=c>>I&1;if(b!==o[0]&&(b=this.sqr(b)),S===0&&p===0){u=0;continue}p<<=1,p|=S,u++,!(u!==s&&(l!==0||I!==0))&&(b=this.mul(b,o[p]),u=0,p=0)}r=26}return b},q.prototype.convertTo=function(e){var i=e.umod(this.m);return i===e?i.clone():i},q.prototype.convertFrom=function(e){var i=e.clone();return i.red=null,i},a.mont=function(e){return new Be(e)};function Be(v){q.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}d(Be,q),Be.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},Be.prototype.convertFrom=function(e){var i=this.imod(e.mul(this.rinv));return i.red=null,i},Be.prototype.imul=function(e,i){if(e.isZero()||i.isZero())return e.words[0]=0,e.length=1,e;var s=e.imul(i),o=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=s.isub(o).iushrn(this.shift),b=l;return l.cmp(this.m)>=0?b=l.isub(this.m):l.cmpn(0)<0&&(b=l.iadd(this.m)),b._forceRed(this)},Be.prototype.mul=function(e,i){if(e.isZero()||i.isZero())return new a(0)._forceRed(this);var s=e.mul(i),o=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=s.isub(o).iushrn(this.shift),b=l;return l.cmp(this.m)>=0?b=l.isub(this.m):l.cmpn(0)<0&&(b=l.iadd(this.m)),b._forceRed(this)},Be.prototype.invm=function(e){var i=this.imod(e._invmp(this.m).mul(this.r2));return i._forceRed(this)}})(f,af)})(P0);var lt=P0.exports,Kt=vf;function vf(f,t){if(!f)throw new Error(t||"Assertion failed")}vf.equal=function(t,n,h){if(t!=n)throw new Error(h||"Assertion failed: "+t+" != "+n)};var B0={};(function(f){var t=f;function n(a,m){if(Array.isArray(a))return a.slice();if(!a)return[];var x=[];if(typeof a!="string"){for(var _=0;_<a.length;_++)x[_]=a[_]|0;return x}if(m==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var _=0;_<a.length;_+=2)x.push(parseInt(a[_]+a[_+1],16))}else for(var _=0;_<a.length;_++){var A=a.charCodeAt(_),y=A>>8,g=A&255;y?x.push(y,g):x.push(g)}return x}t.toArray=n;function h(a){return a.length===1?"0"+a:a}t.zero2=h;function d(a){for(var m="",x=0;x<a.length;x++)m+=h(a[x].toString(16));return m}t.toHex=d,t.encode=function(m,x){return x==="hex"?d(m):m}})(B0);(function(f){var t=f,n=lt,h=Kt,d=B0;t.assert=h,t.toArray=d.toArray,t.zero2=d.zero2,t.toHex=d.toHex,t.encode=d.encode;function a(y,g,M){var w=new Array(Math.max(y.bitLength(),M)+1),E;for(E=0;E<w.length;E+=1)w[E]=0;var P=1<<g+1,N=y.clone();for(E=0;E<w.length;E++){var R,D=N.andln(P-1);N.isOdd()?(D>(P>>1)-1?R=(P>>1)-D:R=D,N.isubn(R)):R=0,w[E]=R,N.iushrn(1)}return w}t.getNAF=a;function m(y,g){var M=[[],[]];y=y.clone(),g=g.clone();for(var w=0,E=0,P;y.cmpn(-w)>0||g.cmpn(-E)>0;){var N=y.andln(3)+w&3,R=g.andln(3)+E&3;N===3&&(N=-1),R===3&&(R=-1);var D;N&1?(P=y.andln(7)+w&7,(P===3||P===5)&&R===2?D=-N:D=N):D=0,M[0].push(D);var Me;R&1?(P=g.andln(7)+E&7,(P===3||P===5)&&N===2?Me=-R:Me=R):Me=0,M[1].push(Me),2*w===D+1&&(w=1-w),2*E===Me+1&&(E=1-E),y.iushrn(1),g.iushrn(1)}return M}t.getJSF=m;function x(y,g,M){var w="_"+g;y.prototype[g]=function(){return this[w]!==void 0?this[w]:this[w]=M.call(this)}}t.cachedProperty=x;function _(y){return typeof y=="string"?t.toArray(y,"hex"):y}t.parseBytes=_;function A(y){return new n(y,"hex","le")}t.intFromLE=A})(Oe);var R0={exports:{}},o0;R0.exports=function(t){return o0||(o0=new pt(null)),o0.generate(t)};function pt(f){this.rand=f}R0.exports.Rand=pt;pt.prototype.generate=function(t){return this._rand(t)};pt.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var n=new Uint8Array(t),h=0;h<n.length;h++)n[h]=this.rand.getByte();return n};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?pt.prototype._rand=function(t){var n=new Uint8Array(t);return self.crypto.getRandomValues(n),n}:self.msCrypto&&self.msCrypto.getRandomValues?pt.prototype._rand=function(t){var n=new Uint8Array(t);return self.msCrypto.getRandomValues(n),n}:typeof window=="object"&&(pt.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var O0=Kr;if(typeof O0.randomBytes!="function")throw new Error("Not supported");pt.prototype._rand=function(t){return O0.randomBytes(t)}}catch{}var bf=R0.exports,N0={},kt=lt,Cr=Oe,$r=Cr.getNAF,Yi=Cr.getJSF,Ur=Cr.assert;function _t(f,t){this.type=f,this.p=new kt(t.p,16),this.red=t.prime?kt.red(t.prime):kt.mont(this.p),this.zero=new kt(0).toRed(this.red),this.one=new kt(1).toRed(this.red),this.two=new kt(2).toRed(this.red),this.n=t.n&&new kt(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Jr=_t;_t.prototype.point=function(){throw new Error("Not implemented")};_t.prototype.validate=function(){throw new Error("Not implemented")};_t.prototype._fixedNafMul=function(t,n){Ur(t.precomputed);var h=t._getDoubles(),d=$r(n,1,this._bitLength),a=(1<<h.step+1)-(h.step%2===0?2:1);a/=3;var m=[],x,_;for(x=0;x<d.length;x+=h.step){_=0;for(var A=x+h.step-1;A>=x;A--)_=(_<<1)+d[A];m.push(_)}for(var y=this.jpoint(null,null,null),g=this.jpoint(null,null,null),M=a;M>0;M--){for(x=0;x<m.length;x++)_=m[x],_===M?g=g.mixedAdd(h.points[x]):_===-M&&(g=g.mixedAdd(h.points[x].neg()));y=y.add(g)}return y.toP()};_t.prototype._wnafMul=function(t,n){var h=4,d=t._getNAFPoints(h);h=d.wnd;for(var a=d.points,m=$r(n,h,this._bitLength),x=this.jpoint(null,null,null),_=m.length-1;_>=0;_--){for(var A=0;_>=0&&m[_]===0;_--)A++;if(_>=0&&A++,x=x.dblp(A),_<0)break;var y=m[_];Ur(y!==0),t.type==="affine"?y>0?x=x.mixedAdd(a[y-1>>1]):x=x.mixedAdd(a[-y-1>>1].neg()):y>0?x=x.add(a[y-1>>1]):x=x.add(a[-y-1>>1].neg())}return t.type==="affine"?x.toP():x};_t.prototype._wnafMulAdd=function(t,n,h,d,a){var m=this._wnafT1,x=this._wnafT2,_=this._wnafT3,A=0,y,g,M;for(y=0;y<d;y++){M=n[y];var w=M._getNAFPoints(t);m[y]=w.wnd,x[y]=w.points}for(y=d-1;y>=1;y-=2){var E=y-1,P=y;if(m[E]!==1||m[P]!==1){_[E]=$r(h[E],m[E],this._bitLength),_[P]=$r(h[P],m[P],this._bitLength),A=Math.max(_[E].length,A),A=Math.max(_[P].length,A);continue}var N=[n[E],null,null,n[P]];n[E].y.cmp(n[P].y)===0?(N[1]=n[E].add(n[P]),N[2]=n[E].toJ().mixedAdd(n[P].neg())):n[E].y.cmp(n[P].y.redNeg())===0?(N[1]=n[E].toJ().mixedAdd(n[P]),N[2]=n[E].add(n[P].neg())):(N[1]=n[E].toJ().mixedAdd(n[P]),N[2]=n[E].toJ().mixedAdd(n[P].neg()));var R=[-3,-1,-5,-7,0,7,5,1,3],D=Yi(h[E],h[P]);for(A=Math.max(D[0].length,A),_[E]=new Array(A),_[P]=new Array(A),g=0;g<A;g++){var Me=D[0][g]|0,k=D[1][g]|0;_[E][g]=R[(Me+1)*3+(k+1)],_[P][g]=0,x[E]=N}}var Ae=this.jpoint(null,null,null),Ie=this._wnafT4;for(y=A;y>=0;y--){for(var Ee=0;y>=0;){var Le=!0;for(g=0;g<d;g++)Ie[g]=_[g][y]|0,Ie[g]!==0&&(Le=!1);if(!Le)break;Ee++,y--}if(y>=0&&Ee++,Ae=Ae.dblp(Ee),y<0)break;for(g=0;g<d;g++){var q=Ie[g];q!==0&&(q>0?M=x[g][q-1>>1]:q<0&&(M=x[g][-q-1>>1].neg()),M.type==="affine"?Ae=Ae.mixedAdd(M):Ae=Ae.add(M))}}for(y=0;y<d;y++)x[y]=null;return a?Ae:Ae.toP()};function Ke(f,t){this.curve=f,this.type=t,this.precomputed=null}_t.BasePoint=Ke;Ke.prototype.eq=function(){throw new Error("Not implemented")};Ke.prototype.validate=function(){return this.curve.validate(this)};_t.prototype.decodePoint=function(t,n){t=Cr.toArray(t,n);var h=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*h){t[0]===6?Ur(t[t.length-1]%2===0):t[0]===7&&Ur(t[t.length-1]%2===1);var d=this.point(t.slice(1,1+h),t.slice(1+h,1+2*h));return d}else if((t[0]===2||t[0]===3)&&t.length-1===h)return this.pointFromX(t.slice(1,1+h),t[0]===3);throw new Error("Unknown point format")};Ke.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Ke.prototype._encode=function(t){var n=this.curve.p.byteLength(),h=this.getX().toArray("be",n);return t?[this.getY().isEven()?2:3].concat(h):[4].concat(h,this.getY().toArray("be",n))};Ke.prototype.encode=function(t,n){return Cr.encode(this._encode(n),t)};Ke.prototype.precompute=function(t){if(this.precomputed)return this;var n={doubles:null,naf:null,beta:null};return n.naf=this._getNAFPoints(8),n.doubles=this._getDoubles(4,t),n.beta=this._getBeta(),this.precomputed=n,this};Ke.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var n=this.precomputed.doubles;return n?n.points.length>=Math.ceil((t.bitLength()+1)/n.step):!1};Ke.prototype._getDoubles=function(t,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var h=[this],d=this,a=0;a<n;a+=t){for(var m=0;m<t;m++)d=d.dbl();h.push(d)}return{step:t,points:h}};Ke.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var n=[this],h=(1<<t)-1,d=h===1?null:this.dbl(),a=1;a<h;a++)n[a]=n[a-1].add(d);return{wnd:t,points:n}};Ke.prototype._getBeta=function(){return null};Ke.prototype.dblp=function(t){for(var n=this,h=0;h<t;h++)n=n.dbl();return n};var ki=Oe,Pe=lt,T0=ct,jt=Jr,$i=ki.assert;function He(f){jt.call(this,"short",f),this.a=new Pe(f.a,16).toRed(this.red),this.b=new Pe(f.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(f),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}T0(He,jt);var Ui=He;He.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,h;if(t.beta)n=new Pe(t.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);n=d[0].cmp(d[1])<0?d[0]:d[1],n=n.toRed(this.red)}if(t.lambda)h=new Pe(t.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(n))===0?h=a[0]:(h=a[1],$i(this.g.mul(h).x.cmp(this.g.x.redMul(n))===0))}var m;return t.basis?m=t.basis.map(function(x){return{a:new Pe(x.a,16),b:new Pe(x.b,16)}}):m=this._getEndoBasis(h),{beta:n,lambda:h,basis:m}}};He.prototype._getEndoRoots=function(t){var n=t===this.p?this.red:Pe.mont(t),h=new Pe(2).toRed(n).redInvm(),d=h.redNeg(),a=new Pe(3).toRed(n).redNeg().redSqrt().redMul(h),m=d.redAdd(a).fromRed(),x=d.redSub(a).fromRed();return[m,x]};He.prototype._getEndoBasis=function(t){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),a=new Pe(1),m=new Pe(0),x=new Pe(0),_=new Pe(1),A,y,g,M,w,E,P,N=0,R,D;h.cmpn(0)!==0;){var Me=d.div(h);R=d.sub(Me.mul(h)),D=x.sub(Me.mul(a));var k=_.sub(Me.mul(m));if(!g&&R.cmp(n)<0)A=P.neg(),y=a,g=R.neg(),M=D;else if(g&&++N===2)break;P=R,d=h,h=R,x=a,a=D,_=m,m=k}w=R.neg(),E=D;var Ae=g.sqr().add(M.sqr()),Ie=w.sqr().add(E.sqr());return Ie.cmp(Ae)>=0&&(w=A,E=y),g.negative&&(g=g.neg(),M=M.neg()),w.negative&&(w=w.neg(),E=E.neg()),[{a:g,b:M},{a:w,b:E}]};He.prototype._endoSplit=function(t){var n=this.endo.basis,h=n[0],d=n[1],a=d.b.mul(t).divRound(this.n),m=h.b.neg().mul(t).divRound(this.n),x=a.mul(h.a),_=m.mul(d.a),A=a.mul(h.b),y=m.mul(d.b),g=t.sub(x).sub(_),M=A.add(y).neg();return{k1:g,k2:M}};He.prototype.pointFromX=function(t,n){t=new Pe(t,16),t.red||(t=t.toRed(this.red));var h=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),d=h.redSqrt();if(d.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var a=d.fromRed().isOdd();return(n&&!a||!n&&a)&&(d=d.redNeg()),this.point(t,d)};He.prototype.validate=function(t){if(t.inf)return!0;var n=t.x,h=t.y,d=this.a.redMul(n),a=n.redSqr().redMul(n).redIAdd(d).redIAdd(this.b);return h.redSqr().redISub(a).cmpn(0)===0};He.prototype._endoWnafMulAdd=function(t,n,h){for(var d=this._endoWnafT1,a=this._endoWnafT2,m=0;m<t.length;m++){var x=this._endoSplit(n[m]),_=t[m],A=_._getBeta();x.k1.negative&&(x.k1.ineg(),_=_.neg(!0)),x.k2.negative&&(x.k2.ineg(),A=A.neg(!0)),d[m*2]=_,d[m*2+1]=A,a[m*2]=x.k1,a[m*2+1]=x.k2}for(var y=this._wnafMulAdd(1,d,a,m*2,h),g=0;g<m*2;g++)d[g]=null,a[g]=null;return y};function Te(f,t,n,h){jt.BasePoint.call(this,f,"affine"),t===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Pe(t,16),this.y=new Pe(n,16),h&&(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)}T0(Te,jt.BasePoint);He.prototype.point=function(t,n,h){return new Te(this,t,n,h)};He.prototype.pointFromJSON=function(t,n){return Te.fromJSON(this,t,n)};Te.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var h=this.curve,d=function(a){return h.point(a.x.redMul(h.endo.beta),a.y)};t.beta=n,n.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return n}};Te.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]};Te.fromJSON=function(t,n,h){typeof n=="string"&&(n=JSON.parse(n));var d=t.point(n[0],n[1],h);if(!n[2])return d;function a(x){return t.point(x[0],x[1],h)}var m=n[2];return d.precomputed={beta:null,doubles:m.doubles&&{step:m.doubles.step,points:[d].concat(m.doubles.points.map(a))},naf:m.naf&&{wnd:m.naf.wnd,points:[d].concat(m.naf.points.map(a))}},d};Te.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)+">"};Te.prototype.isInfinity=function(){return this.inf};Te.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(this.x.cmp(t.x)===0)return this.curve.point(null,null);var n=this.y.redSub(t.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(t.x).redInvm()));var h=n.redSqr().redISub(this.x).redISub(t.x),d=n.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,d)};Te.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var n=this.curve.a,h=this.x.redSqr(),d=t.redInvm(),a=h.redAdd(h).redIAdd(h).redIAdd(n).redMul(d),m=a.redSqr().redISub(this.x.redAdd(this.x)),x=a.redMul(this.x.redSub(m)).redISub(this.y);return this.curve.point(m,x)};Te.prototype.getX=function(){return this.x.fromRed()};Te.prototype.getY=function(){return this.y.fromRed()};Te.prototype.mul=function(t){return t=new Pe(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)};Te.prototype.mulAdd=function(t,n,h){var d=[this,n],a=[t,h];return this.curve.endo?this.curve._endoWnafMulAdd(d,a):this.curve._wnafMulAdd(1,d,a,2)};Te.prototype.jmulAdd=function(t,n,h){var d=[this,n],a=[t,h];return this.curve.endo?this.curve._endoWnafMulAdd(d,a,!0):this.curve._wnafMulAdd(1,d,a,2,!0)};Te.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Te.prototype.neg=function(t){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var h=this.precomputed,d=function(a){return a.neg()};n.precomputed={naf:h.naf&&{wnd:h.naf.wnd,points:h.naf.points.map(d)},doubles:h.doubles&&{step:h.doubles.step,points:h.doubles.points.map(d)}}}return n};Te.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function De(f,t,n,h){jt.BasePoint.call(this,f,"jacobian"),t===null&&n===null&&h===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Pe(0)):(this.x=new Pe(t,16),this.y=new Pe(n,16),this.z=new Pe(h,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}T0(De,jt.BasePoint);He.prototype.jpoint=function(t,n,h){return new De(this,t,n,h)};De.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),n=t.redSqr(),h=this.x.redMul(n),d=this.y.redMul(n).redMul(t);return this.curve.point(h,d)};De.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};De.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var n=t.z.redSqr(),h=this.z.redSqr(),d=this.x.redMul(n),a=t.x.redMul(h),m=this.y.redMul(n.redMul(t.z)),x=t.y.redMul(h.redMul(this.z)),_=d.redSub(a),A=m.redSub(x);if(_.cmpn(0)===0)return A.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=_.redSqr(),g=y.redMul(_),M=d.redMul(y),w=A.redSqr().redIAdd(g).redISub(M).redISub(M),E=A.redMul(M.redISub(w)).redISub(m.redMul(g)),P=this.z.redMul(t.z).redMul(_);return this.curve.jpoint(w,E,P)};De.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var n=this.z.redSqr(),h=this.x,d=t.x.redMul(n),a=this.y,m=t.y.redMul(n).redMul(this.z),x=h.redSub(d),_=a.redSub(m);if(x.cmpn(0)===0)return _.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var A=x.redSqr(),y=A.redMul(x),g=h.redMul(A),M=_.redSqr().redIAdd(y).redISub(g).redISub(g),w=_.redMul(g.redISub(M)).redISub(a.redMul(y)),E=this.z.redMul(x);return this.curve.jpoint(M,w,E)};De.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var n;if(this.curve.zeroA||this.curve.threeA){var h=this;for(n=0;n<t;n++)h=h.dbl();return h}var d=this.curve.a,a=this.curve.tinv,m=this.x,x=this.y,_=this.z,A=_.redSqr().redSqr(),y=x.redAdd(x);for(n=0;n<t;n++){var g=m.redSqr(),M=y.redSqr(),w=M.redSqr(),E=g.redAdd(g).redIAdd(g).redIAdd(d.redMul(A)),P=m.redMul(M),N=E.redSqr().redISub(P.redAdd(P)),R=P.redISub(N),D=E.redMul(R);D=D.redIAdd(D).redISub(w);var Me=y.redMul(_);n+1<t&&(A=A.redMul(w)),m=N,_=Me,y=D}return this.curve.jpoint(m,y.redMul(a),_)};De.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};De.prototype._zeroDbl=function(){var t,n,h;if(this.zOne){var d=this.x.redSqr(),a=this.y.redSqr(),m=a.redSqr(),x=this.x.redAdd(a).redSqr().redISub(d).redISub(m);x=x.redIAdd(x);var _=d.redAdd(d).redIAdd(d),A=_.redSqr().redISub(x).redISub(x),y=m.redIAdd(m);y=y.redIAdd(y),y=y.redIAdd(y),t=A,n=_.redMul(x.redISub(A)).redISub(y),h=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),M=this.y.redSqr(),w=M.redSqr(),E=this.x.redAdd(M).redSqr().redISub(g).redISub(w);E=E.redIAdd(E);var P=g.redAdd(g).redIAdd(g),N=P.redSqr(),R=w.redIAdd(w);R=R.redIAdd(R),R=R.redIAdd(R),t=N.redISub(E).redISub(E),n=P.redMul(E.redISub(t)).redISub(R),h=this.y.redMul(this.z),h=h.redIAdd(h)}return this.curve.jpoint(t,n,h)};De.prototype._threeDbl=function(){var t,n,h;if(this.zOne){var d=this.x.redSqr(),a=this.y.redSqr(),m=a.redSqr(),x=this.x.redAdd(a).redSqr().redISub(d).redISub(m);x=x.redIAdd(x);var _=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),A=_.redSqr().redISub(x).redISub(x);t=A;var y=m.redIAdd(m);y=y.redIAdd(y),y=y.redIAdd(y),n=_.redMul(x.redISub(A)).redISub(y),h=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),M=this.y.redSqr(),w=this.x.redMul(M),E=this.x.redSub(g).redMul(this.x.redAdd(g));E=E.redAdd(E).redIAdd(E);var P=w.redIAdd(w);P=P.redIAdd(P);var N=P.redAdd(P);t=E.redSqr().redISub(N),h=this.y.redAdd(this.z).redSqr().redISub(M).redISub(g);var R=M.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R),n=E.redMul(P.redISub(t)).redISub(R)}return this.curve.jpoint(t,n,h)};De.prototype._dbl=function(){var t=this.curve.a,n=this.x,h=this.y,d=this.z,a=d.redSqr().redSqr(),m=n.redSqr(),x=h.redSqr(),_=m.redAdd(m).redIAdd(m).redIAdd(t.redMul(a)),A=n.redAdd(n);A=A.redIAdd(A);var y=A.redMul(x),g=_.redSqr().redISub(y.redAdd(y)),M=y.redISub(g),w=x.redSqr();w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=_.redMul(M).redISub(w),P=h.redAdd(h).redMul(d);return this.curve.jpoint(g,E,P)};De.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),n=this.y.redSqr(),h=this.z.redSqr(),d=n.redSqr(),a=t.redAdd(t).redIAdd(t),m=a.redSqr(),x=this.x.redAdd(n).redSqr().redISub(t).redISub(d);x=x.redIAdd(x),x=x.redAdd(x).redIAdd(x),x=x.redISub(m);var _=x.redSqr(),A=d.redIAdd(d);A=A.redIAdd(A),A=A.redIAdd(A),A=A.redIAdd(A);var y=a.redIAdd(x).redSqr().redISub(m).redISub(_).redISub(A),g=n.redMul(y);g=g.redIAdd(g),g=g.redIAdd(g);var M=this.x.redMul(_).redISub(g);M=M.redIAdd(M),M=M.redIAdd(M);var w=this.y.redMul(y.redMul(A.redISub(y)).redISub(x.redMul(_)));w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=this.z.redAdd(x).redSqr().redISub(h).redISub(_);return this.curve.jpoint(M,w,E)};De.prototype.mul=function(t,n){return t=new Pe(t,n),this.curve._wnafMul(this,t)};De.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var n=this.z.redSqr(),h=t.z.redSqr();if(this.x.redMul(h).redISub(t.x.redMul(n)).cmpn(0)!==0)return!1;var d=n.redMul(this.z),a=h.redMul(t.z);return this.y.redMul(a).redISub(t.y.redMul(d)).cmpn(0)===0};De.prototype.eqXToP=function(t){var n=this.z.redSqr(),h=t.toRed(this.curve.red).redMul(n);if(this.x.cmp(h)===0)return!0;for(var d=t.clone(),a=this.curve.redN.redMul(n);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(h.redIAdd(a),this.x.cmp(h)===0)return!0}};De.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)+">"};De.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Gt=lt,pf=ct,Xr=Jr,Oi=Oe;function er(f){Xr.call(this,"mont",f),this.a=new Gt(f.a,16).toRed(this.red),this.b=new Gt(f.b,16).toRed(this.red),this.i4=new Gt(4).toRed(this.red).redInvm(),this.two=new Gt(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}pf(er,Xr);var Fi=er;er.prototype.validate=function(t){var n=t.normalize().x,h=n.redSqr(),d=h.redMul(n).redAdd(h.redMul(this.a)).redAdd(n),a=d.redSqrt();return a.redSqr().cmp(d)===0};function Ne(f,t,n){Xr.BasePoint.call(this,f,"projective"),t===null&&n===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Gt(t,16),this.z=new Gt(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}pf(Ne,Xr.BasePoint);er.prototype.decodePoint=function(t,n){return this.point(Oi.toArray(t,n),1)};er.prototype.point=function(t,n){return new Ne(this,t,n)};er.prototype.pointFromJSON=function(t){return Ne.fromJSON(this,t)};Ne.prototype.precompute=function(){};Ne.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Ne.fromJSON=function(t,n){return new Ne(t,n[0],n[1]||t.one)};Ne.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)+">"};Ne.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Ne.prototype.dbl=function(){var t=this.x.redAdd(this.z),n=t.redSqr(),h=this.x.redSub(this.z),d=h.redSqr(),a=n.redSub(d),m=n.redMul(d),x=a.redMul(d.redAdd(this.curve.a24.redMul(a)));return this.curve.point(m,x)};Ne.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Ne.prototype.diffAdd=function(t,n){var h=this.x.redAdd(this.z),d=this.x.redSub(this.z),a=t.x.redAdd(t.z),m=t.x.redSub(t.z),x=m.redMul(h),_=a.redMul(d),A=n.z.redMul(x.redAdd(_).redSqr()),y=n.x.redMul(x.redISub(_).redSqr());return this.curve.point(A,y)};Ne.prototype.mul=function(t){for(var n=t.clone(),h=this,d=this.curve.point(null,null),a=this,m=[];n.cmpn(0)!==0;n.iushrn(1))m.push(n.andln(1));for(var x=m.length-1;x>=0;x--)m[x]===0?(h=h.diffAdd(d,a),d=d.dbl()):(d=h.diffAdd(d,a),h=h.dbl());return d};Ne.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Ne.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Ne.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Ne.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Ne.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Ki=Oe,st=lt,xf=ct,Qr=Jr,Hi=Ki.assert;function nt(f){this.twisted=(f.a|0)!==1,this.mOneA=this.twisted&&(f.a|0)===-1,this.extended=this.mOneA,Qr.call(this,"edwards",f),this.a=new st(f.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new st(f.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new st(f.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Hi(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(f.c|0)===1}xf(nt,Qr);var Gi=nt;nt.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};nt.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};nt.prototype.jpoint=function(t,n,h,d){return this.point(t,n,h,d)};nt.prototype.pointFromX=function(t,n){t=new st(t,16),t.red||(t=t.toRed(this.red));var h=t.redSqr(),d=this.c2.redSub(this.a.redMul(h)),a=this.one.redSub(this.c2.redMul(this.d).redMul(h)),m=d.redMul(a.redInvm()),x=m.redSqrt();if(x.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");var _=x.fromRed().isOdd();return(n&&!_||!n&&_)&&(x=x.redNeg()),this.point(t,x)};nt.prototype.pointFromY=function(t,n){t=new st(t,16),t.red||(t=t.toRed(this.red));var h=t.redSqr(),d=h.redSub(this.c2),a=h.redMul(this.d).redMul(this.c2).redSub(this.a),m=d.redMul(a.redInvm());if(m.cmp(this.zero)===0){if(n)throw new Error("invalid point");return this.point(this.zero,t)}var x=m.redSqrt();if(x.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");return x.fromRed().isOdd()!==n&&(x=x.redNeg()),this.point(x,t)};nt.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var n=t.x.redSqr(),h=t.y.redSqr(),d=n.redMul(this.a).redAdd(h),a=this.c2.redMul(this.one.redAdd(this.d.redMul(n).redMul(h)));return d.cmp(a)===0};function Se(f,t,n,h,d){Qr.BasePoint.call(this,f,"projective"),t===null&&n===null&&h===null?(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 st(t,16),this.y=new st(n,16),this.z=h?new st(h,16):this.curve.one,this.t=d&&new st(d,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()))))}xf(Se,Qr.BasePoint);nt.prototype.pointFromJSON=function(t){return Se.fromJSON(this,t)};nt.prototype.point=function(t,n,h,d){return new Se(this,t,n,h,d)};Se.fromJSON=function(t,n){return new Se(t,n[0],n[1],n[2])};Se.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)+">"};Se.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Se.prototype._extDbl=function(){var t=this.x.redSqr(),n=this.y.redSqr(),h=this.z.redSqr();h=h.redIAdd(h);var d=this.curve._mulA(t),a=this.x.redAdd(this.y).redSqr().redISub(t).redISub(n),m=d.redAdd(n),x=m.redSub(h),_=d.redSub(n),A=a.redMul(x),y=m.redMul(_),g=a.redMul(_),M=x.redMul(m);return this.curve.point(A,y,M,g)};Se.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),h=this.y.redSqr(),d,a,m,x,_,A;if(this.curve.twisted){x=this.curve._mulA(n);var y=x.redAdd(h);this.zOne?(d=t.redSub(n).redSub(h).redMul(y.redSub(this.curve.two)),a=y.redMul(x.redSub(h)),m=y.redSqr().redSub(y).redSub(y)):(_=this.z.redSqr(),A=y.redSub(_).redISub(_),d=t.redSub(n).redISub(h).redMul(A),a=y.redMul(x.redSub(h)),m=y.redMul(A))}else x=n.redAdd(h),_=this.curve._mulC(this.z).redSqr(),A=x.redSub(_).redSub(_),d=this.curve._mulC(t.redISub(x)).redMul(A),a=this.curve._mulC(x).redMul(n.redISub(h)),m=x.redMul(A);return this.curve.point(d,a,m)};Se.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Se.prototype._extAdd=function(t){var n=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),h=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),d=this.t.redMul(this.curve.dd).redMul(t.t),a=this.z.redMul(t.z.redAdd(t.z)),m=h.redSub(n),x=a.redSub(d),_=a.redAdd(d),A=h.redAdd(n),y=m.redMul(x),g=_.redMul(A),M=m.redMul(A),w=x.redMul(_);return this.curve.point(y,g,w,M)};Se.prototype._projAdd=function(t){var n=this.z.redMul(t.z),h=n.redSqr(),d=this.x.redMul(t.x),a=this.y.redMul(t.y),m=this.curve.d.redMul(d).redMul(a),x=h.redSub(m),_=h.redAdd(m),A=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(d).redISub(a),y=n.redMul(x).redMul(A),g,M;return this.curve.twisted?(g=n.redMul(_).redMul(a.redSub(this.curve._mulA(d))),M=x.redMul(_)):(g=n.redMul(_).redMul(a.redSub(d)),M=this.curve._mulC(x).redMul(_)),this.curve.point(y,g,M)};Se.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};Se.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};Se.prototype.mulAdd=function(t,n,h){return this.curve._wnafMulAdd(1,[this,n],[t,h],2,!1)};Se.prototype.jmulAdd=function(t,n,h){return this.curve._wnafMulAdd(1,[this,n],[t,h],2,!0)};Se.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};Se.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Se.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Se.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Se.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};Se.prototype.eqXToP=function(t){var n=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(n)===0)return!0;for(var h=t.clone(),d=this.curve.redN.redMul(this.z);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(d),this.x.cmp(n)===0)return!0}};Se.prototype.toP=Se.prototype.normalize;Se.prototype.mixedAdd=Se.prototype.add;(function(f){var t=f;t.base=Jr,t.short=Ui,t.mont=Fi,t.edwards=Gi})(N0);var jr={},e0={},we={},Zi=Kt,Wi=ct;we.inherits=Wi;function Ji(f,t){return(f.charCodeAt(t)&64512)!==55296||t<0||t+1>=f.length?!1:(f.charCodeAt(t+1)&64512)===56320}function Xi(f,t){if(Array.isArray(f))return f.slice();if(!f)return[];var n=[];if(typeof f=="string")if(t){if(t==="hex")for(f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f),d=0;d<f.length;d+=2)n.push(parseInt(f[d]+f[d+1],16))}else for(var h=0,d=0;d<f.length;d++){var a=f.charCodeAt(d);a<128?n[h++]=a:a<2048?(n[h++]=a>>6|192,n[h++]=a&63|128):Ji(f,d)?(a=65536+((a&1023)<<10)+(f.charCodeAt(++d)&1023),n[h++]=a>>18|240,n[h++]=a>>12&63|128,n[h++]=a>>6&63|128,n[h++]=a&63|128):(n[h++]=a>>12|224,n[h++]=a>>6&63|128,n[h++]=a&63|128)}else for(d=0;d<f.length;d++)n[d]=f[d]|0;return n}we.toArray=Xi;function Qi(f){for(var t="",n=0;n<f.length;n++)t+=gf(f[n].toString(16));return t}we.toHex=Qi;function mf(f){var t=f>>>24|f>>>8&65280|f<<8&16711680|(f&255)<<24;return t>>>0}we.htonl=mf;function ji(f,t){for(var n="",h=0;h<f.length;h++){var d=f[h];t==="little"&&(d=mf(d)),n+=_f(d.toString(16))}return n}we.toHex32=ji;function gf(f){return f.length===1?"0"+f:f}we.zero2=gf;function _f(f){return f.length===7?"0"+f:f.length===6?"00"+f:f.length===5?"000"+f:f.length===4?"0000"+f:f.length===3?"00000"+f:f.length===2?"000000"+f:f.length===1?"0000000"+f:f}we.zero8=_f;function ea(f,t,n,h){var d=n-t;Zi(d%4===0);for(var a=new Array(d/4),m=0,x=t;m<a.length;m++,x+=4){var _;h==="big"?_=f[x]<<24|f[x+1]<<16|f[x+2]<<8|f[x+3]:_=f[x+3]<<24|f[x+2]<<16|f[x+1]<<8|f[x],a[m]=_>>>0}return a}we.join32=ea;function ta(f,t){for(var n=new Array(f.length*4),h=0,d=0;h<f.length;h++,d+=4){var a=f[h];t==="big"?(n[d]=a>>>24,n[d+1]=a>>>16&255,n[d+2]=a>>>8&255,n[d+3]=a&255):(n[d+3]=a>>>24,n[d+2]=a>>>16&255,n[d+1]=a>>>8&255,n[d]=a&255)}return n}we.split32=ta;function ra(f,t){return f>>>t|f<<32-t}we.rotr32=ra;function fa(f,t){return f<<t|f>>>32-t}we.rotl32=fa;function ia(f,t){return f+t>>>0}we.sum32=ia;function aa(f,t,n){return f+t+n>>>0}we.sum32_3=aa;function na(f,t,n,h){return f+t+n+h>>>0}we.sum32_4=na;function ha(f,t,n,h,d){return f+t+n+h+d>>>0}we.sum32_5=ha;function sa(f,t,n,h){var d=f[t],a=f[t+1],m=h+a>>>0,x=(m<h?1:0)+n+d;f[t]=x>>>0,f[t+1]=m}we.sum64=sa;function da(f,t,n,h){var d=t+h>>>0,a=(d<t?1:0)+f+n;return a>>>0}we.sum64_hi=da;function oa(f,t,n,h){var d=t+h;return d>>>0}we.sum64_lo=oa;function ua(f,t,n,h,d,a,m,x){var _=0,A=t;A=A+h>>>0,_+=A<t?1:0,A=A+a>>>0,_+=A<a?1:0,A=A+x>>>0,_+=A<x?1:0;var y=f+n+d+m+_;return y>>>0}we.sum64_4_hi=ua;function ca(f,t,n,h,d,a,m,x){var _=t+h+a+x;return _>>>0}we.sum64_4_lo=ca;function la(f,t,n,h,d,a,m,x,_,A){var y=0,g=t;g=g+h>>>0,y+=g<t?1:0,g=g+a>>>0,y+=g<a?1:0,g=g+x>>>0,y+=g<x?1:0,g=g+A>>>0,y+=g<A?1:0;var M=f+n+d+m+_+y;return M>>>0}we.sum64_5_hi=la;function va(f,t,n,h,d,a,m,x,_,A){var y=t+h+a+x+A;return y>>>0}we.sum64_5_lo=va;function ba(f,t,n){var h=t<<32-n|f>>>n;return h>>>0}we.rotr64_hi=ba;function pa(f,t,n){var h=f<<32-n|t>>>n;return h>>>0}we.rotr64_lo=pa;function xa(f,t,n){return f>>>n}we.shr64_hi=xa;function ma(f,t,n){var h=f<<32-n|t>>>n;return h>>>0}we.shr64_lo=ma;var tr={},F0=we,ga=Kt;function t0(){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}tr.BlockHash=t0;t0.prototype.update=function(t,n){if(t=F0.toArray(t,n),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var h=t.length%this._delta8;this.pending=t.slice(t.length-h,t.length),this.pending.length===0&&(this.pending=null),t=F0.join32(t,0,t.length-h,this.endian);for(var d=0;d<t.length;d+=this._delta32)this._update(t,d,d+this._delta32)}return this};t0.prototype.digest=function(t){return this.update(this._pad()),ga(this.pending===null),this._digest(t)};t0.prototype._pad=function(){var t=this.pendingTotal,n=this._delta8,h=n-(t+this.padLength)%n,d=new Array(h+this.padLength);d[0]=128;for(var a=1;a<h;a++)d[a]=0;if(t<<=3,this.endian==="big"){for(var m=8;m<this.padLength;m++)d[a++]=0;d[a++]=0,d[a++]=0,d[a++]=0,d[a++]=0,d[a++]=t>>>24&255,d[a++]=t>>>16&255,d[a++]=t>>>8&255,d[a++]=t&255}else for(d[a++]=t&255,d[a++]=t>>>8&255,d[a++]=t>>>16&255,d[a++]=t>>>24&255,d[a++]=0,d[a++]=0,d[a++]=0,d[a++]=0,m=8;m<this.padLength;m++)d[a++]=0;return d};var rr={},ht={},_a=we,et=_a.rotr32;function ya(f,t,n,h){if(f===0)return yf(t,n,h);if(f===1||f===3)return wf(t,n,h);if(f===2)return Mf(t,n,h)}ht.ft_1=ya;function yf(f,t,n){return f&t^~f&n}ht.ch32=yf;function Mf(f,t,n){return f&t^f&n^t&n}ht.maj32=Mf;function wf(f,t,n){return f^t^n}ht.p32=wf;function Ma(f){return et(f,2)^et(f,13)^et(f,22)}ht.s0_256=Ma;function wa(f){return et(f,6)^et(f,11)^et(f,25)}ht.s1_256=wa;function Aa(f){return et(f,7)^et(f,18)^f>>>3}ht.g0_256=Aa;function Ea(f){return et(f,17)^et(f,19)^f>>>10}ht.g1_256=Ea;var Wt=we,Ia=tr,Sa=ht,u0=Wt.rotl32,Pr=Wt.sum32,La=Wt.sum32_5,Pa=Sa.ft_1,Af=Ia.BlockHash,Ba=[1518500249,1859775393,2400959708,3395469782];function ft(){if(!(this instanceof ft))return new ft;Af.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Wt.inherits(ft,Af);var Ra=ft;ft.blockSize=512;ft.outSize=160;ft.hmacStrength=80;ft.padLength=64;ft.prototype._update=function(t,n){for(var h=this.W,d=0;d<16;d++)h[d]=t[n+d];for(;d<h.length;d++)h[d]=u0(h[d-3]^h[d-8]^h[d-14]^h[d-16],1);var a=this.h[0],m=this.h[1],x=this.h[2],_=this.h[3],A=this.h[4];for(d=0;d<h.length;d++){var y=~~(d/20),g=La(u0(a,5),Pa(y,m,x,_),A,h[d],Ba[y]);A=_,_=x,x=u0(m,30),m=a,a=g}this.h[0]=Pr(this.h[0],a),this.h[1]=Pr(this.h[1],m),this.h[2]=Pr(this.h[2],x),this.h[3]=Pr(this.h[3],_),this.h[4]=Pr(this.h[4],A)};ft.prototype._digest=function(t){return t==="hex"?Wt.toHex32(this.h,"big"):Wt.split32(this.h,"big")};var Jt=we,Na=tr,fr=ht,Ta=Kt,Ge=Jt.sum32,Ca=Jt.sum32_4,Da=Jt.sum32_5,za=fr.ch32,qa=fr.maj32,Va=fr.s0_256,Ya=fr.s1_256,ka=fr.g0_256,$a=fr.g1_256,Ef=Na.BlockHash,Ua=[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 it(){if(!(this instanceof it))return new it;Ef.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Ua,this.W=new Array(64)}Jt.inherits(it,Ef);var If=it;it.blockSize=512;it.outSize=256;it.hmacStrength=192;it.padLength=64;it.prototype._update=function(t,n){for(var h=this.W,d=0;d<16;d++)h[d]=t[n+d];for(;d<h.length;d++)h[d]=Ca($a(h[d-2]),h[d-7],ka(h[d-15]),h[d-16]);var a=this.h[0],m=this.h[1],x=this.h[2],_=this.h[3],A=this.h[4],y=this.h[5],g=this.h[6],M=this.h[7];for(Ta(this.k.length===h.length),d=0;d<h.length;d++){var w=Da(M,Ya(A),za(A,y,g),this.k[d],h[d]),E=Ge(Va(a),qa(a,m,x));M=g,g=y,y=A,A=Ge(_,w),_=x,x=m,m=a,a=Ge(w,E)}this.h[0]=Ge(this.h[0],a),this.h[1]=Ge(this.h[1],m),this.h[2]=Ge(this.h[2],x),this.h[3]=Ge(this.h[3],_),this.h[4]=Ge(this.h[4],A),this.h[5]=Ge(this.h[5],y),this.h[6]=Ge(this.h[6],g),this.h[7]=Ge(this.h[7],M)};it.prototype._digest=function(t){return t==="hex"?Jt.toHex32(this.h,"big"):Jt.split32(this.h,"big")};var M0=we,Sf=If;function dt(){if(!(this instanceof dt))return new dt;Sf.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}M0.inherits(dt,Sf);var Oa=dt;dt.blockSize=512;dt.outSize=224;dt.hmacStrength=192;dt.padLength=64;dt.prototype._digest=function(t){return t==="hex"?M0.toHex32(this.h.slice(0,7),"big"):M0.split32(this.h.slice(0,7),"big")};var $e=we,Fa=tr,Ka=Kt,tt=$e.rotr64_hi,rt=$e.rotr64_lo,Lf=$e.shr64_hi,Pf=$e.shr64_lo,vt=$e.sum64,c0=$e.sum64_hi,l0=$e.sum64_lo,Ha=$e.sum64_4_hi,Ga=$e.sum64_4_lo,Za=$e.sum64_5_hi,Wa=$e.sum64_5_lo,Bf=Fa.BlockHash,Ja=[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 Je(){if(!(this instanceof Je))return new Je;Bf.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Ja,this.W=new Array(160)}$e.inherits(Je,Bf);var Rf=Je;Je.blockSize=1024;Je.outSize=512;Je.hmacStrength=192;Je.padLength=128;Je.prototype._prepareBlock=function(t,n){for(var h=this.W,d=0;d<32;d++)h[d]=t[n+d];for(;d<h.length;d+=2){var a=sn(h[d-4],h[d-3]),m=dn(h[d-4],h[d-3]),x=h[d-14],_=h[d-13],A=nn(h[d-30],h[d-29]),y=hn(h[d-30],h[d-29]),g=h[d-32],M=h[d-31];h[d]=Ha(a,m,x,_,A,y,g,M),h[d+1]=Ga(a,m,x,_,A,y,g,M)}};Je.prototype._update=function(t,n){this._prepareBlock(t,n);var h=this.W,d=this.h[0],a=this.h[1],m=this.h[2],x=this.h[3],_=this.h[4],A=this.h[5],y=this.h[6],g=this.h[7],M=this.h[8],w=this.h[9],E=this.h[10],P=this.h[11],N=this.h[12],R=this.h[13],D=this.h[14],Me=this.h[15];Ka(this.k.length===h.length);for(var k=0;k<h.length;k+=2){var Ae=D,Ie=Me,Ee=fn(M,w),Le=an(M,w),q=Xa(M,w,E,P,N),Be=Qa(M,w,E,P,N,R),v=this.k[k],e=this.k[k+1],i=h[k],s=h[k+1],o=Za(Ae,Ie,Ee,Le,q,Be,v,e,i,s),l=Wa(Ae,Ie,Ee,Le,q,Be,v,e,i,s);Ae=tn(d,a),Ie=rn(d,a),Ee=ja(d,a,m,x,_),Le=en(d,a,m,x,_,A);var b=c0(Ae,Ie,Ee,Le),p=l0(Ae,Ie,Ee,Le);D=N,Me=R,N=E,R=P,E=M,P=w,M=c0(y,g,o,l),w=l0(g,g,o,l),y=_,g=A,_=m,A=x,m=d,x=a,d=c0(o,l,b,p),a=l0(o,l,b,p)}vt(this.h,0,d,a),vt(this.h,2,m,x),vt(this.h,4,_,A),vt(this.h,6,y,g),vt(this.h,8,M,w),vt(this.h,10,E,P),vt(this.h,12,N,R),vt(this.h,14,D,Me)};Je.prototype._digest=function(t){return t==="hex"?$e.toHex32(this.h,"big"):$e.split32(this.h,"big")};function Xa(f,t,n,h,d){var a=f&n^~f&d;return a<0&&(a+=4294967296),a}function Qa(f,t,n,h,d,a){var m=t&h^~t&a;return m<0&&(m+=4294967296),m}function ja(f,t,n,h,d){var a=f&n^f&d^n&d;return a<0&&(a+=4294967296),a}function en(f,t,n,h,d,a){var m=t&h^t&a^h&a;return m<0&&(m+=4294967296),m}function tn(f,t){var n=tt(f,t,28),h=tt(t,f,2),d=tt(t,f,7),a=n^h^d;return a<0&&(a+=4294967296),a}function rn(f,t){var n=rt(f,t,28),h=rt(t,f,2),d=rt(t,f,7),a=n^h^d;return a<0&&(a+=4294967296),a}function fn(f,t){var n=tt(f,t,14),h=tt(f,t,18),d=tt(t,f,9),a=n^h^d;return a<0&&(a+=4294967296),a}function an(f,t){var n=rt(f,t,14),h=rt(f,t,18),d=rt(t,f,9),a=n^h^d;return a<0&&(a+=4294967296),a}function nn(f,t){var n=tt(f,t,1),h=tt(f,t,8),d=Lf(f,t,7),a=n^h^d;return a<0&&(a+=4294967296),a}function hn(f,t){var n=rt(f,t,1),h=rt(f,t,8),d=Pf(f,t,7),a=n^h^d;return a<0&&(a+=4294967296),a}function sn(f,t){var n=tt(f,t,19),h=tt(t,f,29),d=Lf(f,t,6),a=n^h^d;return a<0&&(a+=4294967296),a}function dn(f,t){var n=rt(f,t,19),h=rt(t,f,29),d=Pf(f,t,6),a=n^h^d;return a<0&&(a+=4294967296),a}var w0=we,Nf=Rf;function ot(){if(!(this instanceof ot))return new ot;Nf.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}w0.inherits(ot,Nf);var on=ot;ot.blockSize=1024;ot.outSize=384;ot.hmacStrength=192;ot.padLength=128;ot.prototype._digest=function(t){return t==="hex"?w0.toHex32(this.h.slice(0,12),"big"):w0.split32(this.h.slice(0,12),"big")};rr.sha1=Ra;rr.sha224=Oa;rr.sha256=If;rr.sha384=on;rr.sha512=Rf;var Tf={},Ft=we,un=tr,zr=Ft.rotl32,K0=Ft.sum32,Br=Ft.sum32_3,H0=Ft.sum32_4,Cf=un.BlockHash;function at(){if(!(this instanceof at))return new at;Cf.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ft.inherits(at,Cf);Tf.ripemd160=at;at.blockSize=512;at.outSize=160;at.hmacStrength=192;at.padLength=64;at.prototype._update=function(t,n){for(var h=this.h[0],d=this.h[1],a=this.h[2],m=this.h[3],x=this.h[4],_=h,A=d,y=a,g=m,M=x,w=0;w<80;w++){var E=K0(zr(H0(h,G0(w,d,a,m),t[vn[w]+n],cn(w)),pn[w]),x);h=x,x=m,m=zr(a,10),a=d,d=E,E=K0(zr(H0(_,G0(79-w,A,y,g),t[bn[w]+n],ln(w)),xn[w]),M),_=M,M=g,g=zr(y,10),y=A,A=E}E=Br(this.h[1],a,g),this.h[1]=Br(this.h[2],m,M),this.h[2]=Br(this.h[3],x,_),this.h[3]=Br(this.h[4],h,A),this.h[4]=Br(this.h[0],d,y),this.h[0]=E};at.prototype._digest=function(t){return t==="hex"?Ft.toHex32(this.h,"little"):Ft.split32(this.h,"little")};function G0(f,t,n,h){return f<=15?t^n^h:f<=31?t&n|~t&h:f<=47?(t|~n)^h:f<=63?t&h|n&~h:t^(n|~h)}function cn(f){return f<=15?0:f<=31?1518500249:f<=47?1859775393:f<=63?2400959708:2840853838}function ln(f){return f<=15?1352829926:f<=31?1548603684:f<=47?1836072691:f<=63?2053994217:0}var vn=[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],bn=[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],pn=[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],xn=[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],mn=we,gn=Kt;function Xt(f,t,n){if(!(this instanceof Xt))return new Xt(f,t,n);this.Hash=f,this.blockSize=f.blockSize/8,this.outSize=f.outSize/8,this.inner=null,this.outer=null,this._init(mn.toArray(t,n))}var _n=Xt;Xt.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),gn(t.length<=this.blockSize);for(var n=t.length;n<this.blockSize;n++)t.push(0);for(n=0;n<t.length;n++)t[n]^=54;for(this.inner=new this.Hash().update(t),n=0;n<t.length;n++)t[n]^=106;this.outer=new this.Hash().update(t)};Xt.prototype.update=function(t,n){return this.inner.update(t,n),this};Xt.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};(function(f){var t=f;t.utils=we,t.common=tr,t.sha=rr,t.ripemd=Tf,t.hmac=_n,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(e0);var v0,Z0;function yn(){return Z0||(Z0=1,v0={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"]]}}),v0}(function(f){var t=f,n=e0,h=N0,d=Oe,a=d.assert;function m(A){A.type==="short"?this.curve=new h.short(A):A.type==="edwards"?this.curve=new h.edwards(A):this.curve=new h.mont(A),this.g=this.curve.g,this.n=this.curve.n,this.hash=A.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=m;function x(A,y){Object.defineProperty(t,A,{configurable:!0,enumerable:!0,get:function(){var g=new m(y);return Object.defineProperty(t,A,{configurable:!0,enumerable:!0,value:g}),g}})}x("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"]}),x("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"]}),x("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"]}),x("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"]}),x("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"]}),x("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"]}),x("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"]});var _;try{_=yn()}catch{_=void 0}x("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",_]})})(jr);var Mn=e0,Ut=B0,Df=Kt;function mt(f){if(!(this instanceof mt))return new mt(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ut.toArray(f.entropy,f.entropyEnc||"hex"),n=Ut.toArray(f.nonce,f.nonceEnc||"hex"),h=Ut.toArray(f.pers,f.persEnc||"hex");Df(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,h)}var wn=mt;mt.prototype._init=function(t,n,h){var d=t.concat(n).concat(h);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(d),this._reseed=1,this.reseedInterval=281474976710656};mt.prototype._hmac=function(){return new Mn.hmac(this.hash,this.K)};mt.prototype._update=function(t){var n=this._hmac().update(this.V).update([0]);t&&(n=n.update(t)),this.K=n.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())};mt.prototype.reseed=function(t,n,h,d){typeof n!="string"&&(d=h,h=n,n=null),t=Ut.toArray(t,n),h=Ut.toArray(h,d),Df(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(h||[])),this._reseed=1};mt.prototype.generate=function(t,n,h,d){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(d=h,h=n,n=null),h&&(h=Ut.toArray(h,d||"hex"),this._update(h));for(var a=[];a.length<t;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var m=a.slice(0,t);return this._update(h),this._reseed++,Ut.encode(m,n)};var An=lt,En=Oe,A0=En.assert;function ke(f,t){this.ec=f,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var In=ke;ke.fromPublic=function(t,n,h){return n instanceof ke?n:new ke(t,{pub:n,pubEnc:h})};ke.fromPrivate=function(t,n,h){return n instanceof ke?n:new ke(t,{priv:n,privEnc:h})};ke.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"}};ke.prototype.getPublic=function(t,n){return typeof t=="string"&&(n=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),n?this.pub.encode(n,t):this.pub};ke.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};ke.prototype._importPrivate=function(t,n){this.priv=new An(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)};ke.prototype._importPublic=function(t,n){if(t.x||t.y){this.ec.curve.type==="mont"?A0(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&A0(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,n)};ke.prototype.derive=function(t){return t.validate()||A0(t.validate(),"public point not validated"),t.mul(this.priv).getX()};ke.prototype.sign=function(t,n,h){return this.ec.sign(t,this,n,h)};ke.prototype.verify=function(t,n,h){return this.ec.verify(t,n,this,void 0,h)};ke.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Or=lt,C0=Oe,Sn=C0.assert;function r0(f,t){if(f instanceof r0)return f;this._importDER(f,t)||(Sn(f.r&&f.s,"Signature without r or s"),this.r=new Or(f.r,16),this.s=new Or(f.s,16),f.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=f.recoveryParam)}var Ln=r0;function Pn(){this.place=0}function b0(f,t){var n=f[t.place++];if(!(n&128))return n;var h=n&15;if(h===0||h>4||f[t.place]===0)return!1;for(var d=0,a=0,m=t.place;a<h;a++,m++)d<<=8,d|=f[m],d>>>=0;return d<=127?!1:(t.place=m,d)}function W0(f){for(var t=0,n=f.length-1;!f[t]&&!(f[t+1]&128)&&t<n;)t++;return t===0?f:f.slice(t)}r0.prototype._importDER=function(t,n){t=C0.toArray(t,n);var h=new Pn;if(t[h.place++]!==48)return!1;var d=b0(t,h);if(d===!1||d+h.place!==t.length||t[h.place++]!==2)return!1;var a=b0(t,h);if(a===!1||t[h.place]&128)return!1;var m=t.slice(h.place,a+h.place);if(h.place+=a,t[h.place++]!==2)return!1;var x=b0(t,h);if(x===!1||t.length!==x+h.place||t[h.place]&128)return!1;var _=t.slice(h.place,x+h.place);if(m[0]===0)if(m[1]&128)m=m.slice(1);else return!1;if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;return this.r=new Or(m),this.s=new Or(_),this.recoveryParam=null,!0};function p0(f,t){if(t<128){f.push(t);return}var n=1+(Math.log(t)/Math.LN2>>>3);for(f.push(n|128);--n;)f.push(t>>>(n<<3)&255);f.push(t)}r0.prototype.toDER=function(t){var n=this.r.toArray(),h=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),h[0]&128&&(h=[0].concat(h)),n=W0(n),h=W0(h);!h[0]&&!(h[1]&128);)h=h.slice(1);var d=[2];p0(d,n.length),d=d.concat(n),d.push(2),p0(d,h.length);var a=d.concat(h),m=[48];return p0(m,a.length),m=m.concat(a),C0.encode(m,t)};var Ze=lt,zf=wn,Bn=Oe,x0=jr,Rn=bf,$t=Bn.assert,D0=In,f0=Ln;function Fe(f){if(!(this instanceof Fe))return new Fe(f);typeof f=="string"&&($t(Object.prototype.hasOwnProperty.call(x0,f),"Unknown curve "+f),f=x0[f]),f instanceof x0.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}var Nn=Fe;Fe.prototype.keyPair=function(t){return new D0(this,t)};Fe.prototype.keyFromPrivate=function(t,n){return D0.fromPrivate(this,t,n)};Fe.prototype.keyFromPublic=function(t,n){return D0.fromPublic(this,t,n)};Fe.prototype.genKeyPair=function(t){t||(t={});for(var n=new zf({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Rn(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),d=this.n.sub(new Ze(2));;){var a=new Ze(n.generate(h));if(!(a.cmp(d)>0))return a.iaddn(1),this.keyFromPrivate(a)}};Fe.prototype._truncateToN=function(t,n,h){var d;if(Ze.isBN(t)||typeof t=="number")t=new Ze(t,16),d=t.byteLength();else if(typeof t=="object")d=t.length,t=new Ze(t,16);else{var a=t.toString();d=a.length+1>>>1,t=new Ze(a,16)}typeof h!="number"&&(h=d*8);var m=h-this.n.bitLength();return m>0&&(t=t.ushrn(m)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t};Fe.prototype.sign=function(t,n,h,d){if(typeof h=="object"&&(d=h,h=null),d||(d={}),typeof t!="string"&&typeof t!="number"&&!Ze.isBN(t)){$t(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),$t(t.length>>>0===t.length);for(var a=0;a<t.length;a++)$t((t[a]&255)===t[a])}n=this.keyFromPrivate(n,h),t=this._truncateToN(t,!1,d.msgBitLength),$t(!t.isNeg(),"Can not sign a negative message");var m=this.n.byteLength(),x=n.getPrivate().toArray("be",m),_=t.toArray("be",m);$t(new Ze(_).eq(t),"Can not sign message");for(var A=new zf({hash:this.hash,entropy:x,nonce:_,pers:d.pers,persEnc:d.persEnc||"utf8"}),y=this.n.sub(new Ze(1)),g=0;;g++){var M=d.k?d.k(g):new Ze(A.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(y)>=0)){var w=this.g.mul(M);if(!w.isInfinity()){var E=w.getX(),P=E.umod(this.n);if(P.cmpn(0)!==0){var N=M.invm(this.n).mul(P.mul(n.getPrivate()).iadd(t));if(N=N.umod(this.n),N.cmpn(0)!==0){var R=(w.getY().isOdd()?1:0)|(E.cmp(P)!==0?2:0);return d.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),R^=1),new f0({r:P,s:N,recoveryParam:R})}}}}}};Fe.prototype.verify=function(t,n,h,d,a){a||(a={}),t=this._truncateToN(t,!1,a.msgBitLength),h=this.keyFromPublic(h,d),n=new f0(n,"hex");var m=n.r,x=n.s;if(m.cmpn(1)<0||m.cmp(this.n)>=0||x.cmpn(1)<0||x.cmp(this.n)>=0)return!1;var _=x.invm(this.n),A=_.mul(t).umod(this.n),y=_.mul(m).umod(this.n),g;return this.curve._maxwellTrick?(g=this.g.jmulAdd(A,h.getPublic(),y),g.isInfinity()?!1:g.eqXToP(m)):(g=this.g.mulAdd(A,h.getPublic(),y),g.isInfinity()?!1:g.getX().umod(this.n).cmp(m)===0)};Fe.prototype.recoverPubKey=function(f,t,n,h){$t((3&n)===n,"The recovery param is more than two bits"),t=new f0(t,h);var d=this.n,a=new Ze(f),m=t.r,x=t.s,_=n&1,A=n>>1;if(m.cmp(this.curve.p.umod(this.curve.n))>=0&&A)throw new Error("Unable to find sencond key candinate");A?m=this.curve.pointFromX(m.add(this.curve.n),_):m=this.curve.pointFromX(m,_);var y=t.r.invm(d),g=d.sub(a).mul(y).umod(d),M=x.mul(y).umod(d);return this.g.mulAdd(g,m,M)};Fe.prototype.getKeyRecoveryParam=function(f,t,n,h){if(t=new f0(t,h),t.recoveryParam!==null)return t.recoveryParam;for(var d=0;d<4;d++){var a;try{a=this.recoverPubKey(f,t,d)}catch{continue}if(a.eq(n))return d}throw new Error("Unable to find valid recovery factor")};var Dr=Oe,qf=Dr.assert,J0=Dr.parseBytes,ir=Dr.cachedProperty;function Re(f,t){this.eddsa=f,this._secret=J0(t.secret),f.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=J0(t.pub)}Re.fromPublic=function(t,n){return n instanceof Re?n:new Re(t,{pub:n})};Re.fromSecret=function(t,n){return n instanceof Re?n:new Re(t,{secret:n})};Re.prototype.secret=function(){return this._secret};ir(Re,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});ir(Re,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});ir(Re,"privBytes",function(){var t=this.eddsa,n=this.hash(),h=t.encodingLength-1,d=n.slice(0,t.encodingLength);return d[0]&=248,d[h]&=127,d[h]|=64,d});ir(Re,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});ir(Re,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});ir(Re,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Re.prototype.sign=function(t){return qf(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};Re.prototype.verify=function(t,n){return this.eddsa.verify(t,n,this)};Re.prototype.getSecret=function(t){return qf(this._secret,"KeyPair is public only"),Dr.encode(this.secret(),t)};Re.prototype.getPublic=function(t){return Dr.encode(this.pubBytes(),t)};var Tn=Re,Cn=lt,i0=Oe,X0=i0.assert,a0=i0.cachedProperty,Dn=i0.parseBytes;function Ht(f,t){this.eddsa=f,typeof t!="object"&&(t=Dn(t)),Array.isArray(t)&&(X0(t.length===f.encodingLength*2,"Signature has invalid size"),t={R:t.slice(0,f.encodingLength),S:t.slice(f.encodingLength)}),X0(t.R&&t.S,"Signature without R or S"),f.isPoint(t.R)&&(this._R=t.R),t.S instanceof Cn&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a0(Ht,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});a0(Ht,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});a0(Ht,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});a0(Ht,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Ht.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Ht.prototype.toHex=function(){return i0.encode(this.toBytes(),"hex").toUpperCase()};var zn=Ht,qn=e0,Vn=jr,Qt=Oe,Yn=Qt.assert,Vf=Qt.parseBytes,Yf=Tn,Q0=zn;function Ue(f){if(Yn(f==="ed25519","only tested with ed25519 so far"),!(this instanceof Ue))return new Ue(f);f=Vn[f].curve,this.curve=f,this.g=f.g,this.g.precompute(f.n.bitLength()+1),this.pointClass=f.point().constructor,this.encodingLength=Math.ceil(f.n.bitLength()/8),this.hash=qn.sha512}var kn=Ue;Ue.prototype.sign=function(t,n){t=Vf(t);var h=this.keyFromSecret(n),d=this.hashInt(h.messagePrefix(),t),a=this.g.mul(d),m=this.encodePoint(a),x=this.hashInt(m,h.pubBytes(),t).mul(h.priv()),_=d.add(x).umod(this.curve.n);return this.makeSignature({R:a,S:_,Rencoded:m})};Ue.prototype.verify=function(t,n,h){if(t=Vf(t),n=this.makeSignature(n),n.S().gte(n.eddsa.curve.n)||n.S().isNeg())return!1;var d=this.keyFromPublic(h),a=this.hashInt(n.Rencoded(),d.pubBytes(),t),m=this.g.mul(n.S()),x=n.R().add(d.pub().mul(a));return x.eq(m)};Ue.prototype.hashInt=function(){for(var t=this.hash(),n=0;n<arguments.length;n++)t.update(arguments[n]);return Qt.intFromLE(t.digest()).umod(this.curve.n)};Ue.prototype.keyFromPublic=function(t){return Yf.fromPublic(this,t)};Ue.prototype.keyFromSecret=function(t){return Yf.fromSecret(this,t)};Ue.prototype.makeSignature=function(t){return t instanceof Q0?t:new Q0(this,t)};Ue.prototype.encodePoint=function(t){var n=t.getY().toArray("le",this.encodingLength);return n[this.encodingLength-1]|=t.getX().isOdd()?128:0,n};Ue.prototype.decodePoint=function(t){t=Qt.parseBytes(t);var n=t.length-1,h=t.slice(0,n).concat(t[n]&-129),d=(t[n]&128)!==0,a=Qt.intFromLE(h);return this.curve.pointFromY(a,d)};Ue.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};Ue.prototype.decodeInt=function(t){return Qt.intFromLE(t)};Ue.prototype.isPoint=function(t){return t instanceof this.pointClass};(function(f){var t=f;t.version=Vi.version,t.utils=Oe,t.rand=bf,t.curve=N0,t.curves=jr,t.ec=Nn,t.eddsa=kn})(lf);var qr=ut.Buffer;function $n(f){if(f.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var h=0;h<f.length;h++){var d=f.charAt(h),a=d.charCodeAt(0);if(t[a]!==255)throw new TypeError(d+" is ambiguous");t[a]=h}var m=f.length,x=f.charAt(0),_=Math.log(m)/Math.log(256),A=Math.log(256)/Math.log(m);function y(w){if((Array.isArray(w)||w instanceof Uint8Array)&&(w=qr.from(w)),!qr.isBuffer(w))throw new TypeError("Expected Buffer");if(w.length===0)return"";for(var E=0,P=0,N=0,R=w.length;N!==R&&w[N]===0;)N++,E++;for(var D=(R-N)*A+1>>>0,Me=new Uint8Array(D);N!==R;){for(var k=w[N],Ae=0,Ie=D-1;(k!==0||Ae<P)&&Ie!==-1;Ie--,Ae++)k+=256*Me[Ie]>>>0,Me[Ie]=k%m>>>0,k=k/m>>>0;if(k!==0)throw new Error("Non-zero carry");P=Ae,N++}for(var Ee=D-P;Ee!==D&&Me[Ee]===0;)Ee++;for(var Le=x.repeat(E);Ee<D;++Ee)Le+=f.charAt(Me[Ee]);return Le}function g(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return qr.alloc(0);for(var E=0,P=0,N=0;w[E]===x;)P++,E++;for(var R=(w.length-E)*_+1>>>0,D=new Uint8Array(R);E<w.length;){var Me=w.charCodeAt(E);if(Me>255)return;var k=t[Me];if(k===255)return;for(var Ae=0,Ie=R-1;(k!==0||Ae<N)&&Ie!==-1;Ie--,Ae++)k+=m*D[Ie]>>>0,D[Ie]=k%256>>>0,k=k/256>>>0;if(k!==0)throw new Error("Non-zero carry");N=Ae,E++}for(var Ee=R-N;Ee!==R&&D[Ee]===0;)Ee++;var Le=qr.allocUnsafe(P+(R-Ee));Le.fill(0,0,P);for(var q=P;Ee!==R;)Le[q++]=D[Ee++];return Le}function M(w){var E=g(w);if(E)return E;throw new Error("Non-base"+m+" character")}return{encode:y,decodeUnsafe:g,decode:M}}var Un=$n,On=Un,Fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Kn=On(Fn),m0=Kn,Hn=ut.Buffer,Gn=function(f){function t(a){var m=f(a);return m0.encode(Hn.concat([a,m],a.length+4))}function n(a){var m=a.slice(0,-4),x=a.slice(-4),_=f(m);if(!(x[0]^_[0]|x[1]^_[1]|x[2]^_[2]|x[3]^_[3]))return m}function h(a){var m=m0.decodeUnsafe(a);if(m)return n(m)}function d(a){var m=m0.decode(a),x=n(m);if(!x)throw new Error("Invalid checksum");return x}return{encode:t,decode:d,decodeUnsafe:h}},j0=L0,Zn=Gn;function Wn(f){var t=j0("sha256").update(f).digest();return j0("sha256").update(t).digest()}var Jn=Zn(Wn),Fr="qpzry9x8gf2tvdw0s3jn54khce6mua7l",E0={};for(var Vr=0;Vr<Fr.length;Vr++){var g0=Fr.charAt(Vr);if(E0[g0]!==void 0)throw new TypeError(g0+" is ambiguous");E0[g0]=Vr}function Zt(f){var t=f>>25;return(f&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function kf(f){for(var t=1,n=0;n<f.length;++n){var h=f.charCodeAt(n);if(h<33||h>126)return"Invalid prefix ("+f+")";t=Zt(t)^h>>5}for(t=Zt(t),n=0;n<f.length;++n){var d=f.charCodeAt(n);t=Zt(t)^d&31}return t}function Xn(f,t,n){if(n=n||90,f.length+7+t.length>n)throw new TypeError("Exceeds length limit");f=f.toLowerCase();var h=kf(f);if(typeof h=="string")throw new Error(h);for(var d=f+"1",a=0;a<t.length;++a){var m=t[a];if(m>>5)throw new Error("Non 5-bit word");h=Zt(h)^m,d+=Fr.charAt(m)}for(a=0;a<6;++a)h=Zt(h);for(h^=1,a=0;a<6;++a){var x=h>>(5-a)*5&31;d+=Fr.charAt(x)}return d}function $f(f,t){if(t=t||90,f.length<8)return f+" too short";if(f.length>t)return"Exceeds length limit";var n=f.toLowerCase(),h=f.toUpperCase();if(f!==n&&f!==h)return"Mixed-case string "+f;f=n;var d=f.lastIndexOf("1");if(d===-1)return"No separator character for "+f;if(d===0)return"Missing prefix for "+f;var a=f.slice(0,d),m=f.slice(d+1);if(m.length<6)return"Data too short";var x=kf(a);if(typeof x=="string")return x;for(var _=[],A=0;A<m.length;++A){var y=m.charAt(A),g=E0[y];if(g===void 0)return"Unknown character "+y;x=Zt(x)^g,!(A+6>=m.length)&&_.push(g)}return x!==1?"Invalid checksum for "+f:{prefix:a,words:_}}function Qn(){var f=$f.apply(null,arguments);if(typeof f=="object")return f}function jn(f){var t=$f.apply(null,arguments);if(typeof t=="object")return t;throw new Error(t)}function n0(f,t,n,h){for(var d=0,a=0,m=(1<<n)-1,x=[],_=0;_<f.length;++_)for(d=d<<t|f[_],a+=t;a>=n;)a-=n,x.push(d>>a&m);if(h)a>0&&x.push(d<<n-a&m);else{if(a>=t)return"Excess padding";if(d<<n-a&m)return"Non-zero padding"}return x}function eh(f){var t=n0(f,8,5,!0);if(Array.isArray(t))return t}function th(f){var t=n0(f,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)}function rh(f){var t=n0(f,5,8,!1);if(Array.isArray(t))return t}function fh(f){var t=n0(f,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}var ih={decodeUnsafe:Qn,decode:jn,encode:Xn,toWordsUnsafe:eh,toWords:th,fromWordsUnsafe:rh,fromWords:fh},ah=function(f,t){if(!Buffer.isBuffer(f)||!Buffer.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(f===t)return!0;if(typeof f.equals=="function")return f.equals(t);if(f.length!==t.length)return!1;for(var n=0;n<f.length;n++)if(f[n]!==t[n])return!1;return!0},Qe={},h0=Object.prototype.toString;Qe.isArray=function(f,t){if(!Array.isArray(f))throw TypeError(t)};Qe.isBoolean=function(f,t){if(h0.call(f)!=="[object Boolean]")throw TypeError(t)};Qe.isBuffer=function(f,t){if(!Buffer.isBuffer(f))throw TypeError(t)};Qe.isFunction=function(f,t){if(h0.call(f)!=="[object Function]")throw TypeError(t)};Qe.isNumber=function(f,t){if(h0.call(f)!=="[object Number]")throw TypeError(t)};Qe.isObject=function(f,t){if(h0.call(f)!=="[object Object]")throw TypeError(t)};Qe.isBufferLength=function(f,t,n){if(f.length!==t)throw RangeError(n)};Qe.isBufferLength2=function(f,t,n,h){if(f.length!==t&&f.length!==n)throw RangeError(h)};Qe.isLengthGTZero=function(f,t){if(f.length===0)throw RangeError(t)};Qe.isNumberInInterval=function(f,t,n,h){if(f<=t||f>=n)throw RangeError(h)};var ar={},nh=ut.Buffer;function hh(f){if(f.length<8||f.length>72||f[0]!==48||f[1]!==f.length-2||f[2]!==2)return!1;var t=f[3];if(t===0||5+t>=f.length||f[4+t]!==2)return!1;var n=f[5+t];return!(n===0||6+t+n!==f.length||f[4]&128||t>1&&f[4]===0&&!(f[5]&128)||f[t+6]&128||n>1&&f[t+6]===0&&!(f[t+7]&128))}function sh(f){if(f.length<8)throw new Error("DER sequence length is too short");if(f.length>72)throw new Error("DER sequence length is too long");if(f[0]!==48)throw new Error("Expected DER sequence");if(f[1]!==f.length-2)throw new Error("DER sequence length is invalid");if(f[2]!==2)throw new Error("Expected DER integer");var t=f[3];if(t===0)throw new Error("R length is zero");if(5+t>=f.length)throw new Error("R length is too long");if(f[4+t]!==2)throw new Error("Expected DER integer (2)");var n=f[5+t];if(n===0)throw new Error("S length is zero");if(6+t+n!==f.length)throw new Error("S length is invalid");if(f[4]&128)throw new Error("R value is negative");if(t>1&&f[4]===0&&!(f[5]&128))throw new Error("R value excessively padded");if(f[t+6]&128)throw new Error("S value is negative");if(n>1&&f[t+6]===0&&!(f[t+7]&128))throw new Error("S value excessively padded");return{r:f.slice(4,4+t),s:f.slice(6+t)}}function dh(f,t){var n=f.length,h=t.length;if(n===0)throw new Error("R length is zero");if(h===0)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(h>33)throw new Error("S length is too long");if(f[0]&128)throw new Error("R value is negative");if(t[0]&128)throw new Error("S value is negative");if(n>1&&f[0]===0&&!(f[1]&128))throw new Error("R value excessively padded");if(h>1&&t[0]===0&&!(t[1]&128))throw new Error("S value excessively padded");var d=nh.allocUnsafe(6+n+h);return d[0]=48,d[1]=d.length-2,d[2]=2,d[3]=f.length,f.copy(d,4),d[4+n]=2,d[5+n]=t.length,t.copy(d,6+n),d}var oh={check:hh,decode:sh,encode:dh},We=ut.Buffer,Uf=oh,uh=We.from([48,129,211,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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,0,0,0,0,0,0,0,0,0]),ch=We.from([48,130,1,19,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);ar.privateKeyExport=function(f,t,n){var h=We.from(n?uh:ch);return f.copy(h,n?8:9),t.copy(h,n?181:214),h};ar.privateKeyImport=function(f){var t=f.length,n=0;if(!(t<n+1||f[n]!==48)&&(n+=1,!(t<n+1||!(f[n]&128)))){var h=f[n]&127;if(n+=1,!(h<1||h>2)&&!(t<n+h)){var d=f[n+h-1]|(h>1?f[n+h-2]<<8:0);if(n+=h,!(t<n+d)&&!(t<n+3||f[n]!==2||f[n+1]!==1||f[n+2]!==1)&&(n+=3,!(t<n+2||f[n]!==4||f[n+1]>32||t<n+2+f[n+1])))return f.slice(n+2,n+2+f[n+1])}}};ar.signatureExport=function(f){for(var t=We.concat([We.from([0]),f.r]),n=33,h=0;n>1&&t[h]===0&&!(t[h+1]&128);--n,++h);for(var d=We.concat([We.from([0]),f.s]),a=33,m=0;a>1&&d[m]===0&&!(d[m+1]&128);--a,++m);return Uf.encode(t.slice(h),d.slice(m))};ar.signatureImport=function(f){var t=We.alloc(32,0),n=We.alloc(32,0);try{var h=Uf.decode(f);if(h.r.length===33&&h.r[0]===0&&(h.r=h.r.slice(1)),h.r.length>32)throw new Error("R length is too long");if(h.s.length===33&&h.s[0]===0&&(h.s=h.s.slice(1)),h.s.length>32)throw new Error("S length is too long")}catch{return}return h.r.copy(t,32-h.r.length),h.s.copy(n,32-h.s.length),{r:t,s:n}};ar.signatureImportLax=function(f){var t=We.alloc(32,0),n=We.alloc(32,0),h=f.length,d=0;if(f[d++]===48){var a=f[d++];if(!(a&128&&(d+=a-128,d>h))&&f[d++]===2){var m=f[d++];if(m&128){if(a=m-128,d+a>h)return;for(;a>0&&f[d]===0;d+=1,a-=1);for(m=0;a>0;d+=1,a-=1)m=(m<<8)+f[d]}if(!(m>h-d)){var x=d;if(d+=m,f[d++]===2){var _=f[d++];if(_&128){if(a=_-128,d+a>h)return;for(;a>0&&f[d]===0;d+=1,a-=1);for(_=0;a>0;d+=1,a-=1)_=(_<<8)+f[d]}if(!(_>h-d)){var A=d;for(d+=_;m>0&&f[x]===0;m-=1,x+=1);if(!(m>32)){var y=f.slice(x,x+m);for(y.copy(t,32-y.length);_>0&&f[A]===0;_-=1,A+=1);if(!(_>32)){var g=f.slice(A,A+_);return g.copy(n,32-g.length),{r:t,s:n}}}}}}}}};const lh="compressed should be a boolean",vh="private key should be a Buffer",bh="private key length is invalid",ph="private key range is invalid",xh="tweak out of range or resulting private key is invalid",mh="tweak out of range",gh="couldn't export to DER format",_h="couldn't import from DER format",yh="public keys should be an Array",Mh="public keys Array should have at least 1 element",wh="public key should be a Buffer",Ah="public key length is invalid",Eh="the public key could not be parsed or is invalid",Ih="private was invalid, try again",Sh="tweak out of range or resulting public key is invalid",Lh="tweak out of range",Ph="the sum of the public keys is not valid",Bh="scalar was invalid (zero or overflow)",Rh="signature should be a Buffer",Nh="signature length is invalid",Th="couldn't parse signature",Ch="couldn't parse DER signature",Dh="couldn't serialize signature to DER format",zh="nonce generation function failed or private key is invalid",qh="couldn't recover public key from signature",Vh="message should be a Buffer",Yh="message length is invalid",kh="options should be an Object",$h="options.data should be a Buffer",Uh="options.data length is invalid",Oh="options.noncefn should be a Function",Fh="recovery should be a Number",Kh="recovery should have value between -1 and 4",Hh="tweak should be a Buffer",Gh="tweak length is invalid",Of={COMPRESSED_TYPE_INVALID:lh,EC_PRIVATE_KEY_TYPE_INVALID:vh,EC_PRIVATE_KEY_LENGTH_INVALID:bh,EC_PRIVATE_KEY_RANGE_INVALID:ph,EC_PRIVATE_KEY_TWEAK_ADD_FAIL:xh,EC_PRIVATE_KEY_TWEAK_MUL_FAIL:mh,EC_PRIVATE_KEY_EXPORT_DER_FAIL:gh,EC_PRIVATE_KEY_IMPORT_DER_FAIL:_h,EC_PUBLIC_KEYS_TYPE_INVALID:yh,EC_PUBLIC_KEYS_LENGTH_INVALID:Mh,EC_PUBLIC_KEY_TYPE_INVALID:wh,EC_PUBLIC_KEY_LENGTH_INVALID:Ah,EC_PUBLIC_KEY_PARSE_FAIL:Eh,EC_PUBLIC_KEY_CREATE_FAIL:Ih,EC_PUBLIC_KEY_TWEAK_ADD_FAIL:Sh,EC_PUBLIC_KEY_TWEAK_MUL_FAIL:Lh,EC_PUBLIC_KEY_COMBINE_FAIL:Ph,ECDH_FAIL:Bh,ECDSA_SIGNATURE_TYPE_INVALID:Rh,ECDSA_SIGNATURE_LENGTH_INVALID:Nh,ECDSA_SIGNATURE_PARSE_FAIL:Th,ECDSA_SIGNATURE_PARSE_DER_FAIL:Ch,ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:Dh,ECDSA_SIGN_FAIL:zh,ECDSA_RECOVER_FAIL:qh,MSG32_TYPE_INVALID:Vh,MSG32_LENGTH_INVALID:Yh,OPTIONS_TYPE_INVALID:kh,OPTIONS_DATA_TYPE_INVALID:$h,OPTIONS_DATA_LENGTH_INVALID:Uh,OPTIONS_NONCEFN_TYPE_INVALID:Oh,RECOVERY_ID_TYPE_INVALID:Fh,RECOVERY_ID_VALUE_INVALID:Kh,TWEAK_TYPE_INVALID:Hh,TWEAK_LENGTH_INVALID:Gh};var C=Qe,Rr=ar,T=Of;function bt(f,t){return f===void 0?t:(C.isBoolean(f,T.COMPRESSED_TYPE_INVALID),f)}var Zh=function(f){return{privateKeyVerify:function(t){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),t.length===32&&f.privateKeyVerify(t)},privateKeyExport:function(t,n){C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),n=bt(n,!0);var h=f.privateKeyExport(t,n);return Rr.privateKeyExport(t,h,n)},privateKeyImport:function(t){if(C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),t=Rr.privateKeyImport(t),t&&t.length===32&&f.privateKeyVerify(t))return t;throw new Error(T.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),f.privateKeyNegate(t)},privateKeyModInverse:function(t){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),f.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,n){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),C.isBuffer(n,T.TWEAK_TYPE_INVALID),C.isBufferLength(n,32,T.TWEAK_LENGTH_INVALID),f.privateKeyTweakAdd(t,n)},privateKeyTweakMul:function(t,n){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),C.isBuffer(n,T.TWEAK_TYPE_INVALID),C.isBufferLength(n,32,T.TWEAK_LENGTH_INVALID),f.privateKeyTweakMul(t,n)},publicKeyCreate:function(t,n){return C.isBuffer(t,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(t,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),n=bt(n,!0),f.publicKeyCreate(t,n)},publicKeyConvert:function(t,n){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),n=bt(n,!0),f.publicKeyConvert(t,n)},publicKeyVerify:function(t){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),f.publicKeyVerify(t)},publicKeyTweakAdd:function(t,n,h){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),C.isBuffer(n,T.TWEAK_TYPE_INVALID),C.isBufferLength(n,32,T.TWEAK_LENGTH_INVALID),h=bt(h,!0),f.publicKeyTweakAdd(t,n,h)},publicKeyTweakMul:function(t,n,h){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),C.isBuffer(n,T.TWEAK_TYPE_INVALID),C.isBufferLength(n,32,T.TWEAK_LENGTH_INVALID),h=bt(h,!0),f.publicKeyTweakMul(t,n,h)},publicKeyCombine:function(t,n){C.isArray(t,T.EC_PUBLIC_KEYS_TYPE_INVALID),C.isLengthGTZero(t,T.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var h=0;h<t.length;++h)C.isBuffer(t[h],T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t[h],33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID);return n=bt(n,!0),f.publicKeyCombine(t,n)},signatureNormalize:function(t){return C.isBuffer(t,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isBufferLength(t,64,T.ECDSA_SIGNATURE_LENGTH_INVALID),f.signatureNormalize(t)},signatureExport:function(t){C.isBuffer(t,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isBufferLength(t,64,T.ECDSA_SIGNATURE_LENGTH_INVALID);var n=f.signatureExport(t);return Rr.signatureExport(n)},signatureImport:function(t){C.isBuffer(t,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isLengthGTZero(t,T.ECDSA_SIGNATURE_LENGTH_INVALID);var n=Rr.signatureImport(t);if(n)return f.signatureImport(n);throw new Error(T.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(t){C.isBuffer(t,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isLengthGTZero(t,T.ECDSA_SIGNATURE_LENGTH_INVALID);var n=Rr.signatureImportLax(t);if(n)return f.signatureImport(n);throw new Error(T.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(t,n,h){C.isBuffer(t,T.MSG32_TYPE_INVALID),C.isBufferLength(t,32,T.MSG32_LENGTH_INVALID),C.isBuffer(n,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(n,32,T.EC_PRIVATE_KEY_LENGTH_INVALID);var d=null,a=null;return h!==void 0&&(C.isObject(h,T.OPTIONS_TYPE_INVALID),h.data!==void 0&&(C.isBuffer(h.data,T.OPTIONS_DATA_TYPE_INVALID),C.isBufferLength(h.data,32,T.OPTIONS_DATA_LENGTH_INVALID),d=h.data),h.noncefn!==void 0&&(C.isFunction(h.noncefn,T.OPTIONS_NONCEFN_TYPE_INVALID),a=h.noncefn)),f.sign(t,n,a,d)},verify:function(t,n,h){return C.isBuffer(t,T.MSG32_TYPE_INVALID),C.isBufferLength(t,32,T.MSG32_LENGTH_INVALID),C.isBuffer(n,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isBufferLength(n,64,T.ECDSA_SIGNATURE_LENGTH_INVALID),C.isBuffer(h,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(h,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),f.verify(t,n,h)},recover:function(t,n,h,d){return C.isBuffer(t,T.MSG32_TYPE_INVALID),C.isBufferLength(t,32,T.MSG32_LENGTH_INVALID),C.isBuffer(n,T.ECDSA_SIGNATURE_TYPE_INVALID),C.isBufferLength(n,64,T.ECDSA_SIGNATURE_LENGTH_INVALID),C.isNumber(h,T.RECOVERY_ID_TYPE_INVALID),C.isNumberInInterval(h,-1,4,T.RECOVERY_ID_VALUE_INVALID),d=bt(d,!0),f.recover(t,n,h,d)},ecdh:function(t,n){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),C.isBuffer(n,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(n,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),f.ecdh(t,n)},ecdhUnsafe:function(t,n,h){return C.isBuffer(t,T.EC_PUBLIC_KEY_TYPE_INVALID),C.isBufferLength2(t,33,65,T.EC_PUBLIC_KEY_LENGTH_INVALID),C.isBuffer(n,T.EC_PRIVATE_KEY_TYPE_INVALID),C.isBufferLength(n,32,T.EC_PRIVATE_KEY_LENGTH_INVALID),h=bt(h,!0),f.ecdhUnsafe(t,n,h)}}},Ff={},z0={exports:{}};z0.exports;(function(f){(function(t,n){function h(v,e){if(!v)throw new Error(e||"Assertion failed")}function d(v,e){v.super_=e;var i=function(){};i.prototype=e.prototype,v.prototype=new i,v.prototype.constructor=v}function a(v,e,i){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(i=e,e=10),this._init(v||0,e||10,i||"be"))}typeof t=="object"?t.exports=a:n.BN=a,a.BN=a,a.wordSize=26;var m;try{typeof window<"u"&&typeof window.Buffer<"u"?m=window.Buffer:m=Kr.Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,i){return e.cmp(i)>0?e:i},a.min=function(e,i){return e.cmp(i)<0?e:i},a.prototype._init=function(e,i,s){if(typeof e=="number")return this._initNumber(e,i,s);if(typeof e=="object")return this._initArray(e,i,s);i==="hex"&&(i=16),h(i===(i|0)&&i>=2&&i<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(i===16?this._parseHex(e,o,s):(this._parseBase(e,i,o),s==="le"&&this._initArray(this.toArray(),i,s)))},a.prototype._initNumber=function(e,i,s){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(h(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),s==="le"&&this._initArray(this.toArray(),i,s)},a.prototype._initArray=function(e,i,s){if(h(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var l,b,p=0;if(s==="be")for(o=e.length-1,l=0;o>=0;o-=3)b=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[l]|=b<<p&67108863,this.words[l+1]=b>>>26-p&67108863,p+=24,p>=26&&(p-=26,l++);else if(s==="le")for(o=0,l=0;o<e.length;o+=3)b=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[l]|=b<<p&67108863,this.words[l+1]=b>>>26-p&67108863,p+=24,p>=26&&(p-=26,l++);return this.strip()};function x(v,e){var i=v.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function _(v,e,i){var s=x(v,i);return i-1>=e&&(s|=x(v,i-1)<<4),s}a.prototype._parseHex=function(e,i,s){this.length=Math.ceil((e.length-i)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var l=0,b=0,p;if(s==="be")for(o=e.length-1;o>=i;o-=2)p=_(e,i,o)<<l,this.words[b]|=p&67108863,l>=18?(l-=18,b+=1,this.words[b]|=p>>>26):l+=8;else{var u=e.length-i;for(o=u%2===0?i+1:i;o<e.length;o+=2)p=_(e,i,o)<<l,this.words[b]|=p&67108863,l>=18?(l-=18,b+=1,this.words[b]|=p>>>26):l+=8}this.strip()};function A(v,e,i,s){for(var o=0,l=Math.min(v.length,i),b=e;b<l;b++){var p=v.charCodeAt(b)-48;o*=s,p>=49?o+=p-49+10:p>=17?o+=p-17+10:o+=p}return o}a.prototype._parseBase=function(e,i,s){this.words=[0],this.length=1;for(var o=0,l=1;l<=67108863;l*=i)o++;o--,l=l/i|0;for(var b=e.length-s,p=b%o,u=Math.min(b,b-p)+s,r=0,c=s;c<u;c+=o)r=A(e,c,c+o,i),this.imuln(l),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r);if(p!==0){var I=1;for(r=A(e,c,e.length,i),c=0;c<p;c++)I*=i;this.imuln(I),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var i=0;i<this.length;i++)e.words[i]=this.words[i];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","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"],g=[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],M=[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];a.prototype.toString=function(e,i){e=e||10,i=i|0||1;var s;if(e===16||e==="hex"){s="";for(var o=0,l=0,b=0;b<this.length;b++){var p=this.words[b],u=((p<<o|l)&16777215).toString(16);l=p>>>24-o&16777215,o+=2,o>=26&&(o-=26,b--),l!==0||b!==this.length-1?s=y[6-u.length]+u+s:s=u+s}for(l!==0&&(s=l.toString(16)+s);s.length%i!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}if(e===(e|0)&&e>=2&&e<=36){var r=g[e],c=M[e];s="";var I=this.clone();for(I.negative=0;!I.isZero();){var S=I.modn(c).toString(e);I=I.idivn(c),I.isZero()?s=S+s:s=y[r-S.length]+S+s}for(this.isZero()&&(s="0"+s);s.length%i!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}h(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&h(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,i){return h(typeof m<"u"),this.toArrayLike(m,e,i)},a.prototype.toArray=function(e,i){return this.toArrayLike(Array,e,i)},a.prototype.toArrayLike=function(e,i,s){var o=this.byteLength(),l=s||Math.max(1,o);h(o<=l,"byte array longer than desired length"),h(l>0,"Requested array length <= 0"),this.strip();var b=i==="le",p=new e(l),u,r,c=this.clone();if(b){for(r=0;!c.isZero();r++)u=c.andln(255),c.iushrn(8),p[r]=u;for(;r<l;r++)p[r]=0}else{for(r=0;r<l-o;r++)p[r]=0;for(r=0;!c.isZero();r++)u=c.andln(255),c.iushrn(8),p[l-r-1]=u}return p},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var i=e,s=0;return i>=4096&&(s+=13,i>>>=13),i>=64&&(s+=7,i>>>=7),i>=8&&(s+=4,i>>>=4),i>=2&&(s+=2,i>>>=2),s+i},a.prototype._zeroBits=function(e){if(e===0)return 26;var i=e,s=0;return i&8191||(s+=13,i>>>=13),i&127||(s+=7,i>>>=7),i&15||(s+=4,i>>>=4),i&3||(s+=2,i>>>=2),i&1||s++,s},a.prototype.bitLength=function(){var e=this.words[this.length-1],i=this._countBits(e);return(this.length-1)*26+i};function w(v){for(var e=new Array(v.bitLength()),i=0;i<e.length;i++){var s=i/26|0,o=i%26;e[i]=(v.words[s]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,i=0;i<this.length;i++){var s=this._zeroBits(this.words[i]);if(e+=s,s!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]|e.words[i];return this.strip()},a.prototype.ior=function(e){return h((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var i;this.length>e.length?i=e:i=this;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]&e.words[s];return this.length=i.length,this.strip()},a.prototype.iand=function(e){return h((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var i,s;this.length>e.length?(i=this,s=e):(i=e,s=this);for(var o=0;o<s.length;o++)this.words[o]=i.words[o]^s.words[o];if(this!==i)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=i.length,this.strip()},a.prototype.ixor=function(e){return h((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){h(typeof e=="number"&&e>=0);var i=Math.ceil(e/26)|0,s=e%26;this._expand(i),s>0&&i--;for(var o=0;o<i;o++)this.words[o]=~this.words[o]&67108863;return s>0&&(this.words[o]=~this.words[o]&67108863>>26-s),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,i){h(typeof e=="number"&&e>=0);var s=e/26|0,o=e%26;return this._expand(s+1),i?this.words[s]=this.words[s]|1<<o:this.words[s]=this.words[s]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var i;if(this.negative!==0&&e.negative===0)return this.negative=0,i=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,i=this.isub(e),e.negative=1,i._normSign();var s,o;this.length>e.length?(s=this,o=e):(s=e,o=this);for(var l=0,b=0;b<o.length;b++)i=(s.words[b]|0)+(o.words[b]|0)+l,this.words[b]=i&67108863,l=i>>>26;for(;l!==0&&b<s.length;b++)i=(s.words[b]|0)+l,this.words[b]=i&67108863,l=i>>>26;if(this.length=s.length,l!==0)this.words[this.length]=l,this.length++;else if(s!==this)for(;b<s.length;b++)this.words[b]=s.words[b];return this},a.prototype.add=function(e){var i;return e.negative!==0&&this.negative===0?(e.negative=0,i=this.sub(e),e.negative^=1,i):e.negative===0&&this.negative!==0?(this.negative=0,i=e.sub(this),this.negative=1,i):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var i=this.iadd(e);return e.negative=1,i._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var s=this.cmp(e);if(s===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,l;s>0?(o=this,l=e):(o=e,l=this);for(var b=0,p=0;p<l.length;p++)i=(o.words[p]|0)-(l.words[p]|0)+b,b=i>>26,this.words[p]=i&67108863;for(;b!==0&&p<o.length;p++)i=(o.words[p]|0)+b,b=i>>26,this.words[p]=i&67108863;if(b===0&&p<o.length&&o!==this)for(;p<o.length;p++)this.words[p]=o.words[p];return this.length=Math.max(this.length,p),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function E(v,e,i){i.negative=e.negative^v.negative;var s=v.length+e.length|0;i.length=s,s=s-1|0;var o=v.words[0]|0,l=e.words[0]|0,b=o*l,p=b&67108863,u=b/67108864|0;i.words[0]=p;for(var r=1;r<s;r++){for(var c=u>>>26,I=u&67108863,S=Math.min(r,e.length-1),L=Math.max(0,r-v.length+1);L<=S;L++){var B=r-L|0;o=v.words[B]|0,l=e.words[L]|0,b=o*l+I,c+=b/67108864|0,I=b&67108863}i.words[r]=I|0,u=c|0}return u!==0?i.words[r]=u|0:i.length--,i.strip()}var P=function(e,i,s){var o=e.words,l=i.words,b=s.words,p=0,u,r,c,I=o[0]|0,S=I&8191,L=I>>>13,B=o[1]|0,z=B&8191,V=B>>>13,Ce=o[2]|0,Y=Ce&8191,$=Ce>>>13,nr=o[3]|0,U=nr&8191,O=nr>>>13,hr=o[4]|0,F=hr&8191,K=hr>>>13,sr=o[5]|0,H=sr&8191,G=sr>>>13,dr=o[6]|0,Z=dr&8191,W=dr>>>13,or=o[7]|0,J=or&8191,X=or>>>13,ur=o[8]|0,Q=ur&8191,j=ur>>>13,cr=o[9]|0,ee=cr&8191,te=cr>>>13,lr=l[0]|0,re=lr&8191,fe=lr>>>13,vr=l[1]|0,ie=vr&8191,ae=vr>>>13,br=l[2]|0,ne=br&8191,he=br>>>13,pr=l[3]|0,se=pr&8191,de=pr>>>13,xr=l[4]|0,oe=xr&8191,ue=xr>>>13,mr=l[5]|0,ce=mr&8191,le=mr>>>13,gr=l[6]|0,ve=gr&8191,be=gr>>>13,_r=l[7]|0,pe=_r&8191,xe=_r>>>13,yr=l[8]|0,me=yr&8191,ge=yr>>>13,Mr=l[9]|0,_e=Mr&8191,ye=Mr>>>13;s.negative=e.negative^i.negative,s.length=19,u=Math.imul(S,re),r=Math.imul(S,fe),r=r+Math.imul(L,re)|0,c=Math.imul(L,fe);var yt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,u=Math.imul(z,re),r=Math.imul(z,fe),r=r+Math.imul(V,re)|0,c=Math.imul(V,fe),u=u+Math.imul(S,ie)|0,r=r+Math.imul(S,ae)|0,r=r+Math.imul(L,ie)|0,c=c+Math.imul(L,ae)|0;var Mt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,u=Math.imul(Y,re),r=Math.imul(Y,fe),r=r+Math.imul($,re)|0,c=Math.imul($,fe),u=u+Math.imul(z,ie)|0,r=r+Math.imul(z,ae)|0,r=r+Math.imul(V,ie)|0,c=c+Math.imul(V,ae)|0,u=u+Math.imul(S,ne)|0,r=r+Math.imul(S,he)|0,r=r+Math.imul(L,ne)|0,c=c+Math.imul(L,he)|0;var wt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,u=Math.imul(U,re),r=Math.imul(U,fe),r=r+Math.imul(O,re)|0,c=Math.imul(O,fe),u=u+Math.imul(Y,ie)|0,r=r+Math.imul(Y,ae)|0,r=r+Math.imul($,ie)|0,c=c+Math.imul($,ae)|0,u=u+Math.imul(z,ne)|0,r=r+Math.imul(z,he)|0,r=r+Math.imul(V,ne)|0,c=c+Math.imul(V,he)|0,u=u+Math.imul(S,se)|0,r=r+Math.imul(S,de)|0,r=r+Math.imul(L,se)|0,c=c+Math.imul(L,de)|0;var At=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(At>>>26)|0,At&=67108863,u=Math.imul(F,re),r=Math.imul(F,fe),r=r+Math.imul(K,re)|0,c=Math.imul(K,fe),u=u+Math.imul(U,ie)|0,r=r+Math.imul(U,ae)|0,r=r+Math.imul(O,ie)|0,c=c+Math.imul(O,ae)|0,u=u+Math.imul(Y,ne)|0,r=r+Math.imul(Y,he)|0,r=r+Math.imul($,ne)|0,c=c+Math.imul($,he)|0,u=u+Math.imul(z,se)|0,r=r+Math.imul(z,de)|0,r=r+Math.imul(V,se)|0,c=c+Math.imul(V,de)|0,u=u+Math.imul(S,oe)|0,r=r+Math.imul(S,ue)|0,r=r+Math.imul(L,oe)|0,c=c+Math.imul(L,ue)|0;var Et=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,u=Math.imul(H,re),r=Math.imul(H,fe),r=r+Math.imul(G,re)|0,c=Math.imul(G,fe),u=u+Math.imul(F,ie)|0,r=r+Math.imul(F,ae)|0,r=r+Math.imul(K,ie)|0,c=c+Math.imul(K,ae)|0,u=u+Math.imul(U,ne)|0,r=r+Math.imul(U,he)|0,r=r+Math.imul(O,ne)|0,c=c+Math.imul(O,he)|0,u=u+Math.imul(Y,se)|0,r=r+Math.imul(Y,de)|0,r=r+Math.imul($,se)|0,c=c+Math.imul($,de)|0,u=u+Math.imul(z,oe)|0,r=r+Math.imul(z,ue)|0,r=r+Math.imul(V,oe)|0,c=c+Math.imul(V,ue)|0,u=u+Math.imul(S,ce)|0,r=r+Math.imul(S,le)|0,r=r+Math.imul(L,ce)|0,c=c+Math.imul(L,le)|0;var It=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(It>>>26)|0,It&=67108863,u=Math.imul(Z,re),r=Math.imul(Z,fe),r=r+Math.imul(W,re)|0,c=Math.imul(W,fe),u=u+Math.imul(H,ie)|0,r=r+Math.imul(H,ae)|0,r=r+Math.imul(G,ie)|0,c=c+Math.imul(G,ae)|0,u=u+Math.imul(F,ne)|0,r=r+Math.imul(F,he)|0,r=r+Math.imul(K,ne)|0,c=c+Math.imul(K,he)|0,u=u+Math.imul(U,se)|0,r=r+Math.imul(U,de)|0,r=r+Math.imul(O,se)|0,c=c+Math.imul(O,de)|0,u=u+Math.imul(Y,oe)|0,r=r+Math.imul(Y,ue)|0,r=r+Math.imul($,oe)|0,c=c+Math.imul($,ue)|0,u=u+Math.imul(z,ce)|0,r=r+Math.imul(z,le)|0,r=r+Math.imul(V,ce)|0,c=c+Math.imul(V,le)|0,u=u+Math.imul(S,ve)|0,r=r+Math.imul(S,be)|0,r=r+Math.imul(L,ve)|0,c=c+Math.imul(L,be)|0;var St=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(St>>>26)|0,St&=67108863,u=Math.imul(J,re),r=Math.imul(J,fe),r=r+Math.imul(X,re)|0,c=Math.imul(X,fe),u=u+Math.imul(Z,ie)|0,r=r+Math.imul(Z,ae)|0,r=r+Math.imul(W,ie)|0,c=c+Math.imul(W,ae)|0,u=u+Math.imul(H,ne)|0,r=r+Math.imul(H,he)|0,r=r+Math.imul(G,ne)|0,c=c+Math.imul(G,he)|0,u=u+Math.imul(F,se)|0,r=r+Math.imul(F,de)|0,r=r+Math.imul(K,se)|0,c=c+Math.imul(K,de)|0,u=u+Math.imul(U,oe)|0,r=r+Math.imul(U,ue)|0,r=r+Math.imul(O,oe)|0,c=c+Math.imul(O,ue)|0,u=u+Math.imul(Y,ce)|0,r=r+Math.imul(Y,le)|0,r=r+Math.imul($,ce)|0,c=c+Math.imul($,le)|0,u=u+Math.imul(z,ve)|0,r=r+Math.imul(z,be)|0,r=r+Math.imul(V,ve)|0,c=c+Math.imul(V,be)|0,u=u+Math.imul(S,pe)|0,r=r+Math.imul(S,xe)|0,r=r+Math.imul(L,pe)|0,c=c+Math.imul(L,xe)|0;var Lt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u=Math.imul(Q,re),r=Math.imul(Q,fe),r=r+Math.imul(j,re)|0,c=Math.imul(j,fe),u=u+Math.imul(J,ie)|0,r=r+Math.imul(J,ae)|0,r=r+Math.imul(X,ie)|0,c=c+Math.imul(X,ae)|0,u=u+Math.imul(Z,ne)|0,r=r+Math.imul(Z,he)|0,r=r+Math.imul(W,ne)|0,c=c+Math.imul(W,he)|0,u=u+Math.imul(H,se)|0,r=r+Math.imul(H,de)|0,r=r+Math.imul(G,se)|0,c=c+Math.imul(G,de)|0,u=u+Math.imul(F,oe)|0,r=r+Math.imul(F,ue)|0,r=r+Math.imul(K,oe)|0,c=c+Math.imul(K,ue)|0,u=u+Math.imul(U,ce)|0,r=r+Math.imul(U,le)|0,r=r+Math.imul(O,ce)|0,c=c+Math.imul(O,le)|0,u=u+Math.imul(Y,ve)|0,r=r+Math.imul(Y,be)|0,r=r+Math.imul($,ve)|0,c=c+Math.imul($,be)|0,u=u+Math.imul(z,pe)|0,r=r+Math.imul(z,xe)|0,r=r+Math.imul(V,pe)|0,c=c+Math.imul(V,xe)|0,u=u+Math.imul(S,me)|0,r=r+Math.imul(S,ge)|0,r=r+Math.imul(L,me)|0,c=c+Math.imul(L,ge)|0;var Pt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,u=Math.imul(ee,re),r=Math.imul(ee,fe),r=r+Math.imul(te,re)|0,c=Math.imul(te,fe),u=u+Math.imul(Q,ie)|0,r=r+Math.imul(Q,ae)|0,r=r+Math.imul(j,ie)|0,c=c+Math.imul(j,ae)|0,u=u+Math.imul(J,ne)|0,r=r+Math.imul(J,he)|0,r=r+Math.imul(X,ne)|0,c=c+Math.imul(X,he)|0,u=u+Math.imul(Z,se)|0,r=r+Math.imul(Z,de)|0,r=r+Math.imul(W,se)|0,c=c+Math.imul(W,de)|0,u=u+Math.imul(H,oe)|0,r=r+Math.imul(H,ue)|0,r=r+Math.imul(G,oe)|0,c=c+Math.imul(G,ue)|0,u=u+Math.imul(F,ce)|0,r=r+Math.imul(F,le)|0,r=r+Math.imul(K,ce)|0,c=c+Math.imul(K,le)|0,u=u+Math.imul(U,ve)|0,r=r+Math.imul(U,be)|0,r=r+Math.imul(O,ve)|0,c=c+Math.imul(O,be)|0,u=u+Math.imul(Y,pe)|0,r=r+Math.imul(Y,xe)|0,r=r+Math.imul($,pe)|0,c=c+Math.imul($,xe)|0,u=u+Math.imul(z,me)|0,r=r+Math.imul(z,ge)|0,r=r+Math.imul(V,me)|0,c=c+Math.imul(V,ge)|0,u=u+Math.imul(S,_e)|0,r=r+Math.imul(S,ye)|0,r=r+Math.imul(L,_e)|0,c=c+Math.imul(L,ye)|0;var Bt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u=Math.imul(ee,ie),r=Math.imul(ee,ae),r=r+Math.imul(te,ie)|0,c=Math.imul(te,ae),u=u+Math.imul(Q,ne)|0,r=r+Math.imul(Q,he)|0,r=r+Math.imul(j,ne)|0,c=c+Math.imul(j,he)|0,u=u+Math.imul(J,se)|0,r=r+Math.imul(J,de)|0,r=r+Math.imul(X,se)|0,c=c+Math.imul(X,de)|0,u=u+Math.imul(Z,oe)|0,r=r+Math.imul(Z,ue)|0,r=r+Math.imul(W,oe)|0,c=c+Math.imul(W,ue)|0,u=u+Math.imul(H,ce)|0,r=r+Math.imul(H,le)|0,r=r+Math.imul(G,ce)|0,c=c+Math.imul(G,le)|0,u=u+Math.imul(F,ve)|0,r=r+Math.imul(F,be)|0,r=r+Math.imul(K,ve)|0,c=c+Math.imul(K,be)|0,u=u+Math.imul(U,pe)|0,r=r+Math.imul(U,xe)|0,r=r+Math.imul(O,pe)|0,c=c+Math.imul(O,xe)|0,u=u+Math.imul(Y,me)|0,r=r+Math.imul(Y,ge)|0,r=r+Math.imul($,me)|0,c=c+Math.imul($,ge)|0,u=u+Math.imul(z,_e)|0,r=r+Math.imul(z,ye)|0,r=r+Math.imul(V,_e)|0,c=c+Math.imul(V,ye)|0;var Rt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u=Math.imul(ee,ne),r=Math.imul(ee,he),r=r+Math.imul(te,ne)|0,c=Math.imul(te,he),u=u+Math.imul(Q,se)|0,r=r+Math.imul(Q,de)|0,r=r+Math.imul(j,se)|0,c=c+Math.imul(j,de)|0,u=u+Math.imul(J,oe)|0,r=r+Math.imul(J,ue)|0,r=r+Math.imul(X,oe)|0,c=c+Math.imul(X,ue)|0,u=u+Math.imul(Z,ce)|0,r=r+Math.imul(Z,le)|0,r=r+Math.imul(W,ce)|0,c=c+Math.imul(W,le)|0,u=u+Math.imul(H,ve)|0,r=r+Math.imul(H,be)|0,r=r+Math.imul(G,ve)|0,c=c+Math.imul(G,be)|0,u=u+Math.imul(F,pe)|0,r=r+Math.imul(F,xe)|0,r=r+Math.imul(K,pe)|0,c=c+Math.imul(K,xe)|0,u=u+Math.imul(U,me)|0,r=r+Math.imul(U,ge)|0,r=r+Math.imul(O,me)|0,c=c+Math.imul(O,ge)|0,u=u+Math.imul(Y,_e)|0,r=r+Math.imul(Y,ye)|0,r=r+Math.imul($,_e)|0,c=c+Math.imul($,ye)|0;var Nt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(ee,se),r=Math.imul(ee,de),r=r+Math.imul(te,se)|0,c=Math.imul(te,de),u=u+Math.imul(Q,oe)|0,r=r+Math.imul(Q,ue)|0,r=r+Math.imul(j,oe)|0,c=c+Math.imul(j,ue)|0,u=u+Math.imul(J,ce)|0,r=r+Math.imul(J,le)|0,r=r+Math.imul(X,ce)|0,c=c+Math.imul(X,le)|0,u=u+Math.imul(Z,ve)|0,r=r+Math.imul(Z,be)|0,r=r+Math.imul(W,ve)|0,c=c+Math.imul(W,be)|0,u=u+Math.imul(H,pe)|0,r=r+Math.imul(H,xe)|0,r=r+Math.imul(G,pe)|0,c=c+Math.imul(G,xe)|0,u=u+Math.imul(F,me)|0,r=r+Math.imul(F,ge)|0,r=r+Math.imul(K,me)|0,c=c+Math.imul(K,ge)|0,u=u+Math.imul(U,_e)|0,r=r+Math.imul(U,ye)|0,r=r+Math.imul(O,_e)|0,c=c+Math.imul(O,ye)|0;var Tt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u=Math.imul(ee,oe),r=Math.imul(ee,ue),r=r+Math.imul(te,oe)|0,c=Math.imul(te,ue),u=u+Math.imul(Q,ce)|0,r=r+Math.imul(Q,le)|0,r=r+Math.imul(j,ce)|0,c=c+Math.imul(j,le)|0,u=u+Math.imul(J,ve)|0,r=r+Math.imul(J,be)|0,r=r+Math.imul(X,ve)|0,c=c+Math.imul(X,be)|0,u=u+Math.imul(Z,pe)|0,r=r+Math.imul(Z,xe)|0,r=r+Math.imul(W,pe)|0,c=c+Math.imul(W,xe)|0,u=u+Math.imul(H,me)|0,r=r+Math.imul(H,ge)|0,r=r+Math.imul(G,me)|0,c=c+Math.imul(G,ge)|0,u=u+Math.imul(F,_e)|0,r=r+Math.imul(F,ye)|0,r=r+Math.imul(K,_e)|0,c=c+Math.imul(K,ye)|0;var Ct=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u=Math.imul(ee,ce),r=Math.imul(ee,le),r=r+Math.imul(te,ce)|0,c=Math.imul(te,le),u=u+Math.imul(Q,ve)|0,r=r+Math.imul(Q,be)|0,r=r+Math.imul(j,ve)|0,c=c+Math.imul(j,be)|0,u=u+Math.imul(J,pe)|0,r=r+Math.imul(J,xe)|0,r=r+Math.imul(X,pe)|0,c=c+Math.imul(X,xe)|0,u=u+Math.imul(Z,me)|0,r=r+Math.imul(Z,ge)|0,r=r+Math.imul(W,me)|0,c=c+Math.imul(W,ge)|0,u=u+Math.imul(H,_e)|0,r=r+Math.imul(H,ye)|0,r=r+Math.imul(G,_e)|0,c=c+Math.imul(G,ye)|0;var Dt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,u=Math.imul(ee,ve),r=Math.imul(ee,be),r=r+Math.imul(te,ve)|0,c=Math.imul(te,be),u=u+Math.imul(Q,pe)|0,r=r+Math.imul(Q,xe)|0,r=r+Math.imul(j,pe)|0,c=c+Math.imul(j,xe)|0,u=u+Math.imul(J,me)|0,r=r+Math.imul(J,ge)|0,r=r+Math.imul(X,me)|0,c=c+Math.imul(X,ge)|0,u=u+Math.imul(Z,_e)|0,r=r+Math.imul(Z,ye)|0,r=r+Math.imul(W,_e)|0,c=c+Math.imul(W,ye)|0;var zt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(zt>>>26)|0,zt&=67108863,u=Math.imul(ee,pe),r=Math.imul(ee,xe),r=r+Math.imul(te,pe)|0,c=Math.imul(te,xe),u=u+Math.imul(Q,me)|0,r=r+Math.imul(Q,ge)|0,r=r+Math.imul(j,me)|0,c=c+Math.imul(j,ge)|0,u=u+Math.imul(J,_e)|0,r=r+Math.imul(J,ye)|0,r=r+Math.imul(X,_e)|0,c=c+Math.imul(X,ye)|0;var qt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(qt>>>26)|0,qt&=67108863,u=Math.imul(ee,me),r=Math.imul(ee,ge),r=r+Math.imul(te,me)|0,c=Math.imul(te,ge),u=u+Math.imul(Q,_e)|0,r=r+Math.imul(Q,ye)|0,r=r+Math.imul(j,_e)|0,c=c+Math.imul(j,ye)|0;var Vt=(p+u|0)+((r&8191)<<13)|0;p=(c+(r>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,u=Math.imul(ee,_e),r=Math.imul(ee,ye),r=r+Math.imul(te,_e)|0,c=Math.imul(te,ye);var Yt=(p+u|0)+((r&8191)<<13)|0;return p=(c+(r>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b[0]=yt,b[1]=Mt,b[2]=wt,b[3]=At,b[4]=Et,b[5]=It,b[6]=St,b[7]=Lt,b[8]=Pt,b[9]=Bt,b[10]=Rt,b[11]=Nt,b[12]=Tt,b[13]=Ct,b[14]=Dt,b[15]=zt,b[16]=qt,b[17]=Vt,b[18]=Yt,p!==0&&(b[19]=p,s.length++),s};Math.imul||(P=E);function N(v,e,i){i.negative=e.negative^v.negative,i.length=v.length+e.length;for(var s=0,o=0,l=0;l<i.length-1;l++){var b=o;o=0;for(var p=s&67108863,u=Math.min(l,e.length-1),r=Math.max(0,l-v.length+1);r<=u;r++){var c=l-r,I=v.words[c]|0,S=e.words[r]|0,L=I*S,B=L&67108863;b=b+(L/67108864|0)|0,B=B+p|0,p=B&67108863,b=b+(B>>>26)|0,o+=b>>>26,b&=67108863}i.words[l]=p,s=b,b=o}return s!==0?i.words[l]=s:i.length--,i.strip()}function R(v,e,i){var s=new D;return s.mulp(v,e,i)}a.prototype.mulTo=function(e,i){var s,o=this.length+e.length;return this.length===10&&e.length===10?s=P(this,e,i):o<63?s=E(this,e,i):o<1024?s=N(this,e,i):s=R(this,e,i),s};function D(v,e){this.x=v,this.y=e}D.prototype.makeRBT=function(e){for(var i=new Array(e),s=a.prototype._countBits(e)-1,o=0;o<e;o++)i[o]=this.revBin(o,s,e);return i},D.prototype.revBin=function(e,i,s){if(e===0||e===s-1)return e;for(var o=0,l=0;l<i;l++)o|=(e&1)<<i-l-1,e>>=1;return o},D.prototype.permute=function(e,i,s,o,l,b){for(var p=0;p<b;p++)o[p]=i[e[p]],l[p]=s[e[p]]},D.prototype.transform=function(e,i,s,o,l,b){this.permute(b,e,i,s,o,l);for(var p=1;p<l;p<<=1)for(var u=p<<1,r=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),I=0;I<l;I+=u)for(var S=r,L=c,B=0;B<p;B++){var z=s[I+B],V=o[I+B],Ce=s[I+B+p],Y=o[I+B+p],$=S*Ce-L*Y;Y=S*Y+L*Ce,Ce=$,s[I+B]=z+Ce,o[I+B]=V+Y,s[I+B+p]=z-Ce,o[I+B+p]=V-Y,B!==u&&($=r*S-c*L,L=r*L+c*S,S=$)}},D.prototype.guessLen13b=function(e,i){var s=Math.max(i,e)|1,o=s&1,l=0;for(s=s/2|0;s;s=s>>>1)l++;return 1<<l+1+o},D.prototype.conjugate=function(e,i,s){if(!(s<=1))for(var o=0;o<s/2;o++){var l=e[o];e[o]=e[s-o-1],e[s-o-1]=l,l=i[o],i[o]=-i[s-o-1],i[s-o-1]=-l}},D.prototype.normalize13b=function(e,i){for(var s=0,o=0;o<i/2;o++){var l=Math.round(e[2*o+1]/i)*8192+Math.round(e[2*o]/i)+s;e[o]=l&67108863,l<67108864?s=0:s=l/67108864|0}return e},D.prototype.convert13b=function(e,i,s,o){for(var l=0,b=0;b<i;b++)l=l+(e[b]|0),s[2*b]=l&8191,l=l>>>13,s[2*b+1]=l&8191,l=l>>>13;for(b=2*i;b<o;++b)s[b]=0;h(l===0),h((l&-8192)===0)},D.prototype.stub=function(e){for(var i=new Array(e),s=0;s<e;s++)i[s]=0;return i},D.prototype.mulp=function(e,i,s){var o=2*this.guessLen13b(e.length,i.length),l=this.makeRBT(o),b=this.stub(o),p=new Array(o),u=new Array(o),r=new Array(o),c=new Array(o),I=new Array(o),S=new Array(o),L=s.words;L.length=o,this.convert13b(e.words,e.length,p,o),this.convert13b(i.words,i.length,c,o),this.transform(p,b,u,r,o,l),this.transform(c,b,I,S,o,l);for(var B=0;B<o;B++){var z=u[B]*I[B]-r[B]*S[B];r[B]=u[B]*S[B]+r[B]*I[B],u[B]=z}return this.conjugate(u,r,o),this.transform(u,r,L,b,o,l),this.conjugate(L,b,o),this.normalize13b(L,o),s.negative=e.negative^i.negative,s.length=e.length+i.length,s.strip()},a.prototype.mul=function(e){var i=new a(null);return i.words=new Array(this.length+e.length),this.mulTo(e,i)},a.prototype.mulf=function(e){var i=new a(null);return i.words=new Array(this.length+e.length),R(this,e,i)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){h(typeof e=="number"),h(e<67108864);for(var i=0,s=0;s<this.length;s++){var o=(this.words[s]|0)*e,l=(o&67108863)+(i&67108863);i>>=26,i+=o/67108864|0,i+=l>>>26,this.words[s]=l&67108863}return i!==0&&(this.words[s]=i,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var i=w(e);if(i.length===0)return new a(1);for(var s=this,o=0;o<i.length&&i[o]===0;o++,s=s.sqr());if(++o<i.length)for(var l=s.sqr();o<i.length;o++,l=l.sqr())i[o]!==0&&(s=s.mul(l));return s},a.prototype.iushln=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26,o=67108863>>>26-i<<26-i,l;if(i!==0){var b=0;for(l=0;l<this.length;l++){var p=this.words[l]&o,u=(this.words[l]|0)-p<<i;this.words[l]=u|b,b=p>>>26-i}b&&(this.words[l]=b,this.length++)}if(s!==0){for(l=this.length-1;l>=0;l--)this.words[l+s]=this.words[l];for(l=0;l<s;l++)this.words[l]=0;this.length+=s}return this.strip()},a.prototype.ishln=function(e){return h(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,i,s){h(typeof e=="number"&&e>=0);var o;i?o=(i-i%26)/26:o=0;var l=e%26,b=Math.min((e-l)/26,this.length),p=67108863^67108863>>>l<<l,u=s;if(o-=b,o=Math.max(0,o),u){for(var r=0;r<b;r++)u.words[r]=this.words[r];u.length=b}if(b!==0)if(this.length>b)for(this.length-=b,r=0;r<this.length;r++)this.words[r]=this.words[r+b];else this.words[0]=0,this.length=1;var c=0;for(r=this.length-1;r>=0&&(c!==0||r>=o);r--){var I=this.words[r]|0;this.words[r]=c<<26-l|I>>>l,c=I&p}return u&&c!==0&&(u.words[u.length++]=c),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,i,s){return h(this.negative===0),this.iushrn(e,i,s)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26,o=1<<i;if(this.length<=s)return!1;var l=this.words[s];return!!(l&o)},a.prototype.imaskn=function(e){h(typeof e=="number"&&e>=0);var i=e%26,s=(e-i)/26;if(h(this.negative===0,"imaskn works only with positive numbers"),this.length<=s)return this;if(i!==0&&s++,this.length=Math.min(s,this.length),i!==0){var o=67108863^67108863>>>i<<i;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return h(typeof e=="number"),h(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},a.prototype.isubn=function(e){if(h(typeof e=="number"),h(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,i,s){var o=e.length+s,l;this._expand(o);var b,p=0;for(l=0;l<e.length;l++){b=(this.words[l+s]|0)+p;var u=(e.words[l]|0)*i;b-=u&67108863,p=(b>>26)-(u/67108864|0),this.words[l+s]=b&67108863}for(;l<this.length-s;l++)b=(this.words[l+s]|0)+p,p=b>>26,this.words[l+s]=b&67108863;if(p===0)return this.strip();for(h(p===-1),p=0,l=0;l<this.length;l++)b=-(this.words[l]|0)+p,p=b>>26,this.words[l]=b&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,i){var s=this.length-e.length,o=this.clone(),l=e,b=l.words[l.length-1]|0,p=this._countBits(b);s=26-p,s!==0&&(l=l.ushln(s),o.iushln(s),b=l.words[l.length-1]|0);var u=o.length-l.length,r;if(i!=="mod"){r=new a(null),r.length=u+1,r.words=new Array(r.length);for(var c=0;c<r.length;c++)r.words[c]=0}var I=o.clone()._ishlnsubmul(l,1,u);I.negative===0&&(o=I,r&&(r.words[u]=1));for(var S=u-1;S>=0;S--){var L=(o.words[l.length+S]|0)*67108864+(o.words[l.length+S-1]|0);for(L=Math.min(L/b|0,67108863),o._ishlnsubmul(l,L,S);o.negative!==0;)L--,o.negative=0,o._ishlnsubmul(l,1,S),o.isZero()||(o.negative^=1);r&&(r.words[S]=L)}return r&&r.strip(),o.strip(),i!=="div"&&s!==0&&o.iushrn(s),{div:r||null,mod:o}},a.prototype.divmod=function(e,i,s){if(h(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,l,b;return this.negative!==0&&e.negative===0?(b=this.neg().divmod(e,i),i!=="mod"&&(o=b.div.neg()),i!=="div"&&(l=b.mod.neg(),s&&l.negative!==0&&l.iadd(e)),{div:o,mod:l}):this.negative===0&&e.negative!==0?(b=this.divmod(e.neg(),i),i!=="mod"&&(o=b.div.neg()),{div:o,mod:b.mod}):this.negative&e.negative?(b=this.neg().divmod(e.neg(),i),i!=="div"&&(l=b.mod.neg(),s&&l.negative!==0&&l.isub(e)),{div:b.div,mod:l}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?i==="div"?{div:this.divn(e.words[0]),mod:null}:i==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,i)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var i=this.divmod(e);if(i.mod.isZero())return i.div;var s=i.div.negative!==0?i.mod.isub(e):i.mod,o=e.ushrn(1),l=e.andln(1),b=s.cmp(o);return b<0||l===1&&b===0?i.div:i.div.negative!==0?i.div.isubn(1):i.div.iaddn(1)},a.prototype.modn=function(e){h(e<=67108863);for(var i=(1<<26)%e,s=0,o=this.length-1;o>=0;o--)s=(i*s+(this.words[o]|0))%e;return s},a.prototype.idivn=function(e){h(e<=67108863);for(var i=0,s=this.length-1;s>=0;s--){var o=(this.words[s]|0)+i*67108864;this.words[s]=o/e|0,i=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){h(e.negative===0),h(!e.isZero());var i=this,s=e.clone();i.negative!==0?i=i.umod(e):i=i.clone();for(var o=new a(1),l=new a(0),b=new a(0),p=new a(1),u=0;i.isEven()&&s.isEven();)i.iushrn(1),s.iushrn(1),++u;for(var r=s.clone(),c=i.clone();!i.isZero();){for(var I=0,S=1;!(i.words[0]&S)&&I<26;++I,S<<=1);if(I>0)for(i.iushrn(I);I-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(r),l.isub(c)),o.iushrn(1),l.iushrn(1);for(var L=0,B=1;!(s.words[0]&B)&&L<26;++L,B<<=1);if(L>0)for(s.iushrn(L);L-- >0;)(b.isOdd()||p.isOdd())&&(b.iadd(r),p.isub(c)),b.iushrn(1),p.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(b),l.isub(p)):(s.isub(i),b.isub(o),p.isub(l))}return{a:b,b:p,gcd:s.iushln(u)}},a.prototype._invmp=function(e){h(e.negative===0),h(!e.isZero());var i=this,s=e.clone();i.negative!==0?i=i.umod(e):i=i.clone();for(var o=new a(1),l=new a(0),b=s.clone();i.cmpn(1)>0&&s.cmpn(1)>0;){for(var p=0,u=1;!(i.words[0]&u)&&p<26;++p,u<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(b),o.iushrn(1);for(var r=0,c=1;!(s.words[0]&c)&&r<26;++r,c<<=1);if(r>0)for(s.iushrn(r);r-- >0;)l.isOdd()&&l.iadd(b),l.iushrn(1);i.cmp(s)>=0?(i.isub(s),o.isub(l)):(s.isub(i),l.isub(o))}var I;return i.cmpn(1)===0?I=o:I=l,I.cmpn(0)<0&&I.iadd(e),I},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var i=this.clone(),s=e.clone();i.negative=0,s.negative=0;for(var o=0;i.isEven()&&s.isEven();o++)i.iushrn(1),s.iushrn(1);do{for(;i.isEven();)i.iushrn(1);for(;s.isEven();)s.iushrn(1);var l=i.cmp(s);if(l<0){var b=i;i=s,s=b}else if(l===0||s.cmpn(1)===0)break;i.isub(s)}while(!0);return s.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){h(typeof e=="number");var i=e%26,s=(e-i)/26,o=1<<i;if(this.length<=s)return this._expand(s+1),this.words[s]|=o,this;for(var l=o,b=s;l!==0&&b<this.length;b++){var p=this.words[b]|0;p+=l,l=p>>>26,p&=67108863,this.words[b]=p}return l!==0&&(this.words[b]=l,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var i=e<0;if(this.negative!==0&&!i)return-1;if(this.negative===0&&i)return 1;this.strip();var s;if(this.length>1)s=1;else{i&&(e=-e),h(e<=67108863,"Number is too big");var o=this.words[0]|0;s=o===e?0:o<e?-1:1}return this.negative!==0?-s|0:s},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var i=this.ucmp(e);return this.negative!==0?-i|0:i},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var i=0,s=this.length-1;s>=0;s--){var o=this.words[s]|0,l=e.words[s]|0;if(o!==l){o<l?i=-1:o>l&&(i=1);break}}return i},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new q(e)},a.prototype.toRed=function(e){return h(!this.red,"Already a number in reduction context"),h(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return h(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return h(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var Me={k256:null,p224:null,p192:null,p25519:null};function k(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}k.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.prototype.ireduce=function(e){var i=e,s;do this.split(i,this.tmp),i=this.imulK(i),i=i.iadd(this.tmp),s=i.bitLength();while(s>this.n);var o=s<this.n?-1:i.ucmp(this.p);return o===0?(i.words[0]=0,i.length=1):o>0?i.isub(this.p):i.strip!==void 0?i.strip():i._strip(),i},k.prototype.split=function(e,i){e.iushrn(this.n,0,i)},k.prototype.imulK=function(e){return e.imul(this.k)};function Ae(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(Ae,k),Ae.prototype.split=function(e,i){for(var s=4194303,o=Math.min(e.length,9),l=0;l<o;l++)i.words[l]=e.words[l];if(i.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var b=e.words[9];for(i.words[i.length++]=b&s,l=10;l<e.length;l++){var p=e.words[l]|0;e.words[l-10]=(p&s)<<4|b>>>22,b=p}b>>>=22,e.words[l-10]=b,b===0&&e.length>10?e.length-=10:e.length-=9},Ae.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var i=0,s=0;s<e.length;s++){var o=e.words[s]|0;i+=o*977,e.words[s]=i&67108863,i=o*64+(i/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Ie(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(Ie,k);function Ee(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(Ee,k);function Le(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(Le,k),Le.prototype.imulK=function(e){for(var i=0,s=0;s<e.length;s++){var o=(e.words[s]|0)*19+i,l=o&67108863;o>>>=26,e.words[s]=l,i=o}return i!==0&&(e.words[e.length++]=i),e},a._prime=function(e){if(Me[e])return Me[e];var i;if(e==="k256")i=new Ae;else if(e==="p224")i=new Ie;else if(e==="p192")i=new Ee;else if(e==="p25519")i=new Le;else throw new Error("Unknown prime "+e);return Me[e]=i,i};function q(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else h(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}q.prototype._verify1=function(e){h(e.negative===0,"red works only with positives"),h(e.red,"red works only with red numbers")},q.prototype._verify2=function(e,i){h((e.negative|i.negative)===0,"red works only with positives"),h(e.red&&e.red===i.red,"red works only with red numbers")},q.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},q.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},q.prototype.add=function(e,i){this._verify2(e,i);var s=e.add(i);return s.cmp(this.m)>=0&&s.isub(this.m),s._forceRed(this)},q.prototype.iadd=function(e,i){this._verify2(e,i);var s=e.iadd(i);return s.cmp(this.m)>=0&&s.isub(this.m),s},q.prototype.sub=function(e,i){this._verify2(e,i);var s=e.sub(i);return s.cmpn(0)<0&&s.iadd(this.m),s._forceRed(this)},q.prototype.isub=function(e,i){this._verify2(e,i);var s=e.isub(i);return s.cmpn(0)<0&&s.iadd(this.m),s},q.prototype.shl=function(e,i){return this._verify1(e),this.imod(e.ushln(i))},q.prototype.imul=function(e,i){return this._verify2(e,i),this.imod(e.imul(i))},q.prototype.mul=function(e,i){return this._verify2(e,i),this.imod(e.mul(i))},q.prototype.isqr=function(e){return this.imul(e,e.clone())},q.prototype.sqr=function(e){return this.mul(e,e)},q.prototype.sqrt=function(e){if(e.isZero())return e.clone();var i=this.m.andln(3);if(h(i%2===1),i===3){var s=this.m.add(new a(1)).iushrn(2);return this.pow(e,s)}for(var o=this.m.subn(1),l=0;!o.isZero()&&o.andln(1)===0;)l++,o.iushrn(1);h(!o.isZero());var b=new a(1).toRed(this),p=b.redNeg(),u=this.m.subn(1).iushrn(1),r=this.m.bitLength();for(r=new a(2*r*r).toRed(this);this.pow(r,u).cmp(p)!==0;)r.redIAdd(p);for(var c=this.pow(r,o),I=this.pow(e,o.addn(1).iushrn(1)),S=this.pow(e,o),L=l;S.cmp(b)!==0;){for(var B=S,z=0;B.cmp(b)!==0;z++)B=B.redSqr();h(z<L);var V=this.pow(c,new a(1).iushln(L-z-1));I=I.redMul(V),c=V.redSqr(),S=S.redMul(c),L=z}return I},q.prototype.invm=function(e){var i=e._invmp(this.m);return i.negative!==0?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},q.prototype.pow=function(e,i){if(i.isZero())return new a(1).toRed(this);if(i.cmpn(1)===0)return e.clone();var s=4,o=new Array(1<<s);o[0]=new a(1).toRed(this),o[1]=e;for(var l=2;l<o.length;l++)o[l]=this.mul(o[l-1],e);var b=o[0],p=0,u=0,r=i.bitLength()%26;for(r===0&&(r=26),l=i.length-1;l>=0;l--){for(var c=i.words[l],I=r-1;I>=0;I--){var S=c>>I&1;if(b!==o[0]&&(b=this.sqr(b)),S===0&&p===0){u=0;continue}p<<=1,p|=S,u++,!(u!==s&&(l!==0||I!==0))&&(b=this.mul(b,o[p]),u=0,p=0)}r=26}return b},q.prototype.convertTo=function(e){var i=e.umod(this.m);return i===e?i.clone():i},q.prototype.convertFrom=function(e){var i=e.clone();return i.red=null,i},a.mont=function(e){return new Be(e)};function Be(v){q.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}d(Be,q),Be.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},Be.prototype.convertFrom=function(e){var i=this.imod(e.mul(this.rinv));return i.red=null,i},Be.prototype.imul=function(e,i){if(e.isZero()||i.isZero())return e.words[0]=0,e.length=1,e;var s=e.imul(i),o=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=s.isub(o).iushrn(this.shift),b=l;return l.cmp(this.m)>=0?b=l.isub(this.m):l.cmpn(0)<0&&(b=l.iadd(this.m)),b._forceRed(this)},Be.prototype.mul=function(e,i){if(e.isZero()||i.isZero())return new a(0)._forceRed(this);var s=e.mul(i),o=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=s.isub(o).iushrn(this.shift),b=l;return l.cmp(this.m)>=0?b=l.isub(this.m):l.cmpn(0)<0&&(b=l.iadd(this.m)),b._forceRed(this)},Be.prototype.invm=function(e){var i=this.imod(e._invmp(this.m).mul(this.r2));return i._forceRed(this)}})(f,af)})(z0);var Wh=z0.exports;(function(f){var t=ut.Buffer,n=L0,h=Wh,d=lf.ec,a=Of,m=new d("secp256k1"),x=m.curve;function _(g,M){var w=new h(M);if(w.cmp(x.p)>=0)return null;w=w.toRed(x.red);var E=w.redSqr().redIMul(w).redIAdd(x.b).redSqrt();g===3!==E.isOdd()&&(E=E.redNeg());const P=w.redSqr().redIMul(w);return E.redSqr().redISub(P.redIAdd(x.b)).isZero()?m.keyPair({pub:{x:w,y:E}}):null}function A(g,M,w){var E=new h(M),P=new h(w);if(E.cmp(x.p)>=0||P.cmp(x.p)>=0||(E=E.toRed(x.red),P=P.toRed(x.red),(g===6||g===7)&&P.isOdd()!==(g===7)))return null;var N=E.redSqr().redIMul(E);return P.redSqr().redISub(N.redIAdd(x.b)).isZero()?m.keyPair({pub:{x:E,y:P}}):null}function y(g){var M=g[0];switch(M){case 2:case 3:return g.length!==33?null:_(M,g.slice(1,33));case 4:case 6:case 7:return g.length!==65?null:A(M,g.slice(1,33),g.slice(33,65));default:return null}}f.privateKeyVerify=function(g){var M=new h(g);return M.cmp(x.n)<0&&!M.isZero()},f.privateKeyExport=function(g,M){var w=new h(g);if(w.cmp(x.n)>=0||w.isZero())throw new Error(a.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return t.from(m.keyFromPrivate(g).getPublic(M,!0))},f.privateKeyNegate=function(g){var M=new h(g);return M.isZero()?t.alloc(32):x.n.sub(M).umod(x.n).toArrayLike(t,"be",32)},f.privateKeyModInverse=function(g){var M=new h(g);if(M.cmp(x.n)>=0||M.isZero())throw new Error(a.EC_PRIVATE_KEY_RANGE_INVALID);return M.invm(x.n).toArrayLike(t,"be",32)},f.privateKeyTweakAdd=function(g,M){var w=new h(M);if(w.cmp(x.n)>=0)throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(w.iadd(new h(g)),w.cmp(x.n)>=0&&w.isub(x.n),w.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return w.toArrayLike(t,"be",32)},f.privateKeyTweakMul=function(g,M){var w=new h(M);if(w.cmp(x.n)>=0||w.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return w.imul(new h(g)),w.cmp(x.n)&&(w=w.umod(x.n)),w.toArrayLike(t,"be",32)},f.publicKeyCreate=function(g,M){var w=new h(g);if(w.cmp(x.n)>=0||w.isZero())throw new Error(a.EC_PUBLIC_KEY_CREATE_FAIL);return t.from(m.keyFromPrivate(g).getPublic(M,!0))},f.publicKeyConvert=function(g,M){var w=y(g);if(w===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return t.from(w.getPublic(M,!0))},f.publicKeyVerify=function(g){return y(g)!==null},f.publicKeyTweakAdd=function(g,M,w){var E=y(g);if(E===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if(M=new h(M),M.cmp(x.n)>=0)throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var P=x.g.mul(M).add(E.pub);if(P.isInfinity())throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return t.from(P.encode(!0,w))},f.publicKeyTweakMul=function(g,M,w){var E=y(g);if(E===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if(M=new h(M),M.cmp(x.n)>=0||M.isZero())throw new Error(a.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return t.from(E.pub.mul(M).encode(!0,w))},f.publicKeyCombine=function(g,M){for(var w=new Array(g.length),E=0;E<g.length;++E)if(w[E]=y(g[E]),w[E]===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);for(var P=w[0].pub,N=1;N<w.length;++N)P=P.add(w[N].pub);if(P.isInfinity())throw new Error(a.EC_PUBLIC_KEY_COMBINE_FAIL);return t.from(P.encode(!0,M))},f.signatureNormalize=function(g){var M=new h(g.slice(0,32)),w=new h(g.slice(32,64));if(M.cmp(x.n)>=0||w.cmp(x.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);var E=t.from(g);return w.cmp(m.nh)===1&&x.n.sub(w).toArrayLike(t,"be",32).copy(E,32),E},f.signatureExport=function(g){var M=g.slice(0,32),w=g.slice(32,64);if(new h(M).cmp(x.n)>=0||new h(w).cmp(x.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);return{r:M,s:w}},f.signatureImport=function(g){var M=new h(g.r);M.cmp(x.n)>=0&&(M=new h(0));var w=new h(g.s);return w.cmp(x.n)>=0&&(w=new h(0)),t.concat([M.toArrayLike(t,"be",32),w.toArrayLike(t,"be",32)])},f.sign=function(g,M,w,E){if(typeof w=="function"){var P=w;w=function(D){var Me=P(g,M,null,E,D);if(!t.isBuffer(Me)||Me.length!==32)throw new Error(a.ECDSA_SIGN_FAIL);return new h(Me)}}var N=new h(M);if(N.cmp(x.n)>=0||N.isZero())throw new Error(a.ECDSA_SIGN_FAIL);var R=m.sign(g,M,{canonical:!0,k:w,pers:E});return{signature:t.concat([R.r.toArrayLike(t,"be",32),R.s.toArrayLike(t,"be",32)]),recovery:R.recoveryParam}},f.verify=function(g,M,w){var E={r:M.slice(0,32),s:M.slice(32,64)},P=new h(E.r),N=new h(E.s);if(P.cmp(x.n)>=0||N.cmp(x.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);if(N.cmp(m.nh)===1||P.isZero()||N.isZero())return!1;var R=y(w);if(R===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return m.verify(g,E,{x:R.pub.x,y:R.pub.y})},f.recover=function(g,M,w,E){var P={r:M.slice(0,32),s:M.slice(32,64)},N=new h(P.r),R=new h(P.s);if(N.cmp(x.n)>=0||R.cmp(x.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);try{if(N.isZero()||R.isZero())throw new Error;var D=m.recoverPubKey(g,P,w);return t.from(D.encode(!0,E))}catch{throw new Error(a.ECDSA_RECOVER_FAIL)}},f.ecdh=function(g,M){var w=f.ecdhUnsafe(g,M,!0);return n("sha256").update(w).digest()},f.ecdhUnsafe=function(g,M,w){var E=y(g);if(E===null)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);var P=new h(M);if(P.cmp(x.n)>=0||P.isZero())throw new Error(a.ECDH_FAIL);return t.from(E.pub.mul(P).encode(!0,w))}})(Ff);var Jh=Zh(Ff);const _0=Jn,ef=ih,Yr=ah,Kf=L0,q0=Jh,tf=ii,xt={P2WPKH:"p2wpkh",P2SH_P2WPKH:"p2sh(p2wpkh)"};function I0(f){return Kf("sha256").update(f).digest()}function Xh(f){return I0(I0(f))}function Hf(f){return Kf("ripemd160").update(I0(f)).digest()}function Gf(f,t,n,h){return h!==void 0?(t+=8,h===xt.P2WPKH&&(t+=4)):n&&(t+=4),Buffer.concat([Buffer.alloc(1,t+27),f])}function Qh(f){if(f.length!==65)throw new Error("Invalid signature length");const t=f.readUInt8(0)-27;if(t>15||t<0)throw new Error("Invalid signature parameter");return{compressed:!!(t&12),segwitType:t&8?t&4?xt.P2WPKH:xt.P2SH_P2WPKH:null,recovery:t&3,signature:f.slice(1)}}function s0(f,t){t=t||`Bitcoin Signed Message:
`,Buffer.isBuffer(t)||(t=Buffer.from(t,"utf8")),Buffer.isBuffer(f)||(f=Buffer.from(f,"utf8"));const n=tf.encodingLength(f.length),h=Buffer.allocUnsafe(t.length+n+f.length);return t.copy(h,0),tf.encode(f.length,h,t.length),f.copy(h,t.length+n),Xh(h)}function Zf(f,t){typeof f=="object"&&t===void 0&&(t=f,f=void 0);let{segwitType:n,extraEntropy:h}=t||{};if(n&&(typeof n=="string"||n instanceof String)&&(n=n.toLowerCase()),n&&n!==xt.P2SH_P2WPKH&&n!==xt.P2WPKH)throw new Error('Unrecognized segwitType: use "'+xt.P2SH_P2WPKH+'" or "'+xt.P2WPKH+'"');return{messagePrefixArg:f,segwitType:n,extraEntropy:h}}function Wf(f){return f&&typeof f.sign=="function"}function jh(f,t,n,h,d){const{messagePrefixArg:a,segwitType:m,extraEntropy:x}=Zf(h,d),_=s0(f,a),A=Wf(t)?t.sign(_,x):q0.sign(_,t,{data:x});return Gf(A.signature,A.recovery,n,m)}function es(f,t,n,h,d){let a,m,x;return Promise.resolve().then(()=>{({messagePrefixArg:a,segwitType:m,extraEntropy:x}=Zf(h,d));const _=s0(f,a);return Wf(t)?t.sign(_,x):q0.sign(_,t,{data:x})}).then(_=>Gf(_.signature,_.recovery,n,m))}function rf(f){const t=Buffer.concat([Buffer.from("0014","hex"),f]);return Hf(t)}function ff(f){const t=ef.decode(f),n=ef.fromWords(t.words.slice(1));return Buffer.from(n)}function ts(f,t,n,h,d){Buffer.isBuffer(n)||(n=Buffer.from(n,"base64"));const a=Qh(n);if(d&&!a.compressed)throw new Error("checkSegwitAlways can only be used with a compressed pubkey signature flagbyte");const m=s0(f,h),x=q0.recover(m,a.signature,a.recovery,a.compressed),_=Hf(x);let A,y;if(a.segwitType)a.segwitType===xt.P2SH_P2WPKH?(A=rf(_),y=_0.decode(t).slice(1)):(A=_,y=ff(t));else if(d)try{return y=ff(t),Yr(_,y)}catch{const M=rf(_);return y=_0.decode(t).slice(1),Yr(_,y)||Yr(M,y)}else A=_,y=_0.decode(t).slice(1);return Yr(A,y)}var Jf={magicHash:s0,sign:jh,signAsync:es,verify:ts};const rs=Qf(Jf),as=ri({__proto__:null,default:rs},[Jf]);export{as as i};