flagmint-js-sdk 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +323 -16
- package/dist/flagmint.cjs.js +1 -1
- package/dist/flagmint.es.js +13 -12
- package/dist/flagmint.umd.js +6 -6
- package/dist/sdk/core/client.d.ts +3 -0
- package/package.json +1 -1
package/dist/flagmint.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ge,Ft){typeof exports=="object"&&typeof module!="undefined"?Ft(exports):typeof define=="function"&&define.amd?define(["exports"],Ft):(ge=typeof globalThis!="undefined"?globalThis:ge||self,Ft(ge.flagmint={}))})(this,function(ge){"use strict";var
|
|
1
|
+
(function(ge,Ft){typeof exports=="object"&&typeof module!="undefined"?Ft(exports):typeof define=="function"&&define.amd?define(["exports"],Ft):(ge=typeof globalThis!="undefined"?globalThis:ge||self,Ft(ge.flagmint={}))})(this,function(ge){"use strict";var Tm=Object.defineProperty;var du=Object.getOwnPropertySymbols;var Cm=Object.prototype.hasOwnProperty,Fm=Object.prototype.propertyIsEnumerable;var me=Math.pow,cu=(ge,Ft,ke)=>Ft in ge?Tm(ge,Ft,{enumerable:!0,configurable:!0,writable:!0,value:ke}):ge[Ft]=ke,df=(ge,Ft)=>{for(var ke in Ft||(Ft={}))Cm.call(Ft,ke)&&cu(ge,ke,Ft[ke]);if(du)for(var ke of du(Ft))Fm.call(Ft,ke)&&cu(ge,ke,Ft[ke]);return ge};var De=(ge,Ft,ke)=>new Promise((cf,Ke)=>{var hi=xr=>{try{Re(ke.next(xr))}catch(Kr){Ke(Kr)}},Ve=xr=>{try{Re(ke.throw(xr))}catch(Kr){Ke(Kr)}},Re=xr=>xr.done?cf(xr.value):Promise.resolve(xr.value).then(hi,Ve);Re((ke=ke.apply(ge,Ft)).next())});var Ft=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ke(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}function cf(h){if(h.__esModule)return h;var n=h.default;if(typeof n=="function"){var u=function s(){return this instanceof s?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};u.prototype=n.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(h).forEach(function(s){var m=Object.getOwnPropertyDescriptor(h,s);Object.defineProperty(u,s,m.get?m:{enumerable:!0,get:function(){return h[s]}})}),u}var Ke={},hi={};hi.byteLength=pu,hi.toByteArray=gu,hi.fromByteArray=wu;for(var Ve=[],Re=[],xr=typeof Uint8Array!="undefined"?Uint8Array:Array,Kr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",si=0,vu=Kr.length;si<vu;++si)Ve[si]=Kr[si],Re[Kr.charCodeAt(si)]=si;Re["-".charCodeAt(0)]=62,Re["_".charCodeAt(0)]=63;function ia(h){var n=h.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=h.indexOf("=");u===-1&&(u=n);var s=u===n?0:4-u%4;return[u,s]}function pu(h){var n=ia(h),u=n[0],s=n[1];return(u+s)*3/4-s}function mu(h,n,u){return(n+u)*3/4-u}function gu(h){var n,u=ia(h),s=u[0],m=u[1],f=new xr(mu(h,s,m)),g=0,y=m>0?s-4:s,S;for(S=0;S<y;S+=4)n=Re[h.charCodeAt(S)]<<18|Re[h.charCodeAt(S+1)]<<12|Re[h.charCodeAt(S+2)]<<6|Re[h.charCodeAt(S+3)],f[g++]=n>>16&255,f[g++]=n>>8&255,f[g++]=n&255;return m===2&&(n=Re[h.charCodeAt(S)]<<2|Re[h.charCodeAt(S+1)]>>4,f[g++]=n&255),m===1&&(n=Re[h.charCodeAt(S)]<<10|Re[h.charCodeAt(S+1)]<<4|Re[h.charCodeAt(S+2)]>>2,f[g++]=n>>8&255,f[g++]=n&255),f}function bu(h){return Ve[h>>18&63]+Ve[h>>12&63]+Ve[h>>6&63]+Ve[h&63]}function yu(h,n,u){for(var s,m=[],f=n;f<u;f+=3)s=(h[f]<<16&16711680)+(h[f+1]<<8&65280)+(h[f+2]&255),m.push(bu(s));return m.join("")}function wu(h){for(var n,u=h.length,s=u%3,m=[],f=16383,g=0,y=u-s;g<y;g+=f)m.push(yu(h,g,g+f>y?y:g+f));return s===1?(n=h[u-1],m.push(Ve[n>>2]+Ve[n<<4&63]+"==")):s===2&&(n=(h[u-2]<<8)+h[u-1],m.push(Ve[n>>10]+Ve[n>>4&63]+Ve[n<<2&63]+"=")),m.join("")}var vf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */vf.read=function(h,n,u,s,m){var f,g,y=m*8-s-1,S=(1<<y)-1,B=S>>1,M=-7,x=u?m-1:0,I=u?-1:1,k=h[n+x];for(x+=I,f=k&(1<<-M)-1,k>>=-M,M+=y;M>0;f=f*256+h[n+x],x+=I,M-=8);for(g=f&(1<<-M)-1,f>>=-M,M+=s;M>0;g=g*256+h[n+x],x+=I,M-=8);if(f===0)f=1-B;else{if(f===S)return g?NaN:(k?-1:1)*(1/0);g=g+Math.pow(2,s),f=f-B}return(k?-1:1)*g*Math.pow(2,f-s)},vf.write=function(h,n,u,s,m,f){var g,y,S,B=f*8-m-1,M=(1<<B)-1,x=M>>1,I=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=s?0:f-1,D=s?1:-1,L=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=M):(g=Math.floor(Math.log(n)/Math.LN2),n*(S=Math.pow(2,-g))<1&&(g--,S*=2),g+x>=1?n+=I/S:n+=I*Math.pow(2,1-x),n*S>=2&&(g++,S/=2),g+x>=M?(y=0,g=M):g+x>=1?(y=(n*S-1)*Math.pow(2,m),g=g+x):(y=n*Math.pow(2,x-1)*Math.pow(2,m),g=0));m>=8;h[u+k]=y&255,k+=D,y/=256,m-=8);for(g=g<<m|y,B+=m;B>0;h[u+k]=g&255,k+=D,g/=256,B-=8);h[u+k-D]|=L*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -9,10 +9,10 @@ Use Chrome, Firefox or Internet Explorer 11`)}var Xu=zt.Buffer,cn=Ft.crypto||Ft.
|
|
|
9
9
|
*
|
|
10
10
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
11
11
|
* @license MIT
|
|
12
|
-
*/var lc=50;mt.TYPED_ARRAY_SUPPORT=Ti.TYPED_ARRAY_SUPPORT!==void 0?Ti.TYPED_ARRAY_SUPPORT:!0,Tn();function Tn(){return mt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ar(h,n){if(Tn()<n)throw new RangeError("Invalid typed array length");return mt.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=mt.prototype):(h===null&&(h=new mt(n)),h.length=n),h}function mt(h,n,u){if(!mt.TYPED_ARRAY_SUPPORT&&!(this instanceof mt))return new mt(h,n,u);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return Df(this,h)}return ch(this,h,n,u)}mt.poolSize=8192,mt._augment=function(h){return h.__proto__=mt.prototype,h};function ch(h,n,u,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer?vc(h,n,u,s):typeof n=="string"?cc(h,n,u):pc(h,n)}mt.from=function(h,n,u){return ch(null,h,n,u)},mt.TYPED_ARRAY_SUPPORT&&(mt.prototype.__proto__=Uint8Array.prototype,mt.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&mt[Symbol.species]);function vh(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function dc(h,n,u,s){return vh(n),n<=0?Ar(h,n):u!==void 0?typeof s=="string"?Ar(h,n).fill(u,s):Ar(h,n).fill(u):Ar(h,n)}mt.alloc=function(h,n,u){return dc(null,h,n,u)};function Df(h,n){if(vh(n),h=Ar(h,n<0?0:$f(n)|0),!mt.TYPED_ARRAY_SUPPORT)for(var u=0;u<n;++u)h[u]=0;return h}mt.allocUnsafe=function(h){return Df(null,h)},mt.allocUnsafeSlow=function(h){return Df(null,h)};function cc(h,n,u){if((typeof u!="string"||u==="")&&(u="utf8"),!mt.isEncoding(u))throw new TypeError('"encoding" must be a valid string encoding');var s=ph(n,u)|0;h=Ar(h,s);var m=h.write(n,u);return m!==s&&(h=h.slice(0,m)),h}function Nf(h,n){var u=n.length<0?0:$f(n.length)|0;h=Ar(h,u);for(var s=0;s<u;s+=1)h[s]=n[s]&255;return h}function vc(h,n,u,s){if(n.byteLength,u<0||n.byteLength<u)throw new RangeError("'offset' is out of bounds");if(n.byteLength<u+(s||0))throw new RangeError("'length' is out of bounds");return u===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,u):n=new Uint8Array(n,u,s),mt.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=mt.prototype):h=Nf(h,n),h}function pc(h,n){if(cr(n)){var u=$f(n.length)|0;return h=Ar(h,u),h.length===0||n.copy(h,0,0,u),h}if(n){if(typeof ArrayBuffer!="undefined"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||qc(n.length)?Ar(h,0):Nf(h,n);if(n.type==="Buffer"&&dh(n.data))return Nf(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function $f(h){if(h>=Tn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tn().toString(16)+" bytes");return h|0}mt.isBuffer=Pc;function cr(h){return!!(h!=null&&h._isBuffer)}mt.compare=function(n,u){if(!cr(n)||!cr(u))throw new TypeError("Arguments must be Buffers");if(n===u)return 0;for(var s=n.length,m=u.length,f=0,g=Math.min(s,m);f<g;++f)if(n[f]!==u[f]){s=n[f],m=u[f];break}return s<m?-1:m<s?1:0},mt.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},mt.concat=function(n,u){if(!dh(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return mt.alloc(0);var s;if(u===void 0)for(u=0,s=0;s<n.length;++s)u+=n[s].length;var m=mt.allocUnsafe(u),f=0;for(s=0;s<n.length;++s){var g=n[s];if(!cr(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(m,f),f+=g.length}return m};function ph(h,n){if(cr(h))return h.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var u=h.length;if(u===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":case void 0:return qn(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return Sh(h).length;default:if(s)return qn(h).length;n=(""+n).toLowerCase(),s=!0}}mt.byteLength=ph;function mc(h,n,u){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,n>>>=0,u<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return Bc(this,n,u);case"utf8":case"utf-8":return yh(this,n,u);case"ascii":return Sc(this,n,u);case"latin1":case"binary":return Ac(this,n,u);case"base64":return xc(this,n,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ec(this,n,u);default:if(s)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),s=!0}}mt.prototype._isBuffer=!0;function Qr(h,n,u){var s=h[n];h[n]=h[u],h[u]=s}mt.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<n;u+=2)Qr(this,u,u+1);return this},mt.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<n;u+=4)Qr(this,u,u+3),Qr(this,u+1,u+2);return this},mt.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<n;u+=8)Qr(this,u,u+7),Qr(this,u+1,u+6),Qr(this,u+2,u+5),Qr(this,u+3,u+4);return this},mt.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?yh(this,0,n):mc.apply(this,arguments)},mt.prototype.equals=function(n){if(!cr(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:mt.compare(this,n)===0},mt.prototype.inspect=function(){var n="",u=lc;return this.length>0&&(n=this.toString("hex",0,u).match(/.{2}/g).join(" "),this.length>u&&(n+=" ... ")),"<Buffer "+n+">"},mt.prototype.compare=function(n,u,s,m,f){if(!cr(n))throw new TypeError("Argument must be a Buffer");if(u===void 0&&(u=0),s===void 0&&(s=n?n.length:0),m===void 0&&(m=0),f===void 0&&(f=this.length),u<0||s>n.length||m<0||f>this.length)throw new RangeError("out of range index");if(m>=f&&u>=s)return 0;if(m>=f)return-1;if(u>=s)return 1;if(u>>>=0,s>>>=0,m>>>=0,f>>>=0,this===n)return 0;for(var g=f-m,y=s-u,S=Math.min(g,y),B=this.slice(m,f),M=n.slice(u,s),x=0;x<S;++x)if(B[x]!==M[x]){g=B[x],y=M[x];break}return g<y?-1:y<g?1:0};function mh(h,n,u,s,m){if(h.length===0)return-1;if(typeof u=="string"?(s=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,isNaN(u)&&(u=m?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(m)return-1;u=h.length-1}else if(u<0)if(m)u=0;else return-1;if(typeof n=="string"&&(n=mt.from(n,s)),cr(n))return n.length===0?-1:gh(h,n,u,s,m);if(typeof n=="number")return n=n&255,mt.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(h,n,u):Uint8Array.prototype.lastIndexOf.call(h,n,u):gh(h,[n],u,s,m);throw new TypeError("val must be string, number or Buffer")}function gh(h,n,u,s,m){var f=1,g=h.length,y=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(h.length<2||n.length<2)return-1;f=2,g/=2,y/=2,u/=2}function S(k,D){return f===1?k[D]:k.readUInt16BE(D*f)}var B;if(m){var M=-1;for(B=u;B<g;B++)if(S(h,B)===S(n,M===-1?0:B-M)){if(M===-1&&(M=B),B-M+1===y)return M*f}else M!==-1&&(B-=B-M),M=-1}else for(u+y>g&&(u=g-y),B=u;B>=0;B--){for(var x=!0,I=0;I<y;I++)if(S(h,B+I)!==S(n,I)){x=!1;break}if(x)return B}return-1}mt.prototype.includes=function(n,u,s){return this.indexOf(n,u,s)!==-1},mt.prototype.indexOf=function(n,u,s){return mh(this,n,u,s,!0)},mt.prototype.lastIndexOf=function(n,u,s){return mh(this,n,u,s,!1)};function gc(h,n,u,s){u=Number(u)||0;var m=h.length-u;s?(s=Number(s),s>m&&(s=m)):s=m;var f=n.length;if(f%2!==0)throw new TypeError("Invalid hex string");s>f/2&&(s=f/2);for(var g=0;g<s;++g){var y=parseInt(n.substr(g*2,2),16);if(isNaN(y))return g;h[u+g]=y}return g}function bc(h,n,u,s){return Pn(qn(n,h.length-u),h,u,s)}function bh(h,n,u,s){return Pn(Cc(n),h,u,s)}function yc(h,n,u,s){return bh(h,n,u,s)}function wc(h,n,u,s){return Pn(Sh(n),h,u,s)}function Mc(h,n,u,s){return Pn(Fc(n,h.length-u),h,u,s)}mt.prototype.write=function(n,u,s,m){if(u===void 0)m="utf8",s=this.length,u=0;else if(s===void 0&&typeof u=="string")m=u,s=this.length,u=0;else if(isFinite(u))u=u|0,isFinite(s)?(s=s|0,m===void 0&&(m="utf8")):(m=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-u;if((s===void 0||s>f)&&(s=f),n.length>0&&(s<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var g=!1;;)switch(m){case"hex":return gc(this,n,u,s);case"utf8":case"utf-8":return bc(this,n,u,s);case"ascii":return bh(this,n,u,s);case"latin1":case"binary":return yc(this,n,u,s);case"base64":return wc(this,n,u,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mc(this,n,u,s);default:if(g)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),g=!0}},mt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xc(h,n,u){return n===0&&u===h.length?uh(h):uh(h.slice(n,u))}function yh(h,n,u){u=Math.min(h.length,u);for(var s=[],m=n;m<u;){var f=h[m],g=null,y=f>239?4:f>223?3:f>191?2:1;if(m+y<=u){var S,B,M,x;switch(y){case 1:f<128&&(g=f);break;case 2:S=h[m+1],(S&192)===128&&(x=(f&31)<<6|S&63,x>127&&(g=x));break;case 3:S=h[m+1],B=h[m+2],(S&192)===128&&(B&192)===128&&(x=(f&15)<<12|(S&63)<<6|B&63,x>2047&&(x<55296||x>57343)&&(g=x));break;case 4:S=h[m+1],B=h[m+2],M=h[m+3],(S&192)===128&&(B&192)===128&&(M&192)===128&&(x=(f&15)<<18|(S&63)<<12|(B&63)<<6|M&63,x>65535&&x<1114112&&(g=x))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),m+=y}return _c(s)}var wh=4096;function _c(h){var n=h.length;if(n<=wh)return String.fromCharCode.apply(String,h);for(var u="",s=0;s<n;)u+=String.fromCharCode.apply(String,h.slice(s,s+=wh));return u}function Sc(h,n,u){var s="";u=Math.min(h.length,u);for(var m=n;m<u;++m)s+=String.fromCharCode(h[m]&127);return s}function Ac(h,n,u){var s="";u=Math.min(h.length,u);for(var m=n;m<u;++m)s+=String.fromCharCode(h[m]);return s}function Bc(h,n,u){var s=h.length;(!n||n<0)&&(n=0),(!u||u<0||u>s)&&(u=s);for(var m="",f=n;f<u;++f)m+=Tc(h[f]);return m}function Ec(h,n,u){for(var s=h.slice(n,u),m="",f=0;f<s.length;f+=2)m+=String.fromCharCode(s[f]+s[f+1]*256);return m}mt.prototype.slice=function(n,u){var s=this.length;n=~~n,u=u===void 0?s:~~u,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),u<0?(u+=s,u<0&&(u=0)):u>s&&(u=s),u<n&&(u=n);var m;if(mt.TYPED_ARRAY_SUPPORT)m=this.subarray(n,u),m.__proto__=mt.prototype;else{var f=u-n;m=new mt(f,void 0);for(var g=0;g<f;++g)m[g]=this[g+n]}return m};function Se(h,n,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>u)throw new RangeError("Trying to access beyond buffer length")}mt.prototype.readUIntLE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n],f=1,g=0;++g<u&&(f*=256);)m+=this[n+g]*f;return m},mt.prototype.readUIntBE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n+--u],f=1;u>0&&(f*=256);)m+=this[n+--u]*f;return m},mt.prototype.readUInt8=function(n,u){return u||Se(n,1,this.length),this[n]},mt.prototype.readUInt16LE=function(n,u){return u||Se(n,2,this.length),this[n]|this[n+1]<<8},mt.prototype.readUInt16BE=function(n,u){return u||Se(n,2,this.length),this[n]<<8|this[n+1]},mt.prototype.readUInt32LE=function(n,u){return u||Se(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},mt.prototype.readUInt32BE=function(n,u){return u||Se(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},mt.prototype.readIntLE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n],f=1,g=0;++g<u&&(f*=256);)m+=this[n+g]*f;return f*=128,m>=f&&(m-=Math.pow(2,8*u)),m},mt.prototype.readIntBE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=u,f=1,g=this[n+--m];m>0&&(f*=256);)g+=this[n+--m]*f;return f*=128,g>=f&&(g-=Math.pow(2,8*u)),g},mt.prototype.readInt8=function(n,u){return u||Se(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},mt.prototype.readInt16LE=function(n,u){u||Se(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},mt.prototype.readInt16BE=function(n,u){u||Se(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},mt.prototype.readInt32LE=function(n,u){return u||Se(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},mt.prototype.readInt32BE=function(n,u){return u||Se(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},mt.prototype.readFloatLE=function(n,u){return u||Se(n,4,this.length),Rn(this,n,!0,23,4)},mt.prototype.readFloatBE=function(n,u){return u||Se(n,4,this.length),Rn(this,n,!1,23,4)},mt.prototype.readDoubleLE=function(n,u){return u||Se(n,8,this.length),Rn(this,n,!0,52,8)},mt.prototype.readDoubleBE=function(n,u){return u||Se(n,8,this.length),Rn(this,n,!1,52,8)};function $e(h,n,u,s,m,f){if(!cr(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>m||n<f)throw new RangeError('"value" argument is out of bounds');if(u+s>h.length)throw new RangeError("Index out of range")}mt.prototype.writeUIntLE=function(n,u,s,m){if(n=+n,u=u|0,s=s|0,!m){var f=Math.pow(2,8*s)-1;$e(this,n,u,s,f,0)}var g=1,y=0;for(this[u]=n&255;++y<s&&(g*=256);)this[u+y]=n/g&255;return u+s},mt.prototype.writeUIntBE=function(n,u,s,m){if(n=+n,u=u|0,s=s|0,!m){var f=Math.pow(2,8*s)-1;$e(this,n,u,s,f,0)}var g=s-1,y=1;for(this[u+g]=n&255;--g>=0&&(y*=256);)this[u+g]=n/y&255;return u+s},mt.prototype.writeUInt8=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,1,255,0),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[u]=n&255,u+1};function Cn(h,n,u,s){n<0&&(n=65535+n+1);for(var m=0,f=Math.min(h.length-u,2);m<f;++m)h[u+m]=(n&255<<8*(s?m:1-m))>>>(s?m:1-m)*8}mt.prototype.writeUInt16LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8):Cn(this,n,u,!0),u+2},mt.prototype.writeUInt16BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>8,this[u+1]=n&255):Cn(this,n,u,!1),u+2};function Fn(h,n,u,s){n<0&&(n=4294967295+n+1);for(var m=0,f=Math.min(h.length-u,4);m<f;++m)h[u+m]=n>>>(s?m:3-m)*8&255}mt.prototype.writeUInt32LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[u+3]=n>>>24,this[u+2]=n>>>16,this[u+1]=n>>>8,this[u]=n&255):Fn(this,n,u,!0),u+4},mt.prototype.writeUInt32BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>24,this[u+1]=n>>>16,this[u+2]=n>>>8,this[u+3]=n&255):Fn(this,n,u,!1),u+4},mt.prototype.writeIntLE=function(n,u,s,m){if(n=+n,u=u|0,!m){var f=Math.pow(2,8*s-1);$e(this,n,u,s,f-1,-f)}var g=0,y=1,S=0;for(this[u]=n&255;++g<s&&(y*=256);)n<0&&S===0&&this[u+g-1]!==0&&(S=1),this[u+g]=(n/y>>0)-S&255;return u+s},mt.prototype.writeIntBE=function(n,u,s,m){if(n=+n,u=u|0,!m){var f=Math.pow(2,8*s-1);$e(this,n,u,s,f-1,-f)}var g=s-1,y=1,S=0;for(this[u+g]=n&255;--g>=0&&(y*=256);)n<0&&S===0&&this[u+g+1]!==0&&(S=1),this[u+g]=(n/y>>0)-S&255;return u+s},mt.prototype.writeInt8=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,1,127,-128),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[u]=n&255,u+1},mt.prototype.writeInt16LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8):Cn(this,n,u,!0),u+2},mt.prototype.writeInt16BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>8,this[u+1]=n&255):Cn(this,n,u,!1),u+2},mt.prototype.writeInt32LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,2147483647,-2147483648),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8,this[u+2]=n>>>16,this[u+3]=n>>>24):Fn(this,n,u,!0),u+4},mt.prototype.writeInt32BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>24,this[u+1]=n>>>16,this[u+2]=n>>>8,this[u+3]=n&255):Fn(this,n,u,!1),u+4};function Mh(h,n,u,s,m,f){if(u+s>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function xh(h,n,u,s,m){return m||Mh(h,n,u,4),lh(h,n,u,s,23,4),u+4}mt.prototype.writeFloatLE=function(n,u,s){return xh(this,n,u,!0,s)},mt.prototype.writeFloatBE=function(n,u,s){return xh(this,n,u,!1,s)};function _h(h,n,u,s,m){return m||Mh(h,n,u,8),lh(h,n,u,s,52,8),u+8}mt.prototype.writeDoubleLE=function(n,u,s){return _h(this,n,u,!0,s)},mt.prototype.writeDoubleBE=function(n,u,s){return _h(this,n,u,!1,s)},mt.prototype.copy=function(n,u,s,m){if(s||(s=0),!m&&m!==0&&(m=this.length),u>=n.length&&(u=n.length),u||(u=0),m>0&&m<s&&(m=s),m===s||n.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),n.length-u<m-s&&(m=n.length-u+s);var f=m-s,g;if(this===n&&s<u&&u<m)for(g=f-1;g>=0;--g)n[g+u]=this[g+s];else if(f<1e3||!mt.TYPED_ARRAY_SUPPORT)for(g=0;g<f;++g)n[g+u]=this[g+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+f),u);return f},mt.prototype.fill=function(n,u,s,m){if(typeof n=="string"){if(typeof u=="string"?(m=u,u=0,s=this.length):typeof s=="string"&&(m=s,s=this.length),n.length===1){var f=n.charCodeAt(0);f<256&&(n=f)}if(m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!mt.isEncoding(m))throw new TypeError("Unknown encoding: "+m)}else typeof n=="number"&&(n=n&255);if(u<0||this.length<u||this.length<s)throw new RangeError("Out of range index");if(s<=u)return this;u=u>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var g;if(typeof n=="number")for(g=u;g<s;++g)this[g]=n;else{var y=cr(n)?n:qn(new mt(n,m).toString()),S=y.length;for(g=0;g<s-u;++g)this[g+u]=y[g%S]}return this};var kc=/[^+\/0-9A-Za-z-_]/g;function Ic(h){if(h=Rc(h).replace(kc,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Rc(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Tc(h){return h<16?"0"+h.toString(16):h.toString(16)}function qn(h,n){n=n||1/0;for(var u,s=h.length,m=null,f=[],g=0;g<s;++g){if(u=h.charCodeAt(g),u>55295&&u<57344){if(!m){if(u>56319){(n-=3)>-1&&f.push(239,191,189);continue}else if(g+1===s){(n-=3)>-1&&f.push(239,191,189);continue}m=u;continue}if(u<56320){(n-=3)>-1&&f.push(239,191,189),m=u;continue}u=(m-55296<<10|u-56320)+65536}else m&&(n-=3)>-1&&f.push(239,191,189);if(m=null,u<128){if((n-=1)<0)break;f.push(u)}else if(u<2048){if((n-=2)<0)break;f.push(u>>6|192,u&63|128)}else if(u<65536){if((n-=3)<0)break;f.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((n-=4)<0)break;f.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return f}function Cc(h){for(var n=[],u=0;u<h.length;++u)n.push(h.charCodeAt(u)&255);return n}function Fc(h,n){for(var u,s,m,f=[],g=0;g<h.length&&!((n-=2)<0);++g)u=h.charCodeAt(g),s=u>>8,m=u%256,f.push(m),f.push(s);return f}function Sh(h){return hc(Ic(h))}function Pn(h,n,u,s){for(var m=0;m<s&&!(m+u>=n.length||m>=h.length);++m)n[m+u]=h[m];return m}function qc(h){return h!==h}function Pc(h){return h!=null&&(!!h._isBuffer||Ah(h)||Dc(h))}function Ah(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function Dc(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&Ah(h.slice(0,0))}var Yi=function(n,u){for(var s=Math.min(n.length,u.length),m=new mt(s),f=0;f<s;++f)m[f]=n[f]^u[f];return m},Bh=Yi;qf.encrypt=function(h,n){var u=Bh(n,h._prev);return h._prev=h._cipher.encryptBlock(u),h._prev},qf.decrypt=function(h,n){var u=h._prev;h._prev=n;var s=h._cipher.decryptBlock(n);return Bh(s,u)};var Eh={},Ji=zt.Buffer,Nc=Yi;function kh(h,n,u){var s=n.length,m=Nc(n,h._cache);return h._cache=h._cache.slice(s),h._prev=Ji.concat([h._prev,u?n:m]),m}Eh.encrypt=function(h,n,u){for(var s=Ji.allocUnsafe(0),m;n.length;)if(h._cache.length===0&&(h._cache=h._cipher.encryptBlock(h._prev),h._prev=Ji.allocUnsafe(0)),h._cache.length<=n.length)m=h._cache.length,s=Ji.concat([s,kh(h,n.slice(0,m),u)]),n=n.slice(m);else{s=Ji.concat([s,kh(h,n,u)]);break}return s};var Ih={},Uf=zt.Buffer;function $c(h,n,u){var s=h._cipher.encryptBlock(h._prev),m=s[0]^n;return h._prev=Uf.concat([h._prev.slice(1),Uf.from([u?n:m])]),m}Ih.encrypt=function(h,n,u){for(var s=n.length,m=Uf.allocUnsafe(s),f=-1;++f<s;)m[f]=$c(h,n[f],u);return m};var Rh={},Dn=zt.Buffer;function Uc(h,n,u){for(var s,m=-1,f=8,g=0,y,S;++m<f;)s=h._cipher.encryptBlock(h._prev),y=n&1<<7-m?128:0,S=s[0]^y,g+=(S&128)>>m%8,h._prev=Lc(h._prev,u?y:S);return g}function Lc(h,n){var u=h.length,s=-1,m=Dn.allocUnsafe(h.length);for(h=Dn.concat([h,Dn.from([n])]);++s<u;)m[s]=h[s]<<1|h[s+1]>>7;return m}Rh.encrypt=function(h,n,u){for(var s=n.length,m=Dn.allocUnsafe(s),f=-1;++f<s;)m[f]=Uc(h,n[f],u);return m};var Th={},Oc=Yi;function zc(h){return h._prev=h._cipher.encryptBlock(h._prev),h._prev}Th.encrypt=function(h,n){for(;h._cache.length<n.length;)h._cache=mt.concat([h._cache,zc(h)]);var u=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),Oc(n,u)};var Lf={};function Kc(h){for(var n=h.length,u;n--;)if(u=h.readUInt8(n),u===255)h.writeUInt8(0,n);else{u++,h.writeUInt8(u,n);break}}var Ch=Kc,Hc=Yi,Fh=zt.Buffer,Zc=Ch;function Wc(h){var n=h._cipher.encryptBlockRaw(h._prev);return Zc(h._prev),n}var Of=16;Lf.encrypt=function(h,n){var u=Math.ceil(n.length/Of),s=h._cache.length;h._cache=Fh.concat([h._cache,Fh.allocUnsafe(u*Of)]);for(var m=0;m<u;m++){var f=Wc(h),g=s+m*Of;h._cache.writeUInt32BE(f[0],g+0),h._cache.writeUInt32BE(f[1],g+4),h._cache.writeUInt32BE(f[2],g+8),h._cache.writeUInt32BE(f[3],g+12)}var y=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),Hc(n,y)};const qh={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var Vc={ECB:Ff,CBC:qf,CFB:Eh,CFB8:Ih,CFB1:Rh,OFB:Th,CTR:Lf,GCM:Lf},Nn=qh;for(var Ph in Nn)Nn[Ph].module=Vc[Nn[Ph].mode];var zf=Nn,Gi={},$n=zt.Buffer;function Kf(h){$n.isBuffer(h)||(h=$n.from(h));for(var n=h.length/4|0,u=new Array(n),s=0;s<n;s++)u[s]=h.readUInt32BE(s*4);return u}function Hf(h){for(var n=0;n<h.length;h++)h[n]=0}function Dh(h,n,u,s,m){for(var f=u[0],g=u[1],y=u[2],S=u[3],B=h[0]^n[0],M=h[1]^n[1],x=h[2]^n[2],I=h[3]^n[3],k,D,L,W,z=4,$=1;$<m;$++)k=f[B>>>24]^g[M>>>16&255]^y[x>>>8&255]^S[I&255]^n[z++],D=f[M>>>24]^g[x>>>16&255]^y[I>>>8&255]^S[B&255]^n[z++],L=f[x>>>24]^g[I>>>16&255]^y[B>>>8&255]^S[M&255]^n[z++],W=f[I>>>24]^g[B>>>16&255]^y[M>>>8&255]^S[x&255]^n[z++],B=k,M=D,x=L,I=W;return k=(s[B>>>24]<<24|s[M>>>16&255]<<16|s[x>>>8&255]<<8|s[I&255])^n[z++],D=(s[M>>>24]<<24|s[x>>>16&255]<<16|s[I>>>8&255]<<8|s[B&255])^n[z++],L=(s[x>>>24]<<24|s[I>>>16&255]<<16|s[B>>>8&255]<<8|s[M&255])^n[z++],W=(s[I>>>24]<<24|s[B>>>16&255]<<16|s[M>>>8&255]<<8|s[x&255])^n[z++],k=k>>>0,D=D>>>0,L=L>>>0,W=W>>>0,[k,D,L,W]}var Yc=[0,1,2,4,8,16,32,64,128,27,54],we=function(){for(var h=new Array(256),n=0;n<256;n++)n<128?h[n]=n<<1:h[n]=n<<1^283;for(var u=[],s=[],m=[[],[],[],[]],f=[[],[],[],[]],g=0,y=0,S=0;S<256;++S){var B=y^y<<1^y<<2^y<<3^y<<4;B=B>>>8^B&255^99,u[g]=B,s[B]=g;var M=h[g],x=h[M],I=h[x],k=h[B]*257^B*16843008;m[0][g]=k<<24|k>>>8,m[1][g]=k<<16|k>>>16,m[2][g]=k<<8|k>>>24,m[3][g]=k,k=I*16843009^x*65537^M*257^g*16843008,f[0][B]=k<<24|k>>>8,f[1][B]=k<<16|k>>>16,f[2][B]=k<<8|k>>>24,f[3][B]=k,g===0?g=y=1:(g=M^h[h[h[I^M]]],y^=h[h[y]])}return{SBOX:u,INV_SBOX:s,SUB_MIX:m,INV_SUB_MIX:f}}();function Xe(h){this._key=Kf(h),this._reset()}Xe.blockSize=4*4,Xe.keySize=256/8,Xe.prototype.blockSize=Xe.blockSize,Xe.prototype.keySize=Xe.keySize,Xe.prototype._reset=function(){for(var h=this._key,n=h.length,u=n+6,s=(u+1)*4,m=[],f=0;f<n;f++)m[f]=h[f];for(f=n;f<s;f++){var g=m[f-1];f%n===0?(g=g<<8|g>>>24,g=we.SBOX[g>>>24]<<24|we.SBOX[g>>>16&255]<<16|we.SBOX[g>>>8&255]<<8|we.SBOX[g&255],g^=Yc[f/n|0]<<24):n>6&&f%n===4&&(g=we.SBOX[g>>>24]<<24|we.SBOX[g>>>16&255]<<16|we.SBOX[g>>>8&255]<<8|we.SBOX[g&255]),m[f]=m[f-n]^g}for(var y=[],S=0;S<s;S++){var B=s-S,M=m[B-(S%4?0:4)];S<4||B<=4?y[S]=M:y[S]=we.INV_SUB_MIX[0][we.SBOX[M>>>24]]^we.INV_SUB_MIX[1][we.SBOX[M>>>16&255]]^we.INV_SUB_MIX[2][we.SBOX[M>>>8&255]]^we.INV_SUB_MIX[3][we.SBOX[M&255]]}this._nRounds=u,this._keySchedule=m,this._invKeySchedule=y},Xe.prototype.encryptBlockRaw=function(h){return h=Kf(h),Dh(h,this._keySchedule,we.SUB_MIX,we.SBOX,this._nRounds)},Xe.prototype.encryptBlock=function(h){var n=this.encryptBlockRaw(h),u=$n.allocUnsafe(16);return u.writeUInt32BE(n[0],0),u.writeUInt32BE(n[1],4),u.writeUInt32BE(n[2],8),u.writeUInt32BE(n[3],12),u},Xe.prototype.decryptBlock=function(h){h=Kf(h);var n=h[1];h[1]=h[3],h[3]=n;var u=Dh(h,this._invKeySchedule,we.INV_SUB_MIX,we.INV_SBOX,this._nRounds),s=$n.allocUnsafe(16);return s.writeUInt32BE(u[0],0),s.writeUInt32BE(u[3],4),s.writeUInt32BE(u[2],8),s.writeUInt32BE(u[1],12),s},Xe.prototype.scrub=function(){Hf(this._keySchedule),Hf(this._invKeySchedule),Hf(this._key)},Gi.AES=Xe;var pi=zt.Buffer,Jc=pi.alloc(16,0);function Gc(h){return[h.readUInt32BE(0),h.readUInt32BE(4),h.readUInt32BE(8),h.readUInt32BE(12)]}function Nh(h){var n=pi.allocUnsafe(16);return n.writeUInt32BE(h[0]>>>0,0),n.writeUInt32BE(h[1]>>>0,4),n.writeUInt32BE(h[2]>>>0,8),n.writeUInt32BE(h[3]>>>0,12),n}function Xi(h){this.h=h,this.state=pi.alloc(16,0),this.cache=pi.allocUnsafe(0)}Xi.prototype.ghash=function(h){for(var n=-1;++n<h.length;)this.state[n]^=h[n];this._multiply()},Xi.prototype._multiply=function(){for(var h=Gc(this.h),n=[0,0,0,0],u,s,m,f=-1;++f<128;){for(s=(this.state[~~(f/8)]&1<<7-f%8)!==0,s&&(n[0]^=h[0],n[1]^=h[1],n[2]^=h[2],n[3]^=h[3]),m=(h[3]&1)!==0,u=3;u>0;u--)h[u]=h[u]>>>1|(h[u-1]&1)<<31;h[0]=h[0]>>>1,m&&(h[0]=h[0]^225<<24)}this.state=Nh(n)},Xi.prototype.update=function(h){this.cache=pi.concat([this.cache,h]);for(var n;this.cache.length>=16;)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)},Xi.prototype.final=function(h,n){return this.cache.length&&this.ghash(pi.concat([this.cache,Jc],16)),this.ghash(Nh([0,h,0,n])),this.state};var Xc=Xi,jc=Gi,Ue=zt.Buffer,$h=Nr,Qc=Kt,Uh=Xc,t1=Yi,e1=Ch;function r1(h,n){var u=0;h.length!==n.length&&u++;for(var s=Math.min(h.length,n.length),m=0;m<s;++m)u+=h[m]^n[m];return u}function i1(h,n,u){if(n.length===12)return h._finID=Ue.concat([n,Ue.from([0,0,0,1])]),Ue.concat([n,Ue.from([0,0,0,2])]);var s=new Uh(u),m=n.length,f=m%16;s.update(n),f&&(f=16-f,s.update(Ue.alloc(f,0))),s.update(Ue.alloc(8,0));var g=m*8,y=Ue.alloc(8);y.writeUIntBE(g,0,8),s.update(y),h._finID=s.state;var S=Ue.from(h._finID);return e1(S),S}function ti(h,n,u,s){$h.call(this);var m=Ue.alloc(4,0);this._cipher=new jc.AES(n);var f=this._cipher.encryptBlock(m);this._ghash=new Uh(f),u=i1(this,u,f),this._prev=Ue.from(u),this._cache=Ue.allocUnsafe(0),this._secCache=Ue.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=h,this._authTag=null,this._called=!1}Qc(ti,$h),ti.prototype._update=function(h){if(!this._called&&this._alen){var n=16-this._alen%16;n<16&&(n=Ue.alloc(n,0),this._ghash.update(n))}this._called=!0;var u=this._mode.encrypt(this,h);return this._decrypt?this._ghash.update(h):this._ghash.update(u),this._len+=h.length,u},ti.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var h=t1(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&r1(h,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=h,this._cipher.scrub()},ti.prototype.getAuthTag=function(){if(this._decrypt||!Ue.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},ti.prototype.setAuthTag=function(n){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=n},ti.prototype.setAAD=function(n){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(n),this._alen+=n.length};var Lh=ti,n1=Gi,Zf=zt.Buffer,Oh=Nr,f1=Kt;function Un(h,n,u,s){Oh.call(this),this._cipher=new n1.AES(n),this._prev=Zf.from(u),this._cache=Zf.allocUnsafe(0),this._secCache=Zf.allocUnsafe(0),this._decrypt=s,this._mode=h}f1(Un,Oh),Un.prototype._update=function(h){return this._mode.encrypt(this,h,this._decrypt)},Un.prototype._final=function(){this._cipher.scrub()};var zh=Un,ei=zt.Buffer,a1=yf;function h1(h,n,u,s){if(ei.isBuffer(h)||(h=ei.from(h,"binary")),n&&(ei.isBuffer(n)||(n=ei.from(n,"binary")),n.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var m=u/8,f=ei.alloc(m),g=ei.alloc(s||0),y=ei.alloc(0);m>0||s>0;){var S=new a1;S.update(y),S.update(h),n&&S.update(n),y=S.digest();var B=0;if(m>0){var M=f.length-m;B=Math.min(m,y.length),y.copy(f,M,0,B),m-=B}if(B<y.length&&s>0){var x=g.length-s,I=Math.min(s,y.length-B);y.copy(g,x,B,B+I),s-=I}}return y.fill(0),{key:f,iv:g}}var Ln=h1,Kh=zf,s1=Lh,Br=zt.Buffer,o1=zh,Hh=Nr,u1=Gi,l1=Ln,d1=Kt;function ji(h,n,u){Hh.call(this),this._cache=new On,this._cipher=new u1.AES(n),this._prev=Br.from(u),this._mode=h,this._autopadding=!0}d1(ji,Hh),ji.prototype._update=function(h){this._cache.add(h);for(var n,u,s=[];n=this._cache.get();)u=this._mode.encrypt(this,n),s.push(u);return Br.concat(s)};var c1=Br.alloc(16,16);ji.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return h=this._mode.encrypt(this,h),this._cipher.scrub(),h;if(!h.equals(c1))throw this._cipher.scrub(),new Error("data not multiple of block length")},ji.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function On(){this.cache=Br.allocUnsafe(0)}On.prototype.add=function(h){this.cache=Br.concat([this.cache,h])},On.prototype.get=function(){if(this.cache.length>15){var h=this.cache.slice(0,16);return this.cache=this.cache.slice(16),h}return null},On.prototype.flush=function(){for(var h=16-this.cache.length,n=Br.allocUnsafe(h),u=-1;++u<h;)n.writeUInt8(h,u);return Br.concat([this.cache,n])};function Zh(h,n,u){var s=Kh[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof n=="string"&&(n=Br.from(n)),n.length!==s.key/8)throw new TypeError("invalid key length "+n.length);if(typeof u=="string"&&(u=Br.from(u)),s.mode!=="GCM"&&u.length!==s.iv)throw new TypeError("invalid iv length "+u.length);return s.type==="stream"?new o1(s.module,n,u):s.type==="auth"?new s1(s.module,n,u):new ji(s.module,n,u)}function v1(h,n){var u=Kh[h.toLowerCase()];if(!u)throw new TypeError("invalid suite type");var s=l1(n,!1,u.key,u.iv);return Zh(h,s.key,s.iv)}Cf.createCipheriv=Zh,Cf.createCipher=v1;var Wf={},p1=Lh,mi=zt.Buffer,Wh=zf,m1=zh,Vh=Nr,g1=Gi,b1=Ln,y1=Kt;function Qi(h,n,u){Vh.call(this),this._cache=new zn,this._last=void 0,this._cipher=new g1.AES(n),this._prev=mi.from(u),this._mode=h,this._autopadding=!0}y1(Qi,Vh),Qi.prototype._update=function(h){this._cache.add(h);for(var n,u,s=[];n=this._cache.get(this._autopadding);)u=this._mode.decrypt(this,n),s.push(u);return mi.concat(s)},Qi.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return w1(this._mode.decrypt(this,h));if(h)throw new Error("data not multiple of block length")},Qi.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function zn(){this.cache=mi.allocUnsafe(0)}zn.prototype.add=function(h){this.cache=mi.concat([this.cache,h])},zn.prototype.get=function(h){var n;if(h){if(this.cache.length>16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n}else if(this.cache.length>=16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n;return null},zn.prototype.flush=function(){if(this.cache.length)return this.cache};function w1(h){var n=h[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var u=-1;++u<n;)if(h[u+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return h.slice(0,16-n)}function Yh(h,n,u){var s=Wh[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof u=="string"&&(u=mi.from(u)),s.mode!=="GCM"&&u.length!==s.iv)throw new TypeError("invalid iv length "+u.length);if(typeof n=="string"&&(n=mi.from(n)),n.length!==s.key/8)throw new TypeError("invalid key length "+n.length);return s.type==="stream"?new m1(s.module,n,u,!0):s.type==="auth"?new p1(s.module,n,u,!0):new Qi(s.module,n,u)}function M1(h,n){var u=Wh[h.toLowerCase()];if(!u)throw new TypeError("invalid suite type");var s=b1(n,!1,u.key,u.iv);return Yh(h,s.key,s.iv)}Wf.createDecipher=M1,Wf.createDecipheriv=Yh;var Jh=Cf,Gh=Wf,x1=qh;function _1(){return Object.keys(x1)}Ze.createCipher=Ze.Cipher=Jh.createCipher,Ze.createCipheriv=Ze.Cipheriv=Jh.createCipheriv,Ze.createDecipher=Ze.Decipher=Gh.createDecipher,Ze.createDecipheriv=Ze.Decipheriv=Gh.createDecipheriv,Ze.listCiphers=Ze.getCiphers=_1;var Xh={};(function(h){h["des-ecb"]={key:8,iv:0},h["des-cbc"]=h.des={key:8,iv:8},h["des-ede3-cbc"]=h.des3={key:24,iv:8},h["des-ede3"]={key:24,iv:0},h["des-ede-cbc"]={key:16,iv:8},h["des-ede"]={key:16,iv:0}})(Xh);var jh=fc,Vf=Ze,Ur=zf,Er=Xh,Qh=Ln;function S1(h,n){h=h.toLowerCase();var u,s;if(Ur[h])u=Ur[h].key,s=Ur[h].iv;else if(Er[h])u=Er[h].key*8,s=Er[h].iv;else throw new TypeError("invalid suite type");var m=Qh(n,!1,u,s);return ts(h,m.key,m.iv)}function A1(h,n){h=h.toLowerCase();var u,s;if(Ur[h])u=Ur[h].key,s=Ur[h].iv;else if(Er[h])u=Er[h].key*8,s=Er[h].iv;else throw new TypeError("invalid suite type");var m=Qh(n,!1,u,s);return es(h,m.key,m.iv)}function ts(h,n,u){if(h=h.toLowerCase(),Ur[h])return Vf.createCipheriv(h,n,u);if(Er[h])return new jh({key:n,iv:u,mode:h});throw new TypeError("invalid suite type")}function es(h,n,u){if(h=h.toLowerCase(),Ur[h])return Vf.createDecipheriv(h,n,u);if(Er[h])return new jh({key:n,iv:u,mode:h,decrypt:!0});throw new TypeError("invalid suite type")}function B1(){return Object.keys(Er).concat(Vf.getCiphers())}rr.createCipher=rr.Cipher=S1,rr.createCipheriv=rr.Cipheriv=ts,rr.createDecipher=rr.Decipher=A1,rr.createDecipheriv=rr.Decipheriv=es,rr.listCiphers=rr.getCiphers=B1;var ri={},Yf={exports:{}};Yf.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(Yf);var rs=Yf.exports,Jf={exports:{}};Jf.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(Jf);var E1=Jf.exports,Kn={exports:{}},is;function Gf(){if(is)return Kn.exports;is=1;var h;Kn.exports=function(m){return h||(h=new n(null)),h.generate(m)};function n(s){this.rand=s}if(Kn.exports.Rand=n,n.prototype.generate=function(m){return this._rand(m)},n.prototype._rand=function(m){if(this.rand.getBytes)return this.rand.getBytes(m);for(var f=new Uint8Array(m),g=0;g<f.length;g++)f[g]=this.rand.getByte();return f},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.msCrypto.getRandomValues(f),f}:typeof window=="object"&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var u=Qo();if(typeof u.randomBytes!="function")throw new Error("Not supported");n.prototype._rand=function(m){return u.randomBytes(m)}}catch(s){}return Kn.exports}var Xf,ns;function fs(){if(ns)return Xf;ns=1;var h=E1,n=Gf();function u(s){this.rand=s||new n.Rand}return Xf=u,u.create=function(m){return new u(m)},u.prototype._randbelow=function(m){var f=m.bitLength(),g=Math.ceil(f/8);do var y=new h(this.rand.generate(g));while(y.cmp(m)>=0);return y},u.prototype._randrange=function(m,f){var g=f.sub(m);return m.add(this._randbelow(g))},u.prototype.test=function(m,f,g){var y=m.bitLength(),S=h.mont(m),B=new h(1).toRed(S);f||(f=Math.max(1,y/48|0));for(var M=m.subn(1),x=0;!M.testn(x);x++);for(var I=m.shrn(x),k=M.toRed(S),D=!0;f>0;f--){var L=this._randrange(new h(2),M);g&&g(L);var W=L.toRed(S).redPow(I);if(!(W.cmp(B)===0||W.cmp(k)===0)){for(var z=1;z<x;z++){if(W=W.redSqr(),W.cmp(B)===0)return!1;if(W.cmp(k)===0)break}if(z===x)return!1}}return D},u.prototype.getDivisor=function(m,f){var g=m.bitLength(),y=h.mont(m),S=new h(1).toRed(y);f||(f=Math.max(1,g/48|0));for(var B=m.subn(1),M=0;!B.testn(M);M++);for(var x=m.shrn(M),I=B.toRed(y);f>0;f--){var k=this._randrange(new h(2),B),D=m.gcd(k);if(D.cmpn(1)!==0)return D;var L=k.toRed(y).redPow(x);if(!(L.cmp(S)===0||L.cmp(I)===0)){for(var W=1;W<M;W++){if(L=L.redSqr(),L.cmp(S)===0)return L.fromRed().subn(1).gcd(m);if(L.cmp(I)===0)break}if(W===M)return L=L.redSqr(),L.fromRed().subn(1).gcd(m)}}return!1},Xf}var jf,as;function hs(){if(as)return jf;as=1;var h=li;jf=W,W.simpleSieve=D,W.fermatTest=L;var n=rs,u=new n(24),s=fs(),m=new s,f=new n(1),g=new n(2),y=new n(5);new n(16),new n(8);var S=new n(10),B=new n(3);new n(7);var M=new n(11),x=new n(4);new n(12);var I=null;function k(){if(I!==null)return I;var z=1048576,$=[];$[0]=2;for(var lt=1,H=3;H<z;H+=2){for(var At=Math.ceil(Math.sqrt(H)),Bt=0;Bt<lt&&$[Bt]<=At&&H%$[Bt]!==0;Bt++);lt!==Bt&&$[Bt]<=At||($[lt++]=H)}return I=$,$}function D(z){for(var $=k(),lt=0;lt<$.length;lt++)if(z.modn($[lt])===0)return z.cmpn($[lt])===0;return!0}function L(z){var $=n.mont(z);return g.toRed($).redPow(z.subn(1)).fromRed().cmpn(1)===0}function W(z,$){if(z<16)return $===2||$===5?new n([140,123]):new n([140,39]);$=new n($);for(var lt,H;;){for(lt=new n(h(Math.ceil(z/8)));lt.bitLength()>z;)lt.ishrn(1);if(lt.isEven()&<.iadd(f),lt.testn(1)||lt.iadd(g),$.cmp(g)){if(!$.cmp(y))for(;lt.mod(S).cmp(B);)lt.iadd(x)}else for(;lt.mod(u).cmp(M);)lt.iadd(x);if(H=lt.shrn(1),D(H)&&D(lt)&&L(H)&&L(lt)&&m.test(H)&&m.test(lt))return lt}}return jf}const k1={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}};var Qf,ss;function I1(){if(ss)return Qf;ss=1;var h=rs,n=fs(),u=new n,s=new h(24),m=new h(11),f=new h(10),g=new h(3),y=new h(7),S=hs(),B=li;Qf=D;function M(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._pub=new h(W),this}function x(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._priv=new h(W),this}var I={};function k(W,z){var $=z.toString("hex"),lt=[$,W.toString(16)].join("_");if(lt in I)return I[lt];var H=0;if(W.isEven()||!S.simpleSieve||!S.fermatTest(W)||!u.test(W))return H+=1,$==="02"||$==="05"?H+=8:H+=4,I[lt]=H,H;u.test(W.shrn(1))||(H+=2);var At;switch($){case"02":W.mod(s).cmp(m)&&(H+=8);break;case"05":At=W.mod(f),At.cmp(g)&&At.cmp(y)&&(H+=8);break;default:H+=4}return I[lt]=H,H}function D(W,z,$){this.setGenerator(z),this.__prime=new h(W),this._prime=h.mont(this.__prime),this._primeLen=W.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$?(this.setPublicKey=M,this.setPrivateKey=x):this._primeCode=8}Object.defineProperty(D.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=k(this.__prime,this.__gen)),this._primeCode}}),D.prototype.generateKeys=function(){return this._priv||(this._priv=new h(B(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},D.prototype.computeSecret=function(W){W=new h(W),W=W.toRed(this._prime);var z=W.redPow(this._priv).fromRed(),$=new mt(z.toArray()),lt=this.getPrime();if($.length<lt.length){var H=new mt(lt.length-$.length);H.fill(0),$=mt.concat([H,$])}return $},D.prototype.getPublicKey=function(z){return L(this._pub,z)},D.prototype.getPrivateKey=function(z){return L(this._priv,z)},D.prototype.getPrime=function(W){return L(this.__prime,W)},D.prototype.getGenerator=function(W){return L(this._gen,W)},D.prototype.setGenerator=function(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this.__gen=W,this._gen=new h(W),this};function L(W,z){var $=new mt(W.toArray());return z?$.toString(z):$}return Qf}var os;function R1(){if(os)return ri;os=1;var h=hs(),n=k1,u=I1();function s(g){var y=new mt(n[g].prime,"hex"),S=new mt(n[g].gen,"hex");return new u(y,S)}var m={binary:!0,hex:!0,base64:!0};function f(g,y,S,B){return mt.isBuffer(y)||m[y]===void 0?f(g,"binary",y,S):(y=y||"binary",B=B||"binary",S=S||new mt([2]),mt.isBuffer(S)||(S=new mt(S,B)),typeof g=="number"?new u(h(g,S),S,!0):(mt.isBuffer(g)||(g=new mt(g,y)),new u(g,S,!0)))}return ri.DiffieHellmanGroup=ri.createDiffieHellmanGroup=ri.getDiffieHellman=s,ri.createDiffieHellman=ri.DiffieHellman=f,ri}var t0={exports:{}},e0={exports:{}};typeof ye=="undefined"||!ye.version||ye.version.indexOf("v0.")===0||ye.version.indexOf("v1.")===0&&ye.version.indexOf("v1.8.")!==0?e0.exports={nextTick:T1}:e0.exports=ye;function T1(h,n,u,s){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var m=arguments.length,f,g;switch(m){case 0:case 1:return ye.nextTick(h);case 2:return ye.nextTick(function(){h.call(null,n)});case 3:return ye.nextTick(function(){h.call(null,n,u)});case 4:return ye.nextTick(function(){h.call(null,n,u,s)});default:for(f=new Array(m-1),g=0;g<f.length;)f[g++]=arguments[g];return ye.nextTick(function(){h.apply(null,f)})}}var Hn=e0.exports,C1={}.toString,F1=Array.isArray||function(h){return C1.call(h)=="[object Array]"},us=Ne.EventEmitter,r0={exports:{}};(function(h,n){var u=Ke,s=u.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?h.exports=u:(m(u,n),n.Buffer=f);function f(g,y,S){return s(g,y,S)}m(s,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return s(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=s(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(g)}})(r0,r0.exports);var i0=r0.exports,Me={};function q1(h){return Array.isArray?Array.isArray(h):Zn(h)==="[object Array]"}Me.isArray=q1;function P1(h){return typeof h=="boolean"}Me.isBoolean=P1;function D1(h){return h===null}Me.isNull=D1;function N1(h){return h==null}Me.isNullOrUndefined=N1;function $1(h){return typeof h=="number"}Me.isNumber=$1;function U1(h){return typeof h=="string"}Me.isString=U1;function L1(h){return typeof h=="symbol"}Me.isSymbol=L1;function O1(h){return h===void 0}Me.isUndefined=O1;function z1(h){return Zn(h)==="[object RegExp]"}Me.isRegExp=z1;function K1(h){return typeof h=="object"&&h!==null}Me.isObject=K1;function H1(h){return Zn(h)==="[object Date]"}Me.isDate=H1;function Z1(h){return Zn(h)==="[object Error]"||h instanceof Error}Me.isError=Z1;function W1(h){return typeof h=="function"}Me.isFunction=W1;function V1(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h=="undefined"}Me.isPrimitive=V1,Me.isBuffer=Ke.Buffer.isBuffer;function Zn(h){return Object.prototype.toString.call(h)}var n0={exports:{}},ls;function Y1(){return ls||(ls=1,function(h){function n(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var u=i0.Buffer,s=Ne;function m(f,g,y){f.copy(g,y)}h.exports=function(){function f(){n(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(y){var S={data:y,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},f.prototype.unshift=function(y){var S={data:y,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},f.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(y){if(this.length===0)return"";for(var S=this.head,B=""+S.data;S=S.next;)B+=y+S.data;return B},f.prototype.concat=function(y){if(this.length===0)return u.alloc(0);for(var S=u.allocUnsafe(y>>>0),B=this.head,M=0;B;)m(B.data,S,M),M+=B.data.length,B=B.next;return S},f}(),s&&s.inspect&&s.inspect.custom&&(h.exports.prototype[s.inspect.custom]=function(){var f=s.inspect({length:this.length});return this.constructor.name+" "+f})}(n0)),n0.exports}var Wn=Hn;function J1(h,n){var u=this,s=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return s||m?(n?n(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Wn.nextTick(Vn,this,h)):Wn.nextTick(Vn,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(f){!n&&f?u._writableState?u._writableState.errorEmitted||(u._writableState.errorEmitted=!0,Wn.nextTick(Vn,u,f)):Wn.nextTick(Vn,u,f):n&&n(f)}),this)}function G1(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Vn(h,n){h.emit("error",n)}var ds={destroy:J1,undestroy:G1},X1=j1;function j1(h,n){if(f0("noDeprecation"))return h;var u=!1;function s(){if(!u){if(f0("throwDeprecation"))throw new Error(n);f0("traceDeprecation")?console.trace(n):console.warn(n),u=!0}return h.apply(this,arguments)}return s}function f0(h){try{if(!Ft.localStorage)return!1}catch(u){return!1}var n=Ft.localStorage[h];return n==null?!1:String(n).toLowerCase()==="true"}var a0,cs;function vs(){if(cs)return a0;cs=1;var h=Hn;a0=L;function n(c){var v=this;this.next=null,this.entry=null,this.finish=function(){d(v,c)}}var u=!ye.browser&&["v0.10","v0.9."].indexOf(ye.version.slice(0,5))>-1?setImmediate:h.nextTick,s;L.WritableState=k;var m=Object.create(Me);m.inherits=Kt;var f={deprecate:X1},g=us,y=i0.Buffer,S=(typeof Ft!="undefined"?Ft:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function B(c){return y.from(c)}function M(c){return y.isBuffer(c)||c instanceof S}var x=ds;m.inherits(L,g);function I(){}function k(c,v){s=s||gi(),c=c||{};var o=v instanceof s;this.objectMode=!!c.objectMode,o&&(this.objectMode=this.objectMode||!!c.writableObjectMode);var e=c.highWaterMark,l=c.writableHighWaterMark,b=this.objectMode?16:16*1024;e||e===0?this.highWaterMark=e:o&&(l||l===0)?this.highWaterMark=l:this.highWaterMark=b,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _=c.decodeStrings===!1;this.decodeStrings=!_,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(C){Ct(v,C)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}k.prototype.getBuffer=function(){for(var v=this.bufferedRequest,o=[];v;)o.push(v),v=v.next;return o},function(){try{Object.defineProperty(k.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(c){}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(c){return D.call(this,c)?!0:this!==L?!1:c&&c._writableState instanceof k}})):D=function(c){return c instanceof this};function L(c){if(s=s||gi(),!D.call(L,this)&&!(this instanceof s))return new L(c);this._writableState=new k(c,this),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),g.call(this)}L.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function W(c,v){var o=new Error("write after end");c.emit("error",o),h.nextTick(v,o)}function z(c,v,o,e){var l=!0,b=!1;return o===null?b=new TypeError("May not write null values to stream"):typeof o!="string"&&o!==void 0&&!v.objectMode&&(b=new TypeError("Invalid non-string/buffer chunk")),b&&(c.emit("error",b),h.nextTick(e,b),l=!1),l}L.prototype.write=function(c,v,o){var e=this._writableState,l=!1,b=!e.objectMode&&M(c);return b&&!y.isBuffer(c)&&(c=B(c)),typeof v=="function"&&(o=v,v=null),b?v="buffer":v||(v=e.defaultEncoding),typeof o!="function"&&(o=I),e.ended?W(this,o):(b||z(this,e,c,o))&&(e.pendingcb++,l=lt(this,e,b,c,v,o)),l},L.prototype.cork=function(){var c=this._writableState;c.corked++},L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&It(this,c))},L.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+v);return this._writableState.defaultEncoding=v,this};function $(c,v,o){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=y.from(v,o)),v}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function lt(c,v,o,e,l,b){if(!o){var _=$(v,e,l);e!==_&&(o=!0,l="buffer",e=_)}var C=v.objectMode?1:e.length;v.length+=C;var q=v.length<v.highWaterMark;if(q||(v.needDrain=!0),v.writing||v.corked){var O=v.lastBufferedRequest;v.lastBufferedRequest={chunk:e,encoding:l,isBuf:o,callback:b,next:null},O?O.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else H(c,v,!1,C,e,l,b);return q}function H(c,v,o,e,l,b,_){v.writelen=e,v.writecb=_,v.writing=!0,v.sync=!0,o?c._writev(l,v.onwrite):c._write(l,b,v.onwrite),v.sync=!1}function At(c,v,o,e,l){--v.pendingcb,o?(h.nextTick(l,e),h.nextTick(i,c,v),c._writableState.errorEmitted=!0,c.emit("error",e)):(l(e),c._writableState.errorEmitted=!0,c.emit("error",e),i(c,v))}function Bt(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function Ct(c,v){var o=c._writableState,e=o.sync,l=o.writecb;if(Bt(o),v)At(c,o,e,v,l);else{var b=p(o);!b&&!o.corked&&!o.bufferProcessing&&o.bufferedRequest&&It(c,o),e?u(Et,c,o,b,l):Et(c,o,b,l)}}function Et(c,v,o,e){o||Y(c,v),v.pendingcb--,e(),i(c,v)}function Y(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function It(c,v){v.bufferProcessing=!0;var o=v.bufferedRequest;if(c._writev&&o&&o.next){var e=v.bufferedRequestCount,l=new Array(e),b=v.corkedRequestsFree;b.entry=o;for(var _=0,C=!0;o;)l[_]=o,o.isBuf||(C=!1),o=o.next,_+=1;l.allBuffers=C,H(c,v,!0,v.length,l,"",b.finish),v.pendingcb++,v.lastBufferedRequest=null,b.next?(v.corkedRequestsFree=b.next,b.next=null):v.corkedRequestsFree=new n(v),v.bufferedRequestCount=0}else{for(;o;){var q=o.chunk,O=o.encoding,R=o.callback,P=v.objectMode?1:q.length;if(H(c,v,!1,P,q,O,R),o=o.next,v.bufferedRequestCount--,v.writing)break}o===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=o,v.bufferProcessing=!1}L.prototype._write=function(c,v,o){o(new Error("_write() is not implemented"))},L.prototype._writev=null,L.prototype.end=function(c,v,o){var e=this._writableState;typeof c=="function"?(o=c,c=null,v=null):typeof v=="function"&&(o=v,v=null),c!=null&&this.write(c,v),e.corked&&(e.corked=1,this.uncork()),e.ending||a(this,e,o)};function p(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function t(c,v){c._final(function(o){v.pendingcb--,o&&c.emit("error",o),v.prefinished=!0,c.emit("prefinish"),i(c,v)})}function r(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"?(v.pendingcb++,v.finalCalled=!0,h.nextTick(t,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function i(c,v){var o=p(v);return o&&(r(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"))),o}function a(c,v,o){v.ending=!0,i(c,v),o&&(v.finished?h.nextTick(o):c.once("finish",o)),v.ended=!0,c.writable=!1}function d(c,v,o){var e=c.entry;for(c.entry=null;e;){var l=e.callback;v.pendingcb--,l(o),e=e.next}v.corkedRequestsFree.next=c}return Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(c){this._writableState&&(this._writableState.destroyed=c)}}),L.prototype.destroy=x.destroy,L.prototype._undestroy=x.undestroy,L.prototype._destroy=function(c,v){this.end(),v(c)},a0}var h0,ps;function gi(){if(ps)return h0;ps=1;var h=Hn,n=Object.keys||function(x){var I=[];for(var k in x)I.push(k);return I};h0=S;var u=Object.create(Me);u.inherits=Kt;var s=gs(),m=vs();u.inherits(S,s);for(var f=n(m.prototype),g=0;g<f.length;g++){var y=f[g];S.prototype[y]||(S.prototype[y]=m.prototype[y])}function S(x){if(!(this instanceof S))return new S(x);s.call(this,x),m.call(this,x),x&&x.readable===!1&&(this.readable=!1),x&&x.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,x&&x.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",B)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(){this.allowHalfOpen||this._writableState.ended||h.nextTick(M,this)}function M(x){x.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(x){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=x,this._writableState.destroyed=x)}}),S.prototype._destroy=function(x,I){this.push(null),this.end(),h.nextTick(I,x)},h0}var s0,ms;function gs(){if(ms)return s0;ms=1;var h=Hn;s0=$;var n=F1,u;$.ReadableState=z,Ne.EventEmitter;var s=function(R,P){return R.listeners(P).length},m=us,f=i0.Buffer,g=(typeof Ft!="undefined"?Ft:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function y(R){return f.from(R)}function S(R){return f.isBuffer(R)||R instanceof g}var B=Object.create(Me);B.inherits=Kt;var M=Ne,x=void 0;M&&M.debuglog?x=M.debuglog("stream"):x=function(){};var I=Y1(),k=ds,D;B.inherits($,m);var L=["error","close","destroy","pause","resume"];function W(R,P,N){if(typeof R.prependListener=="function")return R.prependListener(P,N);!R._events||!R._events[P]?R.on(P,N):n(R._events[P])?R._events[P].unshift(N):R._events[P]=[N,R._events[P]]}function z(R,P){u=u||gi(),R=R||{};var N=P instanceof u;this.objectMode=!!R.objectMode,N&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var K=R.highWaterMark,kt=R.readableHighWaterMark,Z=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:N&&(kt||kt===0)?this.highWaterMark=kt:this.highWaterMark=Z,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(D||(D=wn.StringDecoder),this.decoder=new D(R.encoding),this.encoding=R.encoding)}function $(R){if(u=u||gi(),!(this instanceof $))return new $(R);this._readableState=new z(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),m.call(this)}Object.defineProperty($.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),$.prototype.destroy=k.destroy,$.prototype._undestroy=k.undestroy,$.prototype._destroy=function(R,P){this.push(null),P(R)},$.prototype.push=function(R,P){var N=this._readableState,K;return N.objectMode?K=!0:typeof R=="string"&&(P=P||N.defaultEncoding,P!==N.encoding&&(R=f.from(R,P),P=""),K=!0),lt(this,R,P,!1,K)},$.prototype.unshift=function(R){return lt(this,R,null,!0,!1)};function lt(R,P,N,K,kt){var Z=R._readableState;if(P===null)Z.reading=!1,It(R,Z);else{var J;kt||(J=At(Z,P)),J?R.emit("error",J):Z.objectMode||P&&P.length>0?(typeof P!="string"&&!Z.objectMode&&Object.getPrototypeOf(P)!==f.prototype&&(P=y(P)),K?Z.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):H(R,Z,P,!0):Z.ended?R.emit("error",new Error("stream.push() after EOF")):(Z.reading=!1,Z.decoder&&!N?(P=Z.decoder.write(P),Z.objectMode||P.length!==0?H(R,Z,P,!1):r(R,Z)):H(R,Z,P,!1))):K||(Z.reading=!1)}return Bt(Z)}function H(R,P,N,K){P.flowing&&P.length===0&&!P.sync?(R.emit("data",N),R.read(0)):(P.length+=P.objectMode?1:N.length,K?P.buffer.unshift(N):P.buffer.push(N),P.needReadable&&p(R)),r(R,P)}function At(R,P){var N;return!S(P)&&typeof P!="string"&&P!==void 0&&!R.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}function Bt(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(R){return D||(D=wn.StringDecoder),this._readableState.decoder=new D(R),this._readableState.encoding=R,this};var Ct=8388608;function Et(R){return R>=Ct?R=Ct:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function Y(R,P){return R<=0||P.length===0&&P.ended?0:P.objectMode?1:R!==R?P.flowing&&P.length?P.buffer.head.data.length:P.length:(R>P.highWaterMark&&(P.highWaterMark=Et(R)),R<=P.length?R:P.ended?P.length:(P.needReadable=!0,0))}$.prototype.read=function(R){x("read",R),R=parseInt(R,10);var P=this._readableState,N=R;if(R!==0&&(P.emittedReadable=!1),R===0&&P.needReadable&&(P.length>=P.highWaterMark||P.ended))return x("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?C(this):p(this),null;if(R=Y(R,P),R===0&&P.ended)return P.length===0&&C(this),null;var K=P.needReadable;x("need readable",K),(P.length===0||P.length-R<P.highWaterMark)&&(K=!0,x("length less than watermark",K)),P.ended||P.reading?(K=!1,x("reading or ended",K)):K&&(x("do read"),P.reading=!0,P.sync=!0,P.length===0&&(P.needReadable=!0),this._read(P.highWaterMark),P.sync=!1,P.reading||(R=Y(N,P)));var kt;return R>0?kt=e(R,P):kt=null,kt===null?(P.needReadable=!0,R=0):P.length-=R,P.length===0&&(P.ended||(P.needReadable=!0),N!==R&&P.ended&&C(this)),kt!==null&&this.emit("data",kt),kt};function It(R,P){if(!P.ended){if(P.decoder){var N=P.decoder.end();N&&N.length&&(P.buffer.push(N),P.length+=P.objectMode?1:N.length)}P.ended=!0,p(R)}}function p(R){var P=R._readableState;P.needReadable=!1,P.emittedReadable||(x("emitReadable",P.flowing),P.emittedReadable=!0,P.sync?h.nextTick(t,R):t(R))}function t(R){x("emit readable"),R.emit("readable"),o(R)}function r(R,P){P.readingMore||(P.readingMore=!0,h.nextTick(i,R,P))}function i(R,P){for(var N=P.length;!P.reading&&!P.flowing&&!P.ended&&P.length<P.highWaterMark&&(x("maybeReadMore read 0"),R.read(0),N!==P.length);)N=P.length;P.readingMore=!1}$.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},$.prototype.pipe=function(R,P){var N=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=R;break;case 1:K.pipes=[K.pipes,R];break;default:K.pipes.push(R);break}K.pipesCount+=1,x("pipe count=%d opts=%j",K.pipesCount,P);var kt=(!P||P.end!==!1)&&R!==ye.stdout&&R!==ye.stderr,Z=kt?qt:Pt;K.endEmitted?h.nextTick(Z):N.once("end",Z),R.on("unpipe",J);function J(Q,ct){x("onunpipe"),Q===N&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Nt())}function qt(){x("onend"),R.end()}var tt=a(N);R.on("drain",tt);var vt=!1;function Nt(){x("cleanup"),R.removeListener("close",j),R.removeListener("finish",dt),R.removeListener("drain",tt),R.removeListener("error",Dt),R.removeListener("unpipe",J),N.removeListener("end",qt),N.removeListener("end",Pt),N.removeListener("data",pt),vt=!0,K.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&tt()}var et=!1;N.on("data",pt);function pt(Q){x("ondata"),et=!1;var ct=R.write(Q);ct===!1&&!et&&((K.pipesCount===1&&K.pipes===R||K.pipesCount>1&&O(K.pipes,R)!==-1)&&!vt&&(x("false write response, pause",K.awaitDrain),K.awaitDrain++,et=!0),N.pause())}function Dt(Q){x("onerror",Q),Pt(),R.removeListener("error",Dt),s(R,"error")===0&&R.emit("error",Q)}W(R,"error",Dt);function j(){R.removeListener("finish",dt),Pt()}R.once("close",j);function dt(){x("onfinish"),R.removeListener("close",j),Pt()}R.once("finish",dt);function Pt(){x("unpipe"),N.unpipe(R)}return R.emit("pipe",N),K.flowing||(x("pipe resume"),N.resume()),R};function a(R){return function(){var P=R._readableState;x("pipeOnDrain",P.awaitDrain),P.awaitDrain&&P.awaitDrain--,P.awaitDrain===0&&s(R,"data")&&(P.flowing=!0,o(R))}}$.prototype.unpipe=function(R){var P=this._readableState,N={hasUnpiped:!1};if(P.pipesCount===0)return this;if(P.pipesCount===1)return R&&R!==P.pipes?this:(R||(R=P.pipes),P.pipes=null,P.pipesCount=0,P.flowing=!1,R&&R.emit("unpipe",this,N),this);if(!R){var K=P.pipes,kt=P.pipesCount;P.pipes=null,P.pipesCount=0,P.flowing=!1;for(var Z=0;Z<kt;Z++)K[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var J=O(P.pipes,R);return J===-1?this:(P.pipes.splice(J,1),P.pipesCount-=1,P.pipesCount===1&&(P.pipes=P.pipes[0]),R.emit("unpipe",this,N),this)},$.prototype.on=function(R,P){var N=m.prototype.on.call(this,R,P);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var K=this._readableState;!K.endEmitted&&!K.readableListening&&(K.readableListening=K.needReadable=!0,K.emittedReadable=!1,K.reading?K.length&&p(this):h.nextTick(d,this))}return N},$.prototype.addListener=$.prototype.on;function d(R){x("readable nexttick read 0"),R.read(0)}$.prototype.resume=function(){var R=this._readableState;return R.flowing||(x("resume"),R.flowing=!0,c(this,R)),this};function c(R,P){P.resumeScheduled||(P.resumeScheduled=!0,h.nextTick(v,R,P))}function v(R,P){P.reading||(x("resume read 0"),R.read(0)),P.resumeScheduled=!1,P.awaitDrain=0,R.emit("resume"),o(R),P.flowing&&!P.reading&&R.read(0)}$.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function o(R){var P=R._readableState;for(x("flow",P.flowing);P.flowing&&R.read()!==null;);}$.prototype.wrap=function(R){var P=this,N=this._readableState,K=!1;R.on("end",function(){if(x("wrapped end"),N.decoder&&!N.ended){var J=N.decoder.end();J&&J.length&&P.push(J)}P.push(null)}),R.on("data",function(J){if(x("wrapped data"),N.decoder&&(J=N.decoder.write(J)),!(N.objectMode&&J==null)&&!(!N.objectMode&&(!J||!J.length))){var qt=P.push(J);qt||(K=!0,R.pause())}});for(var kt in R)this[kt]===void 0&&typeof R[kt]=="function"&&(this[kt]=function(J){return function(){return R[J].apply(R,arguments)}}(kt));for(var Z=0;Z<L.length;Z++)R.on(L[Z],this.emit.bind(this,L[Z]));return this._read=function(J){x("wrapped _read",J),K&&(K=!1,R.resume())},this},Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),$._fromList=e;function e(R,P){if(P.length===0)return null;var N;return P.objectMode?N=P.buffer.shift():!R||R>=P.length?(P.decoder?N=P.buffer.join(""):P.buffer.length===1?N=P.buffer.head.data:N=P.buffer.concat(P.length),P.buffer.clear()):N=l(R,P.buffer,P.decoder),N}function l(R,P,N){var K;return R<P.head.data.length?(K=P.head.data.slice(0,R),P.head.data=P.head.data.slice(R)):R===P.head.data.length?K=P.shift():K=N?b(R,P):_(R,P),K}function b(R,P){var N=P.head,K=1,kt=N.data;for(R-=kt.length;N=N.next;){var Z=N.data,J=R>Z.length?Z.length:R;if(J===Z.length?kt+=Z:kt+=Z.slice(0,R),R-=J,R===0){J===Z.length?(++K,N.next?P.head=N.next:P.head=P.tail=null):(P.head=N,N.data=Z.slice(J));break}++K}return P.length-=K,kt}function _(R,P){var N=f.allocUnsafe(R),K=P.head,kt=1;for(K.data.copy(N),R-=K.data.length;K=K.next;){var Z=K.data,J=R>Z.length?Z.length:R;if(Z.copy(N,N.length-R,0,J),R-=J,R===0){J===Z.length?(++kt,K.next?P.head=K.next:P.head=P.tail=null):(P.head=K,K.data=Z.slice(J));break}++kt}return P.length-=kt,N}function C(R){var P=R._readableState;if(P.length>0)throw new Error('"endReadable()" called on non-empty stream');P.endEmitted||(P.ended=!0,h.nextTick(q,P,R))}function q(R,P){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,P.readable=!1,P.emit("end"))}function O(R,P){for(var N=0,K=R.length;N<K;N++)if(R[N]===P)return N;return-1}return s0}var bs=kr,Yn=gi(),ys=Object.create(Me);ys.inherits=Kt,ys.inherits(kr,Yn);function Q1(h,n){var u=this._transformState;u.transforming=!1;var s=u.writecb;if(!s)return this.emit("error",new Error("write callback called multiple times"));u.writechunk=null,u.writecb=null,n!=null&&this.push(n),s(h);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function kr(h){if(!(this instanceof kr))return new kr(h);Yn.call(this,h),this._transformState={afterTransform:Q1.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",tv)}function tv(){var h=this;typeof this._flush=="function"?this._flush(function(n,u){ws(h,n,u)}):ws(this,null,null)}kr.prototype.push=function(h,n){return this._transformState.needTransform=!1,Yn.prototype.push.call(this,h,n)},kr.prototype._transform=function(h,n,u){throw new Error("_transform() is not implemented")},kr.prototype._write=function(h,n,u){var s=this._transformState;if(s.writecb=u,s.writechunk=h,s.writeencoding=n,!s.transforming){var m=this._readableState;(s.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},kr.prototype._read=function(h){var n=this._transformState;n.writechunk!==null&&n.writecb&&!n.transforming?(n.transforming=!0,this._transform(n.writechunk,n.writeencoding,n.afterTransform)):n.needTransform=!0},kr.prototype._destroy=function(h,n){var u=this;Yn.prototype._destroy.call(this,h,function(s){n(s),u.emit("close")})};function ws(h,n,u){if(n)return h.emit("error",n);if(u!=null&&h.push(u),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}var ev=tn,Ms=bs,xs=Object.create(Me);xs.inherits=Kt,xs.inherits(tn,Ms);function tn(h){if(!(this instanceof tn))return new tn(h);Ms.call(this,h)}tn.prototype._transform=function(h,n,u){u(null,h)},function(h,n){n=h.exports=gs(),n.Stream=n,n.Readable=n,n.Writable=vs(),n.Duplex=gi(),n.Transform=bs,n.PassThrough=ev}(t0,t0.exports);var rv=t0.exports,en={exports:{}},o0={exports:{}};o0.exports,function(h){(function(n,u){function s(r,i){if(!r)throw new Error(i||"Assertion failed")}function m(r,i){r.super_=i;var a=function(){};a.prototype=i.prototype,r.prototype=new a,r.prototype.constructor=r}function f(r,i,a){if(f.isBN(r))return r;this.negative=0,this.words=null,this.length=0,this.red=null,r!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(r||0,i||10,a||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(r){}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,a){return i.cmp(a)>0?i:a},f.min=function(i,a){return i.cmp(a)<0?i:a},f.prototype._init=function(i,a,d){if(typeof i=="number")return this._initNumber(i,a,d);if(typeof i=="object")return this._initArray(i,a,d);a==="hex"&&(a=16),s(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c<i.length&&(a===16?this._parseHex(i,c,d):(this._parseBase(i,a,c),d==="le"&&this._initArray(this.toArray(),a,d)))},f.prototype._initNumber=function(i,a,d){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(s(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),a,d)},f.prototype._initArray=function(i,a,d){if(s(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v,o,e=0;if(d==="be")for(c=i.length-1,v=0;c>=0;c-=3)o=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[v]|=o<<e&67108863,this.words[v+1]=o>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);else if(d==="le")for(c=0,v=0;c<i.length;c+=3)o=i[c]|i[c+1]<<8|i[c+2]<<16,this.words[v]|=o<<e&67108863,this.words[v+1]=o>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);return this._strip()};function y(r,i){var a=r.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;s(!1,"Invalid character in "+r)}function S(r,i,a){var d=y(r,a);return a-1>=i&&(d|=y(r,a-1)<<4),d}f.prototype._parseHex=function(i,a,d){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v=0,o=0,e;if(d==="be")for(c=i.length-1;c>=a;c-=2)e=S(i,a,c)<<v,this.words[o]|=e&67108863,v>=18?(v-=18,o+=1,this.words[o]|=e>>>26):v+=8;else{var l=i.length-a;for(c=l%2===0?a+1:a;c<i.length;c+=2)e=S(i,a,c)<<v,this.words[o]|=e&67108863,v>=18?(v-=18,o+=1,this.words[o]|=e>>>26):v+=8}this._strip()};function B(r,i,a,d){for(var c=0,v=0,o=Math.min(r.length,a),e=i;e<o;e++){var l=r.charCodeAt(e)-48;c*=d,l>=49?v=l-49+10:l>=17?v=l-17+10:v=l,s(l>=0&&v<d,"Invalid character"),c+=v}return c}f.prototype._parseBase=function(i,a,d){this.words=[0],this.length=1;for(var c=0,v=1;v<=67108863;v*=a)c++;c--,v=v/a|0;for(var o=i.length-d,e=o%c,l=Math.min(o,o-e)+d,b=0,_=d;_<l;_+=c)b=B(i,_,_+c,a),this.imuln(v),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(e!==0){var C=1;for(b=B(i,_,i.length,a),_=0;_<e;_++)C*=a;this.imuln(C),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var a=0;a<this.length;a++)i.words[a]=this.words[a];i.length=this.length,i.negative=this.negative,i.red=this.red};function M(r,i){r.words=i.words,r.length=i.length,r.negative=i.negative,r.red=i.red}if(f.prototype._move=function(i){M(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch(r){f.prototype.inspect=x}else f.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","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"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(i,a){i=i||10,a=a|0||1;var d;if(i===16||i==="hex"){d="";for(var c=0,v=0,o=0;o<this.length;o++){var e=this.words[o],l=((e<<c|v)&16777215).toString(16);v=e>>>24-c&16777215,c+=2,c>=26&&(c-=26,o--),v!==0||o!==this.length-1?d=I[6-l.length]+l+d:d=l+d}for(v!==0&&(d=v.toString(16)+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(i===(i|0)&&i>=2&&i<=36){var b=k[i],_=D[i];d="";var C=this.clone();for(C.negative=0;!C.isZero();){var q=C.modrn(_).toString(i);C=C.idivn(_),C.isZero()?d=q+d:d=I[b-q.length]+q+d}for(this.isZero()&&(d="0"+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},g&&(f.prototype.toBuffer=function(i,a){return this.toArrayLike(g,i,a)}),f.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var L=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};f.prototype.toArrayLike=function(i,a,d){this._strip();var c=this.byteLength(),v=d||Math.max(1,c);s(c<=v,"byte array longer than desired length"),s(v>0,"Requested array length <= 0");var o=L(i,v),e=a==="le"?"LE":"BE";return this["_toArrayLike"+e](o,c),o},f.prototype._toArrayLikeLE=function(i,a){for(var d=0,c=0,v=0,o=0;v<this.length;v++){var e=this.words[v]<<o|c;i[d++]=e&255,d<i.length&&(i[d++]=e>>8&255),d<i.length&&(i[d++]=e>>16&255),o===6?(d<i.length&&(i[d++]=e>>24&255),c=0,o=0):(c=e>>>24,o+=2)}if(d<i.length)for(i[d++]=c;d<i.length;)i[d++]=0},f.prototype._toArrayLikeBE=function(i,a){for(var d=i.length-1,c=0,v=0,o=0;v<this.length;v++){var e=this.words[v]<<o|c;i[d--]=e&255,d>=0&&(i[d--]=e>>8&255),d>=0&&(i[d--]=e>>16&255),o===6?(d>=0&&(i[d--]=e>>24&255),c=0,o=0):(c=e>>>24,o+=2)}if(d>=0)for(i[d--]=c;d>=0;)i[d--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var a=i,d=0;return a>=4096&&(d+=13,a>>>=13),a>=64&&(d+=7,a>>>=7),a>=8&&(d+=4,a>>>=4),a>=2&&(d+=2,a>>>=2),d+a},f.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,d=0;return a&8191||(d+=13,a>>>=13),a&127||(d+=7,a>>>=7),a&15||(d+=4,a>>>=4),a&3||(d+=2,a>>>=2),a&1||d++,d},f.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function W(r){for(var i=new Array(r.bitLength()),a=0;a<i.length;a++){var d=a/26|0,c=a%26;i[a]=r.words[d]>>>c&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;a<this.length;a++){var d=this._zeroBits(this.words[a]);if(i+=d,d!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var a=0;a<i.length;a++)this.words[a]=this.words[a]|i.words[a];return this._strip()},f.prototype.ior=function(i){return s((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]&i.words[d];return this.length=a.length,this._strip()},f.prototype.iand=function(i){return s((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var a,d;this.length>i.length?(a=this,d=i):(a=i,d=this);for(var c=0;c<d.length;c++)this.words[c]=a.words[c]^d.words[c];if(this!==a)for(;c<a.length;c++)this.words[c]=a.words[c];return this.length=a.length,this._strip()},f.prototype.ixor=function(i){return s((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){s(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,d=i%26;this._expand(a),d>0&&a--;for(var c=0;c<a;c++)this.words[c]=~this.words[c]&67108863;return d>0&&(this.words[c]=~this.words[c]&67108863>>26-d),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,a){s(typeof i=="number"&&i>=0);var d=i/26|0,c=i%26;return this._expand(d+1),a?this.words[d]=this.words[d]|1<<c:this.words[d]=this.words[d]&~(1<<c),this._strip()},f.prototype.iadd=function(i){var a;if(this.negative!==0&&i.negative===0)return this.negative=0,a=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,a=this.isub(i),i.negative=1,a._normSign();var d,c;this.length>i.length?(d=this,c=i):(d=i,c=this);for(var v=0,o=0;o<c.length;o++)a=(d.words[o]|0)+(c.words[o]|0)+v,this.words[o]=a&67108863,v=a>>>26;for(;v!==0&&o<d.length;o++)a=(d.words[o]|0)+v,this.words[o]=a&67108863,v=a>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;o<d.length;o++)this.words[o]=d.words[o];return this},f.prototype.add=function(i){var a;return i.negative!==0&&this.negative===0?(i.negative=0,a=this.sub(i),i.negative^=1,a):i.negative===0&&this.negative!==0?(this.negative=0,a=i.sub(this),this.negative=1,a):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var d=this.cmp(i);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,v;d>0?(c=this,v=i):(c=i,v=this);for(var o=0,e=0;e<v.length;e++)a=(c.words[e]|0)-(v.words[e]|0)+o,o=a>>26,this.words[e]=a&67108863;for(;o!==0&&e<c.length;e++)a=(c.words[e]|0)+o,o=a>>26,this.words[e]=a&67108863;if(o===0&&e<c.length&&c!==this)for(;e<c.length;e++)this.words[e]=c.words[e];return this.length=Math.max(this.length,e),c!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function z(r,i,a){a.negative=i.negative^r.negative;var d=r.length+i.length|0;a.length=d,d=d-1|0;var c=r.words[0]|0,v=i.words[0]|0,o=c*v,e=o&67108863,l=o/67108864|0;a.words[0]=e;for(var b=1;b<d;b++){for(var _=l>>>26,C=l&67108863,q=Math.min(b,i.length-1),O=Math.max(0,b-r.length+1);O<=q;O++){var R=b-O|0;c=r.words[R]|0,v=i.words[O]|0,o=c*v+C,_+=o/67108864|0,C=o&67108863}a.words[b]=C|0,l=_|0}return l!==0?a.words[b]=l|0:a.length--,a._strip()}var $=function(i,a,d){var c=i.words,v=a.words,o=d.words,e=0,l,b,_,C=c[0]|0,q=C&8191,O=C>>>13,R=c[1]|0,P=R&8191,N=R>>>13,K=c[2]|0,kt=K&8191,Z=K>>>13,J=c[3]|0,qt=J&8191,tt=J>>>13,vt=c[4]|0,Nt=vt&8191,et=vt>>>13,pt=c[5]|0,Dt=pt&8191,j=pt>>>13,dt=c[6]|0,Pt=dt&8191,Q=dt>>>13,ct=c[7]|0,Ot=ct&8191,E=ct>>>13,w=c[8]|0,A=w&8191,T=w>>>13,F=c[9]|0,V=F&8191,U=F>>>13,X=v[0]|0,Tt=X&8191,G=X>>>13,rt=v[1]|0,Rt=rt&8191,it=rt>>>13,gt=v[2]|0,Ht=gt&8191,nt=gt>>>13,bt=v[3]|0,Zt=bt&8191,ft=bt>>>13,yt=v[4]|0,Wt=yt&8191,at=yt>>>13,wt=v[5]|0,Vt=wt&8191,ht=wt>>>13,Mt=v[6]|0,Yt=Mt&8191,st=Mt>>>13,xt=v[7]|0,Jt=xt&8191,ot=xt>>>13,_t=v[8]|0,Gt=_t&8191,ut=_t>>>13,St=v[9]|0,$t=St&8191,Ut=St>>>13;d.negative=i.negative^a.negative,d.length=19,l=Math.imul(q,Tt),b=Math.imul(q,G),b=b+Math.imul(O,Tt)|0,_=Math.imul(O,G);var jt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul(P,Tt),b=Math.imul(P,G),b=b+Math.imul(N,Tt)|0,_=Math.imul(N,G),l=l+Math.imul(q,Rt)|0,b=b+Math.imul(q,it)|0,b=b+Math.imul(O,Rt)|0,_=_+Math.imul(O,it)|0;var Qt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(kt,Tt),b=Math.imul(kt,G),b=b+Math.imul(Z,Tt)|0,_=Math.imul(Z,G),l=l+Math.imul(P,Rt)|0,b=b+Math.imul(P,it)|0,b=b+Math.imul(N,Rt)|0,_=_+Math.imul(N,it)|0,l=l+Math.imul(q,Ht)|0,b=b+Math.imul(q,nt)|0,b=b+Math.imul(O,Ht)|0,_=_+Math.imul(O,nt)|0;var te=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(qt,Tt),b=Math.imul(qt,G),b=b+Math.imul(tt,Tt)|0,_=Math.imul(tt,G),l=l+Math.imul(kt,Rt)|0,b=b+Math.imul(kt,it)|0,b=b+Math.imul(Z,Rt)|0,_=_+Math.imul(Z,it)|0,l=l+Math.imul(P,Ht)|0,b=b+Math.imul(P,nt)|0,b=b+Math.imul(N,Ht)|0,_=_+Math.imul(N,nt)|0,l=l+Math.imul(q,Zt)|0,b=b+Math.imul(q,ft)|0,b=b+Math.imul(O,Zt)|0,_=_+Math.imul(O,ft)|0;var ee=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(Nt,Tt),b=Math.imul(Nt,G),b=b+Math.imul(et,Tt)|0,_=Math.imul(et,G),l=l+Math.imul(qt,Rt)|0,b=b+Math.imul(qt,it)|0,b=b+Math.imul(tt,Rt)|0,_=_+Math.imul(tt,it)|0,l=l+Math.imul(kt,Ht)|0,b=b+Math.imul(kt,nt)|0,b=b+Math.imul(Z,Ht)|0,_=_+Math.imul(Z,nt)|0,l=l+Math.imul(P,Zt)|0,b=b+Math.imul(P,ft)|0,b=b+Math.imul(N,Zt)|0,_=_+Math.imul(N,ft)|0,l=l+Math.imul(q,Wt)|0,b=b+Math.imul(q,at)|0,b=b+Math.imul(O,Wt)|0,_=_+Math.imul(O,at)|0;var re=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(Dt,Tt),b=Math.imul(Dt,G),b=b+Math.imul(j,Tt)|0,_=Math.imul(j,G),l=l+Math.imul(Nt,Rt)|0,b=b+Math.imul(Nt,it)|0,b=b+Math.imul(et,Rt)|0,_=_+Math.imul(et,it)|0,l=l+Math.imul(qt,Ht)|0,b=b+Math.imul(qt,nt)|0,b=b+Math.imul(tt,Ht)|0,_=_+Math.imul(tt,nt)|0,l=l+Math.imul(kt,Zt)|0,b=b+Math.imul(kt,ft)|0,b=b+Math.imul(Z,Zt)|0,_=_+Math.imul(Z,ft)|0,l=l+Math.imul(P,Wt)|0,b=b+Math.imul(P,at)|0,b=b+Math.imul(N,Wt)|0,_=_+Math.imul(N,at)|0,l=l+Math.imul(q,Vt)|0,b=b+Math.imul(q,ht)|0,b=b+Math.imul(O,Vt)|0,_=_+Math.imul(O,ht)|0;var ie=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(Pt,Tt),b=Math.imul(Pt,G),b=b+Math.imul(Q,Tt)|0,_=Math.imul(Q,G),l=l+Math.imul(Dt,Rt)|0,b=b+Math.imul(Dt,it)|0,b=b+Math.imul(j,Rt)|0,_=_+Math.imul(j,it)|0,l=l+Math.imul(Nt,Ht)|0,b=b+Math.imul(Nt,nt)|0,b=b+Math.imul(et,Ht)|0,_=_+Math.imul(et,nt)|0,l=l+Math.imul(qt,Zt)|0,b=b+Math.imul(qt,ft)|0,b=b+Math.imul(tt,Zt)|0,_=_+Math.imul(tt,ft)|0,l=l+Math.imul(kt,Wt)|0,b=b+Math.imul(kt,at)|0,b=b+Math.imul(Z,Wt)|0,_=_+Math.imul(Z,at)|0,l=l+Math.imul(P,Vt)|0,b=b+Math.imul(P,ht)|0,b=b+Math.imul(N,Vt)|0,_=_+Math.imul(N,ht)|0,l=l+Math.imul(q,Yt)|0,b=b+Math.imul(q,st)|0,b=b+Math.imul(O,Yt)|0,_=_+Math.imul(O,st)|0;var ne=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(Ot,Tt),b=Math.imul(Ot,G),b=b+Math.imul(E,Tt)|0,_=Math.imul(E,G),l=l+Math.imul(Pt,Rt)|0,b=b+Math.imul(Pt,it)|0,b=b+Math.imul(Q,Rt)|0,_=_+Math.imul(Q,it)|0,l=l+Math.imul(Dt,Ht)|0,b=b+Math.imul(Dt,nt)|0,b=b+Math.imul(j,Ht)|0,_=_+Math.imul(j,nt)|0,l=l+Math.imul(Nt,Zt)|0,b=b+Math.imul(Nt,ft)|0,b=b+Math.imul(et,Zt)|0,_=_+Math.imul(et,ft)|0,l=l+Math.imul(qt,Wt)|0,b=b+Math.imul(qt,at)|0,b=b+Math.imul(tt,Wt)|0,_=_+Math.imul(tt,at)|0,l=l+Math.imul(kt,Vt)|0,b=b+Math.imul(kt,ht)|0,b=b+Math.imul(Z,Vt)|0,_=_+Math.imul(Z,ht)|0,l=l+Math.imul(P,Yt)|0,b=b+Math.imul(P,st)|0,b=b+Math.imul(N,Yt)|0,_=_+Math.imul(N,st)|0,l=l+Math.imul(q,Jt)|0,b=b+Math.imul(q,ot)|0,b=b+Math.imul(O,Jt)|0,_=_+Math.imul(O,ot)|0;var fe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(A,Tt),b=Math.imul(A,G),b=b+Math.imul(T,Tt)|0,_=Math.imul(T,G),l=l+Math.imul(Ot,Rt)|0,b=b+Math.imul(Ot,it)|0,b=b+Math.imul(E,Rt)|0,_=_+Math.imul(E,it)|0,l=l+Math.imul(Pt,Ht)|0,b=b+Math.imul(Pt,nt)|0,b=b+Math.imul(Q,Ht)|0,_=_+Math.imul(Q,nt)|0,l=l+Math.imul(Dt,Zt)|0,b=b+Math.imul(Dt,ft)|0,b=b+Math.imul(j,Zt)|0,_=_+Math.imul(j,ft)|0,l=l+Math.imul(Nt,Wt)|0,b=b+Math.imul(Nt,at)|0,b=b+Math.imul(et,Wt)|0,_=_+Math.imul(et,at)|0,l=l+Math.imul(qt,Vt)|0,b=b+Math.imul(qt,ht)|0,b=b+Math.imul(tt,Vt)|0,_=_+Math.imul(tt,ht)|0,l=l+Math.imul(kt,Yt)|0,b=b+Math.imul(kt,st)|0,b=b+Math.imul(Z,Yt)|0,_=_+Math.imul(Z,st)|0,l=l+Math.imul(P,Jt)|0,b=b+Math.imul(P,ot)|0,b=b+Math.imul(N,Jt)|0,_=_+Math.imul(N,ot)|0,l=l+Math.imul(q,Gt)|0,b=b+Math.imul(q,ut)|0,b=b+Math.imul(O,Gt)|0,_=_+Math.imul(O,ut)|0;var ae=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(V,Tt),b=Math.imul(V,G),b=b+Math.imul(U,Tt)|0,_=Math.imul(U,G),l=l+Math.imul(A,Rt)|0,b=b+Math.imul(A,it)|0,b=b+Math.imul(T,Rt)|0,_=_+Math.imul(T,it)|0,l=l+Math.imul(Ot,Ht)|0,b=b+Math.imul(Ot,nt)|0,b=b+Math.imul(E,Ht)|0,_=_+Math.imul(E,nt)|0,l=l+Math.imul(Pt,Zt)|0,b=b+Math.imul(Pt,ft)|0,b=b+Math.imul(Q,Zt)|0,_=_+Math.imul(Q,ft)|0,l=l+Math.imul(Dt,Wt)|0,b=b+Math.imul(Dt,at)|0,b=b+Math.imul(j,Wt)|0,_=_+Math.imul(j,at)|0,l=l+Math.imul(Nt,Vt)|0,b=b+Math.imul(Nt,ht)|0,b=b+Math.imul(et,Vt)|0,_=_+Math.imul(et,ht)|0,l=l+Math.imul(qt,Yt)|0,b=b+Math.imul(qt,st)|0,b=b+Math.imul(tt,Yt)|0,_=_+Math.imul(tt,st)|0,l=l+Math.imul(kt,Jt)|0,b=b+Math.imul(kt,ot)|0,b=b+Math.imul(Z,Jt)|0,_=_+Math.imul(Z,ot)|0,l=l+Math.imul(P,Gt)|0,b=b+Math.imul(P,ut)|0,b=b+Math.imul(N,Gt)|0,_=_+Math.imul(N,ut)|0,l=l+Math.imul(q,$t)|0,b=b+Math.imul(q,Ut)|0,b=b+Math.imul(O,$t)|0,_=_+Math.imul(O,Ut)|0;var he=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(he>>>26)|0,he&=67108863,l=Math.imul(V,Rt),b=Math.imul(V,it),b=b+Math.imul(U,Rt)|0,_=Math.imul(U,it),l=l+Math.imul(A,Ht)|0,b=b+Math.imul(A,nt)|0,b=b+Math.imul(T,Ht)|0,_=_+Math.imul(T,nt)|0,l=l+Math.imul(Ot,Zt)|0,b=b+Math.imul(Ot,ft)|0,b=b+Math.imul(E,Zt)|0,_=_+Math.imul(E,ft)|0,l=l+Math.imul(Pt,Wt)|0,b=b+Math.imul(Pt,at)|0,b=b+Math.imul(Q,Wt)|0,_=_+Math.imul(Q,at)|0,l=l+Math.imul(Dt,Vt)|0,b=b+Math.imul(Dt,ht)|0,b=b+Math.imul(j,Vt)|0,_=_+Math.imul(j,ht)|0,l=l+Math.imul(Nt,Yt)|0,b=b+Math.imul(Nt,st)|0,b=b+Math.imul(et,Yt)|0,_=_+Math.imul(et,st)|0,l=l+Math.imul(qt,Jt)|0,b=b+Math.imul(qt,ot)|0,b=b+Math.imul(tt,Jt)|0,_=_+Math.imul(tt,ot)|0,l=l+Math.imul(kt,Gt)|0,b=b+Math.imul(kt,ut)|0,b=b+Math.imul(Z,Gt)|0,_=_+Math.imul(Z,ut)|0,l=l+Math.imul(P,$t)|0,b=b+Math.imul(P,Ut)|0,b=b+Math.imul(N,$t)|0,_=_+Math.imul(N,Ut)|0;var se=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(se>>>26)|0,se&=67108863,l=Math.imul(V,Ht),b=Math.imul(V,nt),b=b+Math.imul(U,Ht)|0,_=Math.imul(U,nt),l=l+Math.imul(A,Zt)|0,b=b+Math.imul(A,ft)|0,b=b+Math.imul(T,Zt)|0,_=_+Math.imul(T,ft)|0,l=l+Math.imul(Ot,Wt)|0,b=b+Math.imul(Ot,at)|0,b=b+Math.imul(E,Wt)|0,_=_+Math.imul(E,at)|0,l=l+Math.imul(Pt,Vt)|0,b=b+Math.imul(Pt,ht)|0,b=b+Math.imul(Q,Vt)|0,_=_+Math.imul(Q,ht)|0,l=l+Math.imul(Dt,Yt)|0,b=b+Math.imul(Dt,st)|0,b=b+Math.imul(j,Yt)|0,_=_+Math.imul(j,st)|0,l=l+Math.imul(Nt,Jt)|0,b=b+Math.imul(Nt,ot)|0,b=b+Math.imul(et,Jt)|0,_=_+Math.imul(et,ot)|0,l=l+Math.imul(qt,Gt)|0,b=b+Math.imul(qt,ut)|0,b=b+Math.imul(tt,Gt)|0,_=_+Math.imul(tt,ut)|0,l=l+Math.imul(kt,$t)|0,b=b+Math.imul(kt,Ut)|0,b=b+Math.imul(Z,$t)|0,_=_+Math.imul(Z,Ut)|0;var oe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(V,Zt),b=Math.imul(V,ft),b=b+Math.imul(U,Zt)|0,_=Math.imul(U,ft),l=l+Math.imul(A,Wt)|0,b=b+Math.imul(A,at)|0,b=b+Math.imul(T,Wt)|0,_=_+Math.imul(T,at)|0,l=l+Math.imul(Ot,Vt)|0,b=b+Math.imul(Ot,ht)|0,b=b+Math.imul(E,Vt)|0,_=_+Math.imul(E,ht)|0,l=l+Math.imul(Pt,Yt)|0,b=b+Math.imul(Pt,st)|0,b=b+Math.imul(Q,Yt)|0,_=_+Math.imul(Q,st)|0,l=l+Math.imul(Dt,Jt)|0,b=b+Math.imul(Dt,ot)|0,b=b+Math.imul(j,Jt)|0,_=_+Math.imul(j,ot)|0,l=l+Math.imul(Nt,Gt)|0,b=b+Math.imul(Nt,ut)|0,b=b+Math.imul(et,Gt)|0,_=_+Math.imul(et,ut)|0,l=l+Math.imul(qt,$t)|0,b=b+Math.imul(qt,Ut)|0,b=b+Math.imul(tt,$t)|0,_=_+Math.imul(tt,Ut)|0;var ue=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ue>>>26)|0,ue&=67108863,l=Math.imul(V,Wt),b=Math.imul(V,at),b=b+Math.imul(U,Wt)|0,_=Math.imul(U,at),l=l+Math.imul(A,Vt)|0,b=b+Math.imul(A,ht)|0,b=b+Math.imul(T,Vt)|0,_=_+Math.imul(T,ht)|0,l=l+Math.imul(Ot,Yt)|0,b=b+Math.imul(Ot,st)|0,b=b+Math.imul(E,Yt)|0,_=_+Math.imul(E,st)|0,l=l+Math.imul(Pt,Jt)|0,b=b+Math.imul(Pt,ot)|0,b=b+Math.imul(Q,Jt)|0,_=_+Math.imul(Q,ot)|0,l=l+Math.imul(Dt,Gt)|0,b=b+Math.imul(Dt,ut)|0,b=b+Math.imul(j,Gt)|0,_=_+Math.imul(j,ut)|0,l=l+Math.imul(Nt,$t)|0,b=b+Math.imul(Nt,Ut)|0,b=b+Math.imul(et,$t)|0,_=_+Math.imul(et,Ut)|0;var le=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(V,Vt),b=Math.imul(V,ht),b=b+Math.imul(U,Vt)|0,_=Math.imul(U,ht),l=l+Math.imul(A,Yt)|0,b=b+Math.imul(A,st)|0,b=b+Math.imul(T,Yt)|0,_=_+Math.imul(T,st)|0,l=l+Math.imul(Ot,Jt)|0,b=b+Math.imul(Ot,ot)|0,b=b+Math.imul(E,Jt)|0,_=_+Math.imul(E,ot)|0,l=l+Math.imul(Pt,Gt)|0,b=b+Math.imul(Pt,ut)|0,b=b+Math.imul(Q,Gt)|0,_=_+Math.imul(Q,ut)|0,l=l+Math.imul(Dt,$t)|0,b=b+Math.imul(Dt,Ut)|0,b=b+Math.imul(j,$t)|0,_=_+Math.imul(j,Ut)|0;var de=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(de>>>26)|0,de&=67108863,l=Math.imul(V,Yt),b=Math.imul(V,st),b=b+Math.imul(U,Yt)|0,_=Math.imul(U,st),l=l+Math.imul(A,Jt)|0,b=b+Math.imul(A,ot)|0,b=b+Math.imul(T,Jt)|0,_=_+Math.imul(T,ot)|0,l=l+Math.imul(Ot,Gt)|0,b=b+Math.imul(Ot,ut)|0,b=b+Math.imul(E,Gt)|0,_=_+Math.imul(E,ut)|0,l=l+Math.imul(Pt,$t)|0,b=b+Math.imul(Pt,Ut)|0,b=b+Math.imul(Q,$t)|0,_=_+Math.imul(Q,Ut)|0;var ce=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,l=Math.imul(V,Jt),b=Math.imul(V,ot),b=b+Math.imul(U,Jt)|0,_=Math.imul(U,ot),l=l+Math.imul(A,Gt)|0,b=b+Math.imul(A,ut)|0,b=b+Math.imul(T,Gt)|0,_=_+Math.imul(T,ut)|0,l=l+Math.imul(Ot,$t)|0,b=b+Math.imul(Ot,Ut)|0,b=b+Math.imul(E,$t)|0,_=_+Math.imul(E,Ut)|0;var ve=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,l=Math.imul(V,Gt),b=Math.imul(V,ut),b=b+Math.imul(U,Gt)|0,_=Math.imul(U,ut),l=l+Math.imul(A,$t)|0,b=b+Math.imul(A,Ut)|0,b=b+Math.imul(T,$t)|0,_=_+Math.imul(T,Ut)|0;var ea=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ea>>>26)|0,ea&=67108863,l=Math.imul(V,$t),b=Math.imul(V,Ut),b=b+Math.imul(U,$t)|0,_=Math.imul(U,Ut);var ra=(e+l|0)+((b&8191)<<13)|0;return e=(_+(b>>>13)|0)+(ra>>>26)|0,ra&=67108863,o[0]=jt,o[1]=Qt,o[2]=te,o[3]=ee,o[4]=re,o[5]=ie,o[6]=ne,o[7]=fe,o[8]=ae,o[9]=he,o[10]=se,o[11]=oe,o[12]=ue,o[13]=le,o[14]=de,o[15]=ce,o[16]=ve,o[17]=ea,o[18]=ra,e!==0&&(o[19]=e,d.length++),d};Math.imul||($=z);function lt(r,i,a){a.negative=i.negative^r.negative,a.length=r.length+i.length;for(var d=0,c=0,v=0;v<a.length-1;v++){var o=c;c=0;for(var e=d&67108863,l=Math.min(v,i.length-1),b=Math.max(0,v-r.length+1);b<=l;b++){var _=v-b,C=r.words[_]|0,q=i.words[b]|0,O=C*q,R=O&67108863;o=o+(O/67108864|0)|0,R=R+e|0,e=R&67108863,o=o+(R>>>26)|0,c+=o>>>26,o&=67108863}a.words[v]=e,d=o,o=c}return d!==0?a.words[v]=d:a.length--,a._strip()}function H(r,i,a){return lt(r,i,a)}f.prototype.mulTo=function(i,a){var d,c=this.length+i.length;return this.length===10&&i.length===10?d=$(this,i,a):c<63?d=z(this,i,a):c<1024?d=lt(this,i,a):d=H(this,i,a),d},f.prototype.mul=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),this.mulTo(i,a)},f.prototype.mulf=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),H(this,i,a)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var a=i<0;a&&(i=-i),s(typeof i=="number"),s(i<67108864);for(var d=0,c=0;c<this.length;c++){var v=(this.words[c]|0)*i,o=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=o>>>26,this.words[c]=o&67108863}return d!==0&&(this.words[c]=d,this.length++),this.length=i===0?1:this.length,a?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var a=W(i);if(a.length===0)return new f(1);for(var d=this,c=0;c<a.length&&a[c]===0;c++,d=d.sqr());if(++c<a.length)for(var v=d.sqr();c<a.length;c++,v=v.sqr())a[c]!==0&&(d=d.mul(v));return d},f.prototype.iushln=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=67108863>>>26-a<<26-a,v;if(a!==0){var o=0;for(v=0;v<this.length;v++){var e=this.words[v]&c,l=(this.words[v]|0)-e<<a;this.words[v]=l|o,o=e>>>26-a}o&&(this.words[v]=o,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},f.prototype.ishln=function(i){return s(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,a,d){s(typeof i=="number"&&i>=0);var c;a?c=(a-a%26)/26:c=0;var v=i%26,o=Math.min((i-v)/26,this.length),e=67108863^67108863>>>v<<v,l=d;if(c-=o,c=Math.max(0,c),l){for(var b=0;b<o;b++)l.words[b]=this.words[b];l.length=o}if(o!==0)if(this.length>o)for(this.length-=o,b=0;b<this.length;b++)this.words[b]=this.words[b+o];else this.words[0]=0,this.length=1;var _=0;for(b=this.length-1;b>=0&&(_!==0||b>=c);b--){var C=this.words[b]|0;this.words[b]=_<<26-v|C>>>v,_=C&e}return l&&_!==0&&(l.words[l.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,a,d){return s(this.negative===0),this.iushrn(i,a,d)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return!1;var v=this.words[d];return!!(v&c)},f.prototype.imaskn=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(a!==0&&d++,this.length=Math.min(d,this.length),a!==0){var c=67108863^67108863>>>a<<a;this.words[this.length-1]&=c}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return s(typeof i=="number"),s(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var a=0;a<this.length&&this.words[a]>=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},f.prototype.isubn=function(i){if(s(typeof i=="number"),s(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a<this.length&&this.words[a]<0;a++)this.words[a]+=67108864,this.words[a+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,a,d){var c=i.length+d,v;this._expand(c);var o,e=0;for(v=0;v<i.length;v++){o=(this.words[v+d]|0)+e;var l=(i.words[v]|0)*a;o-=l&67108863,e=(o>>26)-(l/67108864|0),this.words[v+d]=o&67108863}for(;v<this.length-d;v++)o=(this.words[v+d]|0)+e,e=o>>26,this.words[v+d]=o&67108863;if(e===0)return this._strip();for(s(e===-1),e=0,v=0;v<this.length;v++)o=-(this.words[v]|0)+e,e=o>>26,this.words[v]=o&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,a){var d=this.length-i.length,c=this.clone(),v=i,o=v.words[v.length-1]|0,e=this._countBits(o);d=26-e,d!==0&&(v=v.ushln(d),c.iushln(d),o=v.words[v.length-1]|0);var l=c.length-v.length,b;if(a!=="mod"){b=new f(null),b.length=l+1,b.words=new Array(b.length);for(var _=0;_<b.length;_++)b.words[_]=0}var C=c.clone()._ishlnsubmul(v,1,l);C.negative===0&&(c=C,b&&(b.words[l]=1));for(var q=l-1;q>=0;q--){var O=(c.words[v.length+q]|0)*67108864+(c.words[v.length+q-1]|0);for(O=Math.min(O/o|0,67108863),c._ishlnsubmul(v,O,q);c.negative!==0;)O--,c.negative=0,c._ishlnsubmul(v,1,q),c.isZero()||(c.negative^=1);b&&(b.words[q]=O)}return b&&b._strip(),c._strip(),a!=="div"&&d!==0&&c.iushrn(d),{div:b||null,mod:c}},f.prototype.divmod=function(i,a,d){if(s(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var c,v,o;return this.negative!==0&&i.negative===0?(o=this.neg().divmod(i,a),a!=="mod"&&(c=o.div.neg()),a!=="div"&&(v=o.mod.neg(),d&&v.negative!==0&&v.iadd(i)),{div:c,mod:v}):this.negative===0&&i.negative!==0?(o=this.divmod(i.neg(),a),a!=="mod"&&(c=o.div.neg()),{div:c,mod:o.mod}):this.negative&i.negative?(o=this.neg().divmod(i.neg(),a),a!=="div"&&(v=o.mod.neg(),d&&v.negative!==0&&v.isub(i)),{div:o.div,mod:v}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,a)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var d=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),v=i.andln(1),o=d.cmp(c);return o<0||v===1&&o===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},f.prototype.modrn=function(i){var a=i<0;a&&(i=-i),s(i<=67108863);for(var d=(1<<26)%i,c=0,v=this.length-1;v>=0;v--)c=(d*c+(this.words[v]|0))%i;return a?-c:c},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var a=i<0;a&&(i=-i),s(i<=67108863);for(var d=0,c=this.length-1;c>=0;c--){var v=(this.words[c]|0)+d*67108864;this.words[c]=v/i|0,d=v%i}return this._strip(),a?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){s(i.negative===0),s(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),o=new f(0),e=new f(1),l=0;a.isEven()&&d.isEven();)a.iushrn(1),d.iushrn(1),++l;for(var b=d.clone(),_=a.clone();!a.isZero();){for(var C=0,q=1;!(a.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(a.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(b),v.isub(_)),c.iushrn(1),v.iushrn(1);for(var O=0,R=1;!(d.words[0]&R)&&O<26;++O,R<<=1);if(O>0)for(d.iushrn(O);O-- >0;)(o.isOdd()||e.isOdd())&&(o.iadd(b),e.isub(_)),o.iushrn(1),e.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(o),v.isub(e)):(d.isub(a),o.isub(c),e.isub(v))}return{a:o,b:e,gcd:d.iushln(l)}},f.prototype._invmp=function(i){s(i.negative===0),s(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),o=d.clone();a.cmpn(1)>0&&d.cmpn(1)>0;){for(var e=0,l=1;!(a.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(a.iushrn(e);e-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var b=0,_=1;!(d.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(d.iushrn(b);b-- >0;)v.isOdd()&&v.iadd(o),v.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(v)):(d.isub(a),v.isub(c))}var C;return a.cmpn(1)===0?C=c:C=v,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),d=i.clone();a.negative=0,d.negative=0;for(var c=0;a.isEven()&&d.isEven();c++)a.iushrn(1),d.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=a.cmp(d);if(v<0){var o=a;a=d,d=o}else if(v===0||d.cmpn(1)===0)break;a.isub(d)}while(!0);return d.iushln(c)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){s(typeof i=="number");var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return this._expand(d+1),this.words[d]|=c,this;for(var v=c,o=d;v!==0&&o<this.length;o++){var e=this.words[o]|0;e+=v,v=e>>>26,e&=67108863,this.words[o]=e}return v!==0&&(this.words[o]=v,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var d;if(this.length>1)d=1;else{a&&(i=-i),s(i<=67108863,"Number is too big");var c=this.words[0]|0;d=c===i?0:c<i?-1:1}return this.negative!==0?-d|0:d},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var a=this.ucmp(i);return this.negative!==0?-a|0:a},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var a=0,d=this.length-1;d>=0;d--){var c=this.words[d]|0,v=i.words[d]|0;if(c!==v){c<v?a=-1:c>v&&(a=1);break}}return a},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new p(i)},f.prototype.toRed=function(i){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return s(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return s(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var At={k256:null,p224:null,p192:null,p25519:null};function Bt(r,i){this.name=r,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Bt.prototype.ireduce=function(i){var a=i,d;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),d=a.bitLength();while(d>this.n);var c=d<this.n?-1:a.ucmp(this.p);return c===0?(a.words[0]=0,a.length=1):c>0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Bt.prototype.split=function(i,a){i.iushrn(this.n,0,a)},Bt.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(Ct,Bt),Ct.prototype.split=function(i,a){for(var d=4194303,c=Math.min(i.length,9),v=0;v<c;v++)a.words[v]=i.words[v];if(a.length=c,i.length<=9){i.words[0]=0,i.length=1;return}var o=i.words[9];for(a.words[a.length++]=o&d,v=10;v<i.length;v++){var e=i.words[v]|0;i.words[v-10]=(e&d)<<4|o>>>22,o=e}o>>>=22,i.words[v-10]=o,o===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,d=0;d<i.length;d++){var c=i.words[d]|0;a+=c*977,i.words[d]=a&67108863,a=c*64+(a/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Et(){Bt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Et,Bt);function Y(){Bt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Y,Bt);function It(){Bt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(It,Bt),It.prototype.imulK=function(i){for(var a=0,d=0;d<i.length;d++){var c=(i.words[d]|0)*19+a,v=c&67108863;c>>>=26,i.words[d]=v,a=c}return a!==0&&(i.words[i.length++]=a),i},f._prime=function(i){if(At[i])return At[i];var a;if(i==="k256")a=new Ct;else if(i==="p224")a=new Et;else if(i==="p192")a=new Y;else if(i==="p25519")a=new It;else throw new Error("Unknown prime "+i);return At[i]=a,a};function p(r){if(typeof r=="string"){var i=f._prime(r);this.m=i.p,this.prime=i}else s(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}p.prototype._verify1=function(i){s(i.negative===0,"red works only with positives"),s(i.red,"red works only with red numbers")},p.prototype._verify2=function(i,a){s((i.negative|a.negative)===0,"red works only with positives"),s(i.red&&i.red===a.red,"red works only with red numbers")},p.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(M(i,i.umod(this.m)._forceRed(this)),i)},p.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},p.prototype.add=function(i,a){this._verify2(i,a);var d=i.add(a);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},p.prototype.iadd=function(i,a){this._verify2(i,a);var d=i.iadd(a);return d.cmp(this.m)>=0&&d.isub(this.m),d},p.prototype.sub=function(i,a){this._verify2(i,a);var d=i.sub(a);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},p.prototype.isub=function(i,a){this._verify2(i,a);var d=i.isub(a);return d.cmpn(0)<0&&d.iadd(this.m),d},p.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},p.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},p.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},p.prototype.isqr=function(i){return this.imul(i,i.clone())},p.prototype.sqr=function(i){return this.mul(i,i)},p.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(s(a%2===1),a===3){var d=this.m.add(new f(1)).iushrn(2);return this.pow(i,d)}for(var c=this.m.subn(1),v=0;!c.isZero()&&c.andln(1)===0;)v++,c.iushrn(1);s(!c.isZero());var o=new f(1).toRed(this),e=o.redNeg(),l=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new f(2*b*b).toRed(this);this.pow(b,l).cmp(e)!==0;)b.redIAdd(e);for(var _=this.pow(b,c),C=this.pow(i,c.addn(1).iushrn(1)),q=this.pow(i,c),O=v;q.cmp(o)!==0;){for(var R=q,P=0;R.cmp(o)!==0;P++)R=R.redSqr();s(P<O);var N=this.pow(_,new f(1).iushln(O-P-1));C=C.redMul(N),_=N.redSqr(),q=q.redMul(_),O=P}return C},p.prototype.invm=function(i){var a=i._invmp(this.m);return a.negative!==0?(a.negative=0,this.imod(a).redNeg()):this.imod(a)},p.prototype.pow=function(i,a){if(a.isZero())return new f(1).toRed(this);if(a.cmpn(1)===0)return i.clone();var d=4,c=new Array(1<<d);c[0]=new f(1).toRed(this),c[1]=i;for(var v=2;v<c.length;v++)c[v]=this.mul(c[v-1],i);var o=c[0],e=0,l=0,b=a.bitLength()%26;for(b===0&&(b=26),v=a.length-1;v>=0;v--){for(var _=a.words[v],C=b-1;C>=0;C--){var q=_>>C&1;if(o!==c[0]&&(o=this.sqr(o)),q===0&&e===0){l=0;continue}e<<=1,e|=q,l++,!(l!==d&&(v!==0||C!==0))&&(o=this.mul(o,c[e]),l=0,e=0)}b=26}return o},p.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},p.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},f.mont=function(i){return new t(i)};function t(r){p.call(this,r),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(t,p),t.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},t.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},t.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var d=i.imul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),o=v;return v.cmp(this.m)>=0?o=v.isub(this.m):v.cmpn(0)<0&&(o=v.iadd(this.m)),o._forceRed(this)},t.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new f(0)._forceRed(this);var d=i.mul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),o=v;return v.cmp(this.m)>=0?o=v.isub(this.m):v.cmpn(0)<0&&(o=v.iadd(this.m)),o._forceRed(this)},t.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(h,Ft)}(o0);var u0=o0.exports,bi=u0,iv=li,nv=zt.Buffer;function _s(h){var n=h.modulus.byteLength(),u;do u=new bi(iv(n));while(u.cmp(h.modulus)>=0||!u.umod(h.prime1)||!u.umod(h.prime2));return u}function fv(h){var n=_s(h),u=n.toRed(bi.mont(h.modulus)).redPow(new bi(h.publicExponent)).fromRed();return{blinder:u,unblinder:n.invm(h.modulus)}}function Ss(h,n){var u=fv(n),s=n.modulus.byteLength(),m=new bi(h).mul(u.blinder).umod(n.modulus),f=m.toRed(bi.mont(n.prime1)),g=m.toRed(bi.mont(n.prime2)),y=n.coefficient,S=n.prime1,B=n.prime2,M=f.redPow(n.exponent1).fromRed(),x=g.redPow(n.exponent2).fromRed(),I=M.isub(x).imul(y).umod(S).imul(B);return x.iadd(I).imul(u.unblinder).umod(n.modulus).toArrayLike(nv,"be",s)}Ss.getr=_s;var l0=Ss,d0={};const av={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}};var We={},c0={exports:{}};c0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(c0);var Ir=c0.exports,v0={};(function(h){var n=h;function u(f,g){if(Array.isArray(f))return f.slice();if(!f)return[];var y=[];if(typeof f!="string"){for(var S=0;S<f.length;S++)y[S]=f[S]|0;return y}if(g==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var S=0;S<f.length;S+=2)y.push(parseInt(f[S]+f[S+1],16))}else for(var S=0;S<f.length;S++){var B=f.charCodeAt(S),M=B>>8,x=B&255;M?y.push(M,x):y.push(x)}return y}n.toArray=u;function s(f){return f.length===1?"0"+f:f}n.zero2=s;function m(f){for(var g="",y=0;y<f.length;y++)g+=s(f[y].toString(16));return g}n.toHex=m,n.encode=function(g,y){return y==="hex"?m(g):g}})(v0),function(h){var n=h,u=Ir,s=Ye,m=v0;n.assert=s,n.toArray=m.toArray,n.zero2=m.zero2,n.toHex=m.toHex,n.encode=m.encode;function f(M,x,I){var k=new Array(Math.max(M.bitLength(),I)+1),D;for(D=0;D<k.length;D+=1)k[D]=0;var L=1<<x+1,W=M.clone();for(D=0;D<k.length;D++){var z,$=W.andln(L-1);W.isOdd()?($>(L>>1)-1?z=(L>>1)-$:z=$,W.isubn(z)):z=0,k[D]=z,W.iushrn(1)}return k}n.getNAF=f;function g(M,x){var I=[[],[]];M=M.clone(),x=x.clone();for(var k=0,D=0,L;M.cmpn(-k)>0||x.cmpn(-D)>0;){var W=M.andln(3)+k&3,z=x.andln(3)+D&3;W===3&&(W=-1),z===3&&(z=-1);var $;W&1?(L=M.andln(7)+k&7,(L===3||L===5)&&z===2?$=-W:$=W):$=0,I[0].push($);var lt;z&1?(L=x.andln(7)+D&7,(L===3||L===5)&&W===2?lt=-z:lt=z):lt=0,I[1].push(lt),2*k===$+1&&(k=1-k),2*D===lt+1&&(D=1-D),M.iushrn(1),x.iushrn(1)}return I}n.getJSF=g;function y(M,x,I){var k="_"+x;M.prototype[x]=function(){return this[k]!==void 0?this[k]:this[k]=I.call(this)}}n.cachedProperty=y;function S(M){return typeof M=="string"?n.toArray(M,"hex"):M}n.parseBytes=S;function B(M){return new u(M,"hex","le")}n.intFromLE=B}(We);var p0={},ii=Ir,rn=We,Jn=rn.getNAF,hv=rn.getJSF,Gn=rn.assert;function Lr(h,n){this.type=h,this.p=new ii(n.p,16),this.red=n.prime?ii.red(n.prime):ii.mont(this.p),this.zero=new ii(0).toRed(this.red),this.one=new ii(1).toRed(this.red),this.two=new ii(2).toRed(this.red),this.n=n.n&&new ii(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.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 u=this.n&&this.p.div(this.n);!u||u.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xn=Lr;Lr.prototype.point=function(){throw new Error("Not implemented")},Lr.prototype.validate=function(){throw new Error("Not implemented")},Lr.prototype._fixedNafMul=function(n,u){Gn(n.precomputed);var s=n._getDoubles(),m=Jn(u,1,this._bitLength),f=(1<<s.step+1)-(s.step%2===0?2:1);f/=3;var g=[],y,S;for(y=0;y<m.length;y+=s.step){S=0;for(var B=y+s.step-1;B>=y;B--)S=(S<<1)+m[B];g.push(S)}for(var M=this.jpoint(null,null,null),x=this.jpoint(null,null,null),I=f;I>0;I--){for(y=0;y<g.length;y++)S=g[y],S===I?x=x.mixedAdd(s.points[y]):S===-I&&(x=x.mixedAdd(s.points[y].neg()));M=M.add(x)}return M.toP()},Lr.prototype._wnafMul=function(n,u){var s=4,m=n._getNAFPoints(s);s=m.wnd;for(var f=m.points,g=Jn(u,s,this._bitLength),y=this.jpoint(null,null,null),S=g.length-1;S>=0;S--){for(var B=0;S>=0&&g[S]===0;S--)B++;if(S>=0&&B++,y=y.dblp(B),S<0)break;var M=g[S];Gn(M!==0),n.type==="affine"?M>0?y=y.mixedAdd(f[M-1>>1]):y=y.mixedAdd(f[-M-1>>1].neg()):M>0?y=y.add(f[M-1>>1]):y=y.add(f[-M-1>>1].neg())}return n.type==="affine"?y.toP():y},Lr.prototype._wnafMulAdd=function(n,u,s,m,f){var g=this._wnafT1,y=this._wnafT2,S=this._wnafT3,B=0,M,x,I;for(M=0;M<m;M++){I=u[M];var k=I._getNAFPoints(n);g[M]=k.wnd,y[M]=k.points}for(M=m-1;M>=1;M-=2){var D=M-1,L=M;if(g[D]!==1||g[L]!==1){S[D]=Jn(s[D],g[D],this._bitLength),S[L]=Jn(s[L],g[L],this._bitLength),B=Math.max(S[D].length,B),B=Math.max(S[L].length,B);continue}var W=[u[D],null,null,u[L]];u[D].y.cmp(u[L].y)===0?(W[1]=u[D].add(u[L]),W[2]=u[D].toJ().mixedAdd(u[L].neg())):u[D].y.cmp(u[L].y.redNeg())===0?(W[1]=u[D].toJ().mixedAdd(u[L]),W[2]=u[D].add(u[L].neg())):(W[1]=u[D].toJ().mixedAdd(u[L]),W[2]=u[D].toJ().mixedAdd(u[L].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],$=hv(s[D],s[L]);for(B=Math.max($[0].length,B),S[D]=new Array(B),S[L]=new Array(B),x=0;x<B;x++){var lt=$[0][x]|0,H=$[1][x]|0;S[D][x]=z[(lt+1)*3+(H+1)],S[L][x]=0,y[D]=W}}var At=this.jpoint(null,null,null),Bt=this._wnafT4;for(M=B;M>=0;M--){for(var Ct=0;M>=0;){var Et=!0;for(x=0;x<m;x++)Bt[x]=S[x][M]|0,Bt[x]!==0&&(Et=!1);if(!Et)break;Ct++,M--}if(M>=0&&Ct++,At=At.dblp(Ct),M<0)break;for(x=0;x<m;x++){var Y=Bt[x];Y!==0&&(Y>0?I=y[x][Y-1>>1]:Y<0&&(I=y[x][-Y-1>>1].neg()),I.type==="affine"?At=At.mixedAdd(I):At=At.add(I))}}for(M=0;M<m;M++)y[M]=null;return f?At:At.toP()};function je(h,n){this.curve=h,this.type=n,this.precomputed=null}Lr.BasePoint=je,je.prototype.eq=function(){throw new Error("Not implemented")},je.prototype.validate=function(){return this.curve.validate(this)},Lr.prototype.decodePoint=function(n,u){n=rn.toArray(n,u);var s=this.p.byteLength();if((n[0]===4||n[0]===6||n[0]===7)&&n.length-1===2*s){n[0]===6?Gn(n[n.length-1]%2===0):n[0]===7&&Gn(n[n.length-1]%2===1);var m=this.point(n.slice(1,1+s),n.slice(1+s,1+2*s));return m}else if((n[0]===2||n[0]===3)&&n.length-1===s)return this.pointFromX(n.slice(1,1+s),n[0]===3);throw new Error("Unknown point format")},je.prototype.encodeCompressed=function(n){return this.encode(n,!0)},je.prototype._encode=function(n){var u=this.curve.p.byteLength(),s=this.getX().toArray("be",u);return n?[this.getY().isEven()?2:3].concat(s):[4].concat(s,this.getY().toArray("be",u))},je.prototype.encode=function(n,u){return rn.encode(this._encode(u),n)},je.prototype.precompute=function(n){if(this.precomputed)return this;var u={doubles:null,naf:null,beta:null};return u.naf=this._getNAFPoints(8),u.doubles=this._getDoubles(4,n),u.beta=this._getBeta(),this.precomputed=u,this},je.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var u=this.precomputed.doubles;return u?u.points.length>=Math.ceil((n.bitLength()+1)/u.step):!1},je.prototype._getDoubles=function(n,u){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var s=[this],m=this,f=0;f<u;f+=n){for(var g=0;g<n;g++)m=m.dbl();s.push(m)}return{step:n,points:s}},je.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var u=[this],s=(1<<n)-1,m=s===1?null:this.dbl(),f=1;f<s;f++)u[f]=u[f-1].add(m);return{wnd:n,points:u}},je.prototype._getBeta=function(){return null},je.prototype.dblp=function(n){for(var u=this,s=0;s<n;s++)u=u.dbl();return u};var sv=We,be=Ir,m0=Kt,yi=Xn,ov=sv.assert;function Qe(h){yi.call(this,"short",h),this.a=new be(h.a,16).toRed(this.red),this.b=new be(h.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(h),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}m0(Qe,yi);var uv=Qe;Qe.prototype._getEndomorphism=function(n){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var u,s;if(n.beta)u=new be(n.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);u=m[0].cmp(m[1])<0?m[0]:m[1],u=u.toRed(this.red)}if(n.lambda)s=new be(n.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(u))===0?s=f[0]:(s=f[1],ov(this.g.mul(s).x.cmp(this.g.x.redMul(u))===0))}var g;return n.basis?g=n.basis.map(function(y){return{a:new be(y.a,16),b:new be(y.b,16)}}):g=this._getEndoBasis(s),{beta:u,lambda:s,basis:g}}},Qe.prototype._getEndoRoots=function(n){var u=n===this.p?this.red:be.mont(n),s=new be(2).toRed(u).redInvm(),m=s.redNeg(),f=new be(3).toRed(u).redNeg().redSqrt().redMul(s),g=m.redAdd(f).fromRed(),y=m.redSub(f).fromRed();return[g,y]},Qe.prototype._getEndoBasis=function(n){for(var u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),s=n,m=this.n.clone(),f=new be(1),g=new be(0),y=new be(0),S=new be(1),B,M,x,I,k,D,L,W=0,z,$;s.cmpn(0)!==0;){var lt=m.div(s);z=m.sub(lt.mul(s)),$=y.sub(lt.mul(f));var H=S.sub(lt.mul(g));if(!x&&z.cmp(u)<0)B=L.neg(),M=f,x=z.neg(),I=$;else if(x&&++W===2)break;L=z,m=s,s=z,y=f,f=$,S=g,g=H}k=z.neg(),D=$;var At=x.sqr().add(I.sqr()),Bt=k.sqr().add(D.sqr());return Bt.cmp(At)>=0&&(k=B,D=M),x.negative&&(x=x.neg(),I=I.neg()),k.negative&&(k=k.neg(),D=D.neg()),[{a:x,b:I},{a:k,b:D}]},Qe.prototype._endoSplit=function(n){var u=this.endo.basis,s=u[0],m=u[1],f=m.b.mul(n).divRound(this.n),g=s.b.neg().mul(n).divRound(this.n),y=f.mul(s.a),S=g.mul(m.a),B=f.mul(s.b),M=g.mul(m.b),x=n.sub(y).sub(S),I=B.add(M).neg();return{k1:x,k2:I}},Qe.prototype.pointFromX=function(n,u){n=new be(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),m=s.redSqrt();if(m.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var f=m.fromRed().isOdd();return(u&&!f||!u&&f)&&(m=m.redNeg()),this.point(n,m)},Qe.prototype.validate=function(n){if(n.inf)return!0;var u=n.x,s=n.y,m=this.a.redMul(u),f=u.redSqr().redMul(u).redIAdd(m).redIAdd(this.b);return s.redSqr().redISub(f).cmpn(0)===0},Qe.prototype._endoWnafMulAdd=function(n,u,s){for(var m=this._endoWnafT1,f=this._endoWnafT2,g=0;g<n.length;g++){var y=this._endoSplit(u[g]),S=n[g],B=S._getBeta();y.k1.negative&&(y.k1.ineg(),S=S.neg(!0)),y.k2.negative&&(y.k2.ineg(),B=B.neg(!0)),m[g*2]=S,m[g*2+1]=B,f[g*2]=y.k1,f[g*2+1]=y.k2}for(var M=this._wnafMulAdd(1,m,f,g*2,s),x=0;x<g*2;x++)m[x]=null,f[x]=null;return M};function Ae(h,n,u,s){yi.BasePoint.call(this,h,"affine"),n===null&&u===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new be(n,16),this.y=new be(u,16),s&&(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)}m0(Ae,yi.BasePoint),Qe.prototype.point=function(n,u,s){return new Ae(this,n,u,s)},Qe.prototype.pointFromJSON=function(n,u){return Ae.fromJSON(this,n,u)},Ae.prototype._getBeta=function(){if(this.curve.endo){var n=this.precomputed;if(n&&n.beta)return n.beta;var u=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(n){var s=this.curve,m=function(f){return s.point(f.x.redMul(s.endo.beta),f.y)};n.beta=u,u.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(m)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(m)}}}return u}},Ae.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]},Ae.fromJSON=function(n,u,s){typeof u=="string"&&(u=JSON.parse(u));var m=n.point(u[0],u[1],s);if(!u[2])return m;function f(y){return n.point(y[0],y[1],s)}var g=u[2];return m.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[m].concat(g.doubles.points.map(f))},naf:g.naf&&{wnd:g.naf.wnd,points:[m].concat(g.naf.points.map(f))}},m},Ae.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)+">"},Ae.prototype.isInfinity=function(){return this.inf},Ae.prototype.add=function(n){if(this.inf)return n;if(n.inf)return this;if(this.eq(n))return this.dbl();if(this.neg().eq(n))return this.curve.point(null,null);if(this.x.cmp(n.x)===0)return this.curve.point(null,null);var u=this.y.redSub(n.y);u.cmpn(0)!==0&&(u=u.redMul(this.x.redSub(n.x).redInvm()));var s=u.redSqr().redISub(this.x).redISub(n.x),m=u.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,m)},Ae.prototype.dbl=function(){if(this.inf)return this;var n=this.y.redAdd(this.y);if(n.cmpn(0)===0)return this.curve.point(null,null);var u=this.curve.a,s=this.x.redSqr(),m=n.redInvm(),f=s.redAdd(s).redIAdd(s).redIAdd(u).redMul(m),g=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)},Ae.prototype.getX=function(){return this.x.fromRed()},Ae.prototype.getY=function(){return this.y.fromRed()},Ae.prototype.mul=function(n){return n=new be(n,16),this.isInfinity()?this:this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)},Ae.prototype.mulAdd=function(n,u,s){var m=[this,u],f=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(m,f):this.curve._wnafMulAdd(1,m,f,2)},Ae.prototype.jmulAdd=function(n,u,s){var m=[this,u],f=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(m,f,!0):this.curve._wnafMulAdd(1,m,f,2,!0)},Ae.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||this.x.cmp(n.x)===0&&this.y.cmp(n.y)===0)},Ae.prototype.neg=function(n){if(this.inf)return this;var u=this.curve.point(this.x,this.y.redNeg());if(n&&this.precomputed){var s=this.precomputed,m=function(f){return f.neg()};u.precomputed={naf:s.naf&&{wnd:s.naf.wnd,points:s.naf.points.map(m)},doubles:s.doubles&&{step:s.doubles.step,points:s.doubles.points.map(m)}}}return u},Ae.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var n=this.curve.jpoint(this.x,this.y,this.curve.one);return n};function Ie(h,n,u,s){yi.BasePoint.call(this,h,"jacobian"),n===null&&u===null&&s===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new be(0)):(this.x=new be(n,16),this.y=new be(u,16),this.z=new be(s,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}m0(Ie,yi.BasePoint),Qe.prototype.jpoint=function(n,u,s){return new Ie(this,n,u,s)},Ie.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),u=n.redSqr(),s=this.x.redMul(u),m=this.y.redMul(u).redMul(n);return this.curve.point(s,m)},Ie.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ie.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var u=n.z.redSqr(),s=this.z.redSqr(),m=this.x.redMul(u),f=n.x.redMul(s),g=this.y.redMul(u.redMul(n.z)),y=n.y.redMul(s.redMul(this.z)),S=m.redSub(f),B=g.redSub(y);if(S.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var M=S.redSqr(),x=M.redMul(S),I=m.redMul(M),k=B.redSqr().redIAdd(x).redISub(I).redISub(I),D=B.redMul(I.redISub(k)).redISub(g.redMul(x)),L=this.z.redMul(n.z).redMul(S);return this.curve.jpoint(k,D,L)},Ie.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var u=this.z.redSqr(),s=this.x,m=n.x.redMul(u),f=this.y,g=n.y.redMul(u).redMul(this.z),y=s.redSub(m),S=f.redSub(g);if(y.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var B=y.redSqr(),M=B.redMul(y),x=s.redMul(B),I=S.redSqr().redIAdd(M).redISub(x).redISub(x),k=S.redMul(x.redISub(I)).redISub(f.redMul(M)),D=this.z.redMul(y);return this.curve.jpoint(I,k,D)},Ie.prototype.dblp=function(n){if(n===0)return this;if(this.isInfinity())return this;if(!n)return this.dbl();var u;if(this.curve.zeroA||this.curve.threeA){var s=this;for(u=0;u<n;u++)s=s.dbl();return s}var m=this.curve.a,f=this.curve.tinv,g=this.x,y=this.y,S=this.z,B=S.redSqr().redSqr(),M=y.redAdd(y);for(u=0;u<n;u++){var x=g.redSqr(),I=M.redSqr(),k=I.redSqr(),D=x.redAdd(x).redIAdd(x).redIAdd(m.redMul(B)),L=g.redMul(I),W=D.redSqr().redISub(L.redAdd(L)),z=L.redISub(W),$=D.redMul(z);$=$.redIAdd($).redISub(k);var lt=M.redMul(S);u+1<n&&(B=B.redMul(k)),g=W,S=lt,M=$}return this.curve.jpoint(g,M.redMul(f),S)},Ie.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ie.prototype._zeroDbl=function(){var n,u,s;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m),B=S.redSqr().redISub(y).redISub(y),M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),n=B,u=S.redMul(y.redISub(B)).redISub(M),s=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),I=this.y.redSqr(),k=I.redSqr(),D=this.x.redAdd(I).redSqr().redISub(x).redISub(k);D=D.redIAdd(D);var L=x.redAdd(x).redIAdd(x),W=L.redSqr(),z=k.redIAdd(k);z=z.redIAdd(z),z=z.redIAdd(z),n=W.redISub(D).redISub(D),u=L.redMul(D.redISub(n)).redISub(z),s=this.y.redMul(this.z),s=s.redIAdd(s)}return this.curve.jpoint(n,u,s)},Ie.prototype._threeDbl=function(){var n,u,s;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),B=S.redSqr().redISub(y).redISub(y);n=B;var M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),u=S.redMul(y.redISub(B)).redISub(M),s=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),I=this.y.redSqr(),k=this.x.redMul(I),D=this.x.redSub(x).redMul(this.x.redAdd(x));D=D.redAdd(D).redIAdd(D);var L=k.redIAdd(k);L=L.redIAdd(L);var W=L.redAdd(L);n=D.redSqr().redISub(W),s=this.y.redAdd(this.z).redSqr().redISub(I).redISub(x);var z=I.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),u=D.redMul(L.redISub(n)).redISub(z)}return this.curve.jpoint(n,u,s)},Ie.prototype._dbl=function(){var n=this.curve.a,u=this.x,s=this.y,m=this.z,f=m.redSqr().redSqr(),g=u.redSqr(),y=s.redSqr(),S=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),B=u.redAdd(u);B=B.redIAdd(B);var M=B.redMul(y),x=S.redSqr().redISub(M.redAdd(M)),I=M.redISub(x),k=y.redSqr();k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=S.redMul(I).redISub(k),L=s.redAdd(s).redMul(m);return this.curve.jpoint(x,D,L)},Ie.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var n=this.x.redSqr(),u=this.y.redSqr(),s=this.z.redSqr(),m=u.redSqr(),f=n.redAdd(n).redIAdd(n),g=f.redSqr(),y=this.x.redAdd(u).redSqr().redISub(n).redISub(m);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var S=y.redSqr(),B=m.redIAdd(m);B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var M=f.redIAdd(y).redSqr().redISub(g).redISub(S).redISub(B),x=u.redMul(M);x=x.redIAdd(x),x=x.redIAdd(x);var I=this.x.redMul(S).redISub(x);I=I.redIAdd(I),I=I.redIAdd(I);var k=this.y.redMul(M.redMul(B.redISub(M)).redISub(y.redMul(S)));k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=this.z.redAdd(y).redSqr().redISub(s).redISub(S);return this.curve.jpoint(I,k,D)},Ie.prototype.mul=function(n,u){return n=new be(n,u),this.curve._wnafMul(this,n)},Ie.prototype.eq=function(n){if(n.type==="affine")return this.eq(n.toJ());if(this===n)return!0;var u=this.z.redSqr(),s=n.z.redSqr();if(this.x.redMul(s).redISub(n.x.redMul(u)).cmpn(0)!==0)return!1;var m=u.redMul(this.z),f=s.redMul(n.z);return this.y.redMul(f).redISub(n.y.redMul(m)).cmpn(0)===0},Ie.prototype.eqXToP=function(n){var u=this.z.redSqr(),s=n.toRed(this.curve.red).redMul(u);if(this.x.cmp(s)===0)return!0;for(var m=n.clone(),f=this.curve.redN.redMul(u);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(f),this.x.cmp(s)===0)return!0}},Ie.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)+">"},Ie.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var wi=Ir,As=Kt,jn=Xn,lv=We;function Mi(h){jn.call(this,"mont",h),this.a=new wi(h.a,16).toRed(this.red),this.b=new wi(h.b,16).toRed(this.red),this.i4=new wi(4).toRed(this.red).redInvm(),this.two=new wi(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}As(Mi,jn);var dv=Mi;Mi.prototype.validate=function(n){var u=n.normalize().x,s=u.redSqr(),m=s.redMul(u).redAdd(s.redMul(this.a)).redAdd(u),f=m.redSqrt();return f.redSqr().cmp(m)===0};function Be(h,n,u){jn.BasePoint.call(this,h,"projective"),n===null&&u===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new wi(n,16),this.z=new wi(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}As(Be,jn.BasePoint),Mi.prototype.decodePoint=function(n,u){return this.point(lv.toArray(n,u),1)},Mi.prototype.point=function(n,u){return new Be(this,n,u)},Mi.prototype.pointFromJSON=function(n){return Be.fromJSON(this,n)},Be.prototype.precompute=function(){},Be.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Be.fromJSON=function(n,u){return new Be(n,u[0],u[1]||n.one)},Be.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)+">"},Be.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Be.prototype.dbl=function(){var n=this.x.redAdd(this.z),u=n.redSqr(),s=this.x.redSub(this.z),m=s.redSqr(),f=u.redSub(m),g=u.redMul(m),y=f.redMul(m.redAdd(this.curve.a24.redMul(f)));return this.curve.point(g,y)},Be.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.diffAdd=function(n,u){var s=this.x.redAdd(this.z),m=this.x.redSub(this.z),f=n.x.redAdd(n.z),g=n.x.redSub(n.z),y=g.redMul(s),S=f.redMul(m),B=u.z.redMul(y.redAdd(S).redSqr()),M=u.x.redMul(y.redISub(S).redSqr());return this.curve.point(B,M)},Be.prototype.mul=function(n){for(var u=n.clone(),s=this,m=this.curve.point(null,null),f=this,g=[];u.cmpn(0)!==0;u.iushrn(1))g.push(u.andln(1));for(var y=g.length-1;y>=0;y--)g[y]===0?(s=s.diffAdd(m,f),m=m.dbl()):(m=s.diffAdd(m,f),s=s.dbl());return m},Be.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.eq=function(n){return this.getX().cmp(n.getX())===0},Be.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Be.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var cv=We,Rr=Ir,Bs=Kt,Qn=Xn,vv=cv.assert;function vr(h){this.twisted=(h.a|0)!==1,this.mOneA=this.twisted&&(h.a|0)===-1,this.extended=this.mOneA,Qn.call(this,"edwards",h),this.a=new Rr(h.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Rr(h.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Rr(h.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),vv(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(h.c|0)===1}Bs(vr,Qn);var pv=vr;vr.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)},vr.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)},vr.prototype.jpoint=function(n,u,s,m){return this.point(n,u,s,m)},vr.prototype.pointFromX=function(n,u){n=new Rr(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr(),m=this.c2.redSub(this.a.redMul(s)),f=this.one.redSub(this.c2.redMul(this.d).redMul(s)),g=m.redMul(f.redInvm()),y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var S=y.fromRed().isOdd();return(u&&!S||!u&&S)&&(y=y.redNeg()),this.point(n,y)},vr.prototype.pointFromY=function(n,u){n=new Rr(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr(),m=s.redSub(this.c2),f=s.redMul(this.d).redMul(this.c2).redSub(this.a),g=m.redMul(f.redInvm());if(g.cmp(this.zero)===0){if(u)throw new Error("invalid point");return this.point(this.zero,n)}var y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==u&&(y=y.redNeg()),this.point(y,n)},vr.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var u=n.x.redSqr(),s=n.y.redSqr(),m=u.redMul(this.a).redAdd(s),f=this.c2.redMul(this.one.redAdd(this.d.redMul(u).redMul(s)));return m.cmp(f)===0};function pe(h,n,u,s,m){Qn.BasePoint.call(this,h,"projective"),n===null&&u===null&&s===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 Rr(n,16),this.y=new Rr(u,16),this.z=s?new Rr(s,16):this.curve.one,this.t=m&&new Rr(m,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()))))}Bs(pe,Qn.BasePoint),vr.prototype.pointFromJSON=function(n){return pe.fromJSON(this,n)},vr.prototype.point=function(n,u,s,m){return new pe(this,n,u,s,m)},pe.fromJSON=function(n,u){return new pe(n,u[0],u[1],u[2])},pe.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)+">"},pe.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},pe.prototype._extDbl=function(){var n=this.x.redSqr(),u=this.y.redSqr(),s=this.z.redSqr();s=s.redIAdd(s);var m=this.curve._mulA(n),f=this.x.redAdd(this.y).redSqr().redISub(n).redISub(u),g=m.redAdd(u),y=g.redSub(s),S=m.redSub(u),B=f.redMul(y),M=g.redMul(S),x=f.redMul(S),I=y.redMul(g);return this.curve.point(B,M,I,x)},pe.prototype._projDbl=function(){var n=this.x.redAdd(this.y).redSqr(),u=this.x.redSqr(),s=this.y.redSqr(),m,f,g,y,S,B;if(this.curve.twisted){y=this.curve._mulA(u);var M=y.redAdd(s);this.zOne?(m=n.redSub(u).redSub(s).redMul(M.redSub(this.curve.two)),f=M.redMul(y.redSub(s)),g=M.redSqr().redSub(M).redSub(M)):(S=this.z.redSqr(),B=M.redSub(S).redISub(S),m=n.redSub(u).redISub(s).redMul(B),f=M.redMul(y.redSub(s)),g=M.redMul(B))}else y=u.redAdd(s),S=this.curve._mulC(this.z).redSqr(),B=y.redSub(S).redSub(S),m=this.curve._mulC(n.redISub(y)).redMul(B),f=this.curve._mulC(y).redMul(u.redISub(s)),g=y.redMul(B);return this.curve.point(m,f,g)},pe.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},pe.prototype._extAdd=function(n){var u=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),s=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),m=this.t.redMul(this.curve.dd).redMul(n.t),f=this.z.redMul(n.z.redAdd(n.z)),g=s.redSub(u),y=f.redSub(m),S=f.redAdd(m),B=s.redAdd(u),M=g.redMul(y),x=S.redMul(B),I=g.redMul(B),k=y.redMul(S);return this.curve.point(M,x,k,I)},pe.prototype._projAdd=function(n){var u=this.z.redMul(n.z),s=u.redSqr(),m=this.x.redMul(n.x),f=this.y.redMul(n.y),g=this.curve.d.redMul(m).redMul(f),y=s.redSub(g),S=s.redAdd(g),B=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(m).redISub(f),M=u.redMul(y).redMul(B),x,I;return this.curve.twisted?(x=u.redMul(S).redMul(f.redSub(this.curve._mulA(m))),I=y.redMul(S)):(x=u.redMul(S).redMul(f.redSub(m)),I=this.curve._mulC(y).redMul(S)),this.curve.point(M,x,I)},pe.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)},pe.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)},pe.prototype.mulAdd=function(n,u,s){return this.curve._wnafMulAdd(1,[this,u],[n,s],2,!1)},pe.prototype.jmulAdd=function(n,u,s){return this.curve._wnafMulAdd(1,[this,u],[n,s],2,!0)},pe.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this},pe.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},pe.prototype.getX=function(){return this.normalize(),this.x.fromRed()},pe.prototype.getY=function(){return this.normalize(),this.y.fromRed()},pe.prototype.eq=function(n){return this===n||this.getX().cmp(n.getX())===0&&this.getY().cmp(n.getY())===0},pe.prototype.eqXToP=function(n){var u=n.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(u)===0)return!0;for(var s=n.clone(),m=this.curve.redN.redMul(this.z);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(m),this.x.cmp(u)===0)return!0}},pe.prototype.toP=pe.prototype.normalize,pe.prototype.mixedAdd=pe.prototype.add,function(h){var n=h;n.base=Xn,n.short=uv,n.mont=dv,n.edwards=pv}(p0);var tf={},ef={},Xt={},mv=Ye,gv=Kt;Xt.inherits=gv;function bv(h,n){return(h.charCodeAt(n)&64512)!==55296||n<0||n+1>=h.length?!1:(h.charCodeAt(n+1)&64512)===56320}function yv(h,n){if(Array.isArray(h))return h.slice();if(!h)return[];var u=[];if(typeof h=="string")if(n){if(n==="hex")for(h=h.replace(/[^a-z0-9]+/ig,""),h.length%2!==0&&(h="0"+h),m=0;m<h.length;m+=2)u.push(parseInt(h[m]+h[m+1],16))}else for(var s=0,m=0;m<h.length;m++){var f=h.charCodeAt(m);f<128?u[s++]=f:f<2048?(u[s++]=f>>6|192,u[s++]=f&63|128):bv(h,m)?(f=65536+((f&1023)<<10)+(h.charCodeAt(++m)&1023),u[s++]=f>>18|240,u[s++]=f>>12&63|128,u[s++]=f>>6&63|128,u[s++]=f&63|128):(u[s++]=f>>12|224,u[s++]=f>>6&63|128,u[s++]=f&63|128)}else for(m=0;m<h.length;m++)u[m]=h[m]|0;return u}Xt.toArray=yv;function wv(h){for(var n="",u=0;u<h.length;u++)n+=ks(h[u].toString(16));return n}Xt.toHex=wv;function Es(h){var n=h>>>24|h>>>8&65280|h<<8&16711680|(h&255)<<24;return n>>>0}Xt.htonl=Es;function Mv(h,n){for(var u="",s=0;s<h.length;s++){var m=h[s];n==="little"&&(m=Es(m)),u+=Is(m.toString(16))}return u}Xt.toHex32=Mv;function ks(h){return h.length===1?"0"+h:h}Xt.zero2=ks;function Is(h){return h.length===7?"0"+h:h.length===6?"00"+h:h.length===5?"000"+h:h.length===4?"0000"+h:h.length===3?"00000"+h:h.length===2?"000000"+h:h.length===1?"0000000"+h:h}Xt.zero8=Is;function xv(h,n,u,s){var m=u-n;mv(m%4===0);for(var f=new Array(m/4),g=0,y=n;g<f.length;g++,y+=4){var S;s==="big"?S=h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3]:S=h[y+3]<<24|h[y+2]<<16|h[y+1]<<8|h[y],f[g]=S>>>0}return f}Xt.join32=xv;function _v(h,n){for(var u=new Array(h.length*4),s=0,m=0;s<h.length;s++,m+=4){var f=h[s];n==="big"?(u[m]=f>>>24,u[m+1]=f>>>16&255,u[m+2]=f>>>8&255,u[m+3]=f&255):(u[m+3]=f>>>24,u[m+2]=f>>>16&255,u[m+1]=f>>>8&255,u[m]=f&255)}return u}Xt.split32=_v;function Sv(h,n){return h>>>n|h<<32-n}Xt.rotr32=Sv;function Av(h,n){return h<<n|h>>>32-n}Xt.rotl32=Av;function Bv(h,n){return h+n>>>0}Xt.sum32=Bv;function Ev(h,n,u){return h+n+u>>>0}Xt.sum32_3=Ev;function kv(h,n,u,s){return h+n+u+s>>>0}Xt.sum32_4=kv;function Iv(h,n,u,s,m){return h+n+u+s+m>>>0}Xt.sum32_5=Iv;function Rv(h,n,u,s){var m=h[n],f=h[n+1],g=s+f>>>0,y=(g<s?1:0)+u+m;h[n]=y>>>0,h[n+1]=g}Xt.sum64=Rv;function Tv(h,n,u,s){var m=n+s>>>0,f=(m<n?1:0)+h+u;return f>>>0}Xt.sum64_hi=Tv;function Cv(h,n,u,s){var m=n+s;return m>>>0}Xt.sum64_lo=Cv;function Fv(h,n,u,s,m,f,g,y){var S=0,B=n;B=B+s>>>0,S+=B<n?1:0,B=B+f>>>0,S+=B<f?1:0,B=B+y>>>0,S+=B<y?1:0;var M=h+u+m+g+S;return M>>>0}Xt.sum64_4_hi=Fv;function qv(h,n,u,s,m,f,g,y){var S=n+s+f+y;return S>>>0}Xt.sum64_4_lo=qv;function Pv(h,n,u,s,m,f,g,y,S,B){var M=0,x=n;x=x+s>>>0,M+=x<n?1:0,x=x+f>>>0,M+=x<f?1:0,x=x+y>>>0,M+=x<y?1:0,x=x+B>>>0,M+=x<B?1:0;var I=h+u+m+g+S+M;return I>>>0}Xt.sum64_5_hi=Pv;function Dv(h,n,u,s,m,f,g,y,S,B){var M=n+s+f+y+B;return M>>>0}Xt.sum64_5_lo=Dv;function Nv(h,n,u){var s=n<<32-u|h>>>u;return s>>>0}Xt.rotr64_hi=Nv;function $v(h,n,u){var s=h<<32-u|n>>>u;return s>>>0}Xt.rotr64_lo=$v;function Uv(h,n,u){return h>>>u}Xt.shr64_hi=Uv;function Lv(h,n,u){var s=h<<32-u|n>>>u;return s>>>0}Xt.shr64_lo=Lv;var xi={},Rs=Xt,Ov=Ye;function rf(){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}xi.BlockHash=rf,rf.prototype.update=function(n,u){if(n=Rs.toArray(n,u),this.pending?this.pending=this.pending.concat(n):this.pending=n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var s=n.length%this._delta8;this.pending=n.slice(n.length-s,n.length),this.pending.length===0&&(this.pending=null),n=Rs.join32(n,0,n.length-s,this.endian);for(var m=0;m<n.length;m+=this._delta32)this._update(n,m,m+this._delta32)}return this},rf.prototype.digest=function(n){return this.update(this._pad()),Ov(this.pending===null),this._digest(n)},rf.prototype._pad=function(){var n=this.pendingTotal,u=this._delta8,s=u-(n+this.padLength)%u,m=new Array(s+this.padLength);m[0]=128;for(var f=1;f<s;f++)m[f]=0;if(n<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)m[f++]=0;m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=n>>>24&255,m[f++]=n>>>16&255,m[f++]=n>>>8&255,m[f++]=n&255}else for(m[f++]=n&255,m[f++]=n>>>8&255,m[f++]=n>>>16&255,m[f++]=n>>>24&255,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,g=8;g<this.padLength;g++)m[f++]=0;return m};var _i={},pr={},zv=Xt,mr=zv.rotr32;function Kv(h,n,u,s){if(h===0)return Ts(n,u,s);if(h===1||h===3)return Fs(n,u,s);if(h===2)return Cs(n,u,s)}pr.ft_1=Kv;function Ts(h,n,u){return h&n^~h&u}pr.ch32=Ts;function Cs(h,n,u){return h&n^h&u^n&u}pr.maj32=Cs;function Fs(h,n,u){return h^n^u}pr.p32=Fs;function Hv(h){return mr(h,2)^mr(h,13)^mr(h,22)}pr.s0_256=Hv;function Zv(h){return mr(h,6)^mr(h,11)^mr(h,25)}pr.s1_256=Zv;function Wv(h){return mr(h,7)^mr(h,18)^h>>>3}pr.g0_256=Wv;function Vv(h){return mr(h,17)^mr(h,19)^h>>>10}pr.g1_256=Vv;var Si=Xt,Yv=xi,Jv=pr,g0=Si.rotl32,nn=Si.sum32,Gv=Si.sum32_5,Xv=Jv.ft_1,qs=Yv.BlockHash,jv=[1518500249,1859775393,2400959708,3395469782];function gr(){if(!(this instanceof gr))return new gr;qs.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Si.inherits(gr,qs);var Qv=gr;gr.blockSize=512,gr.outSize=160,gr.hmacStrength=80,gr.padLength=64,gr.prototype._update=function(n,u){for(var s=this.W,m=0;m<16;m++)s[m]=n[u+m];for(;m<s.length;m++)s[m]=g0(s[m-3]^s[m-8]^s[m-14]^s[m-16],1);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4];for(m=0;m<s.length;m++){var M=~~(m/20),x=Gv(g0(f,5),Xv(M,g,y,S),B,s[m],jv[M]);B=S,S=y,y=g0(g,30),g=f,f=x}this.h[0]=nn(this.h[0],f),this.h[1]=nn(this.h[1],g),this.h[2]=nn(this.h[2],y),this.h[3]=nn(this.h[3],S),this.h[4]=nn(this.h[4],B)},gr.prototype._digest=function(n){return n==="hex"?Si.toHex32(this.h,"big"):Si.split32(this.h,"big")};var Ai=Xt,tp=xi,Bi=pr,ep=Ye,ir=Ai.sum32,rp=Ai.sum32_4,ip=Ai.sum32_5,np=Bi.ch32,fp=Bi.maj32,ap=Bi.s0_256,hp=Bi.s1_256,sp=Bi.g0_256,op=Bi.g1_256,Ps=tp.BlockHash,up=[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 br(){if(!(this instanceof br))return new br;Ps.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=up,this.W=new Array(64)}Ai.inherits(br,Ps);var Ds=br;br.blockSize=512,br.outSize=256,br.hmacStrength=192,br.padLength=64,br.prototype._update=function(n,u){for(var s=this.W,m=0;m<16;m++)s[m]=n[u+m];for(;m<s.length;m++)s[m]=rp(op(s[m-2]),s[m-7],sp(s[m-15]),s[m-16]);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4],M=this.h[5],x=this.h[6],I=this.h[7];for(ep(this.k.length===s.length),m=0;m<s.length;m++){var k=ip(I,hp(B),np(B,M,x),this.k[m],s[m]),D=ir(ap(f),fp(f,g,y));I=x,x=M,M=B,B=ir(S,k),S=y,y=g,g=f,f=ir(k,D)}this.h[0]=ir(this.h[0],f),this.h[1]=ir(this.h[1],g),this.h[2]=ir(this.h[2],y),this.h[3]=ir(this.h[3],S),this.h[4]=ir(this.h[4],B),this.h[5]=ir(this.h[5],M),this.h[6]=ir(this.h[6],x),this.h[7]=ir(this.h[7],I)},br.prototype._digest=function(n){return n==="hex"?Ai.toHex32(this.h,"big"):Ai.split32(this.h,"big")};var b0=Xt,Ns=Ds;function Tr(){if(!(this instanceof Tr))return new Tr;Ns.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}b0.inherits(Tr,Ns);var lp=Tr;Tr.blockSize=512,Tr.outSize=224,Tr.hmacStrength=192,Tr.padLength=64,Tr.prototype._digest=function(n){return n==="hex"?b0.toHex32(this.h.slice(0,7),"big"):b0.split32(this.h.slice(0,7),"big")};var Le=Xt,dp=xi,cp=Ye,yr=Le.rotr64_hi,wr=Le.rotr64_lo,$s=Le.shr64_hi,Us=Le.shr64_lo,Or=Le.sum64,y0=Le.sum64_hi,w0=Le.sum64_lo,vp=Le.sum64_4_hi,pp=Le.sum64_4_lo,mp=Le.sum64_5_hi,gp=Le.sum64_5_lo,Ls=dp.BlockHash,bp=[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 nr(){if(!(this instanceof nr))return new nr;Ls.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=bp,this.W=new Array(160)}Le.inherits(nr,Ls);var Os=nr;nr.blockSize=1024,nr.outSize=512,nr.hmacStrength=192,nr.padLength=128,nr.prototype._prepareBlock=function(n,u){for(var s=this.W,m=0;m<32;m++)s[m]=n[u+m];for(;m<s.length;m+=2){var f=Ip(s[m-4],s[m-3]),g=Rp(s[m-4],s[m-3]),y=s[m-14],S=s[m-13],B=Ep(s[m-30],s[m-29]),M=kp(s[m-30],s[m-29]),x=s[m-32],I=s[m-31];s[m]=vp(f,g,y,S,B,M,x,I),s[m+1]=pp(f,g,y,S,B,M,x,I)}},nr.prototype._update=function(n,u){this._prepareBlock(n,u);var s=this.W,m=this.h[0],f=this.h[1],g=this.h[2],y=this.h[3],S=this.h[4],B=this.h[5],M=this.h[6],x=this.h[7],I=this.h[8],k=this.h[9],D=this.h[10],L=this.h[11],W=this.h[12],z=this.h[13],$=this.h[14],lt=this.h[15];cp(this.k.length===s.length);for(var H=0;H<s.length;H+=2){var At=$,Bt=lt,Ct=Ap(I,k),Et=Bp(I,k),Y=yp(I,k,D,L,W),It=wp(I,k,D,L,W,z),p=this.k[H],t=this.k[H+1],r=s[H],i=s[H+1],a=mp(At,Bt,Ct,Et,Y,It,p,t,r,i),d=gp(At,Bt,Ct,Et,Y,It,p,t,r,i);At=_p(m,f),Bt=Sp(m,f),Ct=Mp(m,f,g,y,S),Et=xp(m,f,g,y,S,B);var c=y0(At,Bt,Ct,Et),v=w0(At,Bt,Ct,Et);$=W,lt=z,W=D,z=L,D=I,L=k,I=y0(M,x,a,d),k=w0(x,x,a,d),M=S,x=B,S=g,B=y,g=m,y=f,m=y0(a,d,c,v),f=w0(a,d,c,v)}Or(this.h,0,m,f),Or(this.h,2,g,y),Or(this.h,4,S,B),Or(this.h,6,M,x),Or(this.h,8,I,k),Or(this.h,10,D,L),Or(this.h,12,W,z),Or(this.h,14,$,lt)},nr.prototype._digest=function(n){return n==="hex"?Le.toHex32(this.h,"big"):Le.split32(this.h,"big")};function yp(h,n,u,s,m){var f=h&u^~h&m;return f<0&&(f+=4294967296),f}function wp(h,n,u,s,m,f){var g=n&s^~n&f;return g<0&&(g+=4294967296),g}function Mp(h,n,u,s,m){var f=h&u^h&m^u&m;return f<0&&(f+=4294967296),f}function xp(h,n,u,s,m,f){var g=n&s^n&f^s&f;return g<0&&(g+=4294967296),g}function _p(h,n){var u=yr(h,n,28),s=yr(n,h,2),m=yr(n,h,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Sp(h,n){var u=wr(h,n,28),s=wr(n,h,2),m=wr(n,h,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Ap(h,n){var u=yr(h,n,14),s=yr(h,n,18),m=yr(n,h,9),f=u^s^m;return f<0&&(f+=4294967296),f}function Bp(h,n){var u=wr(h,n,14),s=wr(h,n,18),m=wr(n,h,9),f=u^s^m;return f<0&&(f+=4294967296),f}function Ep(h,n){var u=yr(h,n,1),s=yr(h,n,8),m=$s(h,n,7),f=u^s^m;return f<0&&(f+=4294967296),f}function kp(h,n){var u=wr(h,n,1),s=wr(h,n,8),m=Us(h,n,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Ip(h,n){var u=yr(h,n,19),s=yr(n,h,29),m=$s(h,n,6),f=u^s^m;return f<0&&(f+=4294967296),f}function Rp(h,n){var u=wr(h,n,19),s=wr(n,h,29),m=Us(h,n,6),f=u^s^m;return f<0&&(f+=4294967296),f}var M0=Xt,zs=Os;function Cr(){if(!(this instanceof Cr))return new Cr;zs.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}M0.inherits(Cr,zs);var Tp=Cr;Cr.blockSize=1024,Cr.outSize=384,Cr.hmacStrength=192,Cr.padLength=128,Cr.prototype._digest=function(n){return n==="hex"?M0.toHex32(this.h.slice(0,12),"big"):M0.split32(this.h.slice(0,12),"big")},_i.sha1=Qv,_i.sha224=lp,_i.sha256=Ds,_i.sha384=Tp,_i.sha512=Os;var Ks={},ni=Xt,Cp=xi,nf=ni.rotl32,Hs=ni.sum32,fn=ni.sum32_3,Zs=ni.sum32_4,Ws=Cp.BlockHash;function Mr(){if(!(this instanceof Mr))return new Mr;Ws.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}ni.inherits(Mr,Ws),Ks.ripemd160=Mr,Mr.blockSize=512,Mr.outSize=160,Mr.hmacStrength=192,Mr.padLength=64,Mr.prototype._update=function(n,u){for(var s=this.h[0],m=this.h[1],f=this.h[2],g=this.h[3],y=this.h[4],S=s,B=m,M=f,x=g,I=y,k=0;k<80;k++){var D=Hs(nf(Zs(s,Vs(k,m,f,g),n[Pp[k]+u],Fp(k)),Np[k]),y);s=y,y=g,g=nf(f,10),f=m,m=D,D=Hs(nf(Zs(S,Vs(79-k,B,M,x),n[Dp[k]+u],qp(k)),$p[k]),I),S=I,I=x,x=nf(M,10),M=B,B=D}D=fn(this.h[1],f,x),this.h[1]=fn(this.h[2],g,I),this.h[2]=fn(this.h[3],y,S),this.h[3]=fn(this.h[4],s,B),this.h[4]=fn(this.h[0],m,M),this.h[0]=D},Mr.prototype._digest=function(n){return n==="hex"?ni.toHex32(this.h,"little"):ni.split32(this.h,"little")};function Vs(h,n,u,s){return h<=15?n^u^s:h<=31?n&u|~n&s:h<=47?(n|~u)^s:h<=63?n&s|u&~s:n^(u|~s)}function Fp(h){return h<=15?0:h<=31?1518500249:h<=47?1859775393:h<=63?2400959708:2840853838}function qp(h){return h<=15?1352829926:h<=31?1548603684:h<=47?1836072691:h<=63?2053994217:0}var Pp=[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],Dp=[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],Np=[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],$p=[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],Up=Xt,Lp=Ye;function Ei(h,n,u){if(!(this instanceof Ei))return new Ei(h,n,u);this.Hash=h,this.blockSize=h.blockSize/8,this.outSize=h.outSize/8,this.inner=null,this.outer=null,this._init(Up.toArray(n,u))}var Op=Ei;Ei.prototype._init=function(n){n.length>this.blockSize&&(n=new this.Hash().update(n).digest()),Lp(n.length<=this.blockSize);for(var u=n.length;u<this.blockSize;u++)n.push(0);for(u=0;u<n.length;u++)n[u]^=54;for(this.inner=new this.Hash().update(n),u=0;u<n.length;u++)n[u]^=106;this.outer=new this.Hash().update(n)},Ei.prototype.update=function(n,u){return this.inner.update(n,u),this},Ei.prototype.digest=function(n){return this.outer.update(this.inner.digest()),this.outer.digest(n)},function(h){var n=h;n.utils=Xt,n.common=xi,n.sha=_i,n.ripemd=Ks,n.hmac=Op,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160}(ef);var x0,Ys;function zp(){return Ys||(Ys=1,x0={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"]]}}),x0}(function(h){var n=h,u=ef,s=p0,m=We,f=m.assert;function g(B){B.type==="short"?this.curve=new s.short(B):B.type==="edwards"?this.curve=new s.edwards(B):this.curve=new s.mont(B),this.g=this.curve.g,this.n=this.curve.n,this.hash=B.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}n.PresetCurve=g;function y(B,M){Object.defineProperty(n,B,{configurable:!0,enumerable:!0,get:function(){var x=new g(M);return Object.defineProperty(n,B,{configurable:!0,enumerable:!0,value:x}),x}})}y("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:u.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),y("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:u.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),y("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:u.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),y("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:u.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"]}),y("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:u.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"]}),y("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["9"]}),y("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:u.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=zp()}catch(B){S=void 0}y("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:u.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(tf);var Kp=ef,fi=v0,Js=Ye;function zr(h){if(!(this instanceof zr))return new zr(h);this.hash=h.hash,this.predResist=!!h.predResist,this.outLen=this.hash.outSize,this.minEntropy=h.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=fi.toArray(h.entropy,h.entropyEnc||"hex"),u=fi.toArray(h.nonce,h.nonceEnc||"hex"),s=fi.toArray(h.pers,h.persEnc||"hex");Js(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,u,s)}var Hp=zr;zr.prototype._init=function(n,u,s){var m=n.concat(u).concat(s);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(m),this._reseed=1,this.reseedInterval=281474976710656},zr.prototype._hmac=function(){return new Kp.hmac(this.hash,this.K)},zr.prototype._update=function(n){var u=this._hmac().update(this.V).update([0]);n&&(u=u.update(n)),this.K=u.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())},zr.prototype.reseed=function(n,u,s,m){typeof u!="string"&&(m=s,s=u,u=null),n=fi.toArray(n,u),s=fi.toArray(s,m),Js(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(s||[])),this._reseed=1},zr.prototype.generate=function(n,u,s,m){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof u!="string"&&(m=s,s=u,u=null),s&&(s=fi.toArray(s,m||"hex"),this._update(s));for(var f=[];f.length<n;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,n);return this._update(s),this._reseed++,fi.encode(g,u)};var Zp=Ir,Wp=We,_0=Wp.assert;function Pe(h,n){this.ec=h,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}var Vp=Pe;Pe.fromPublic=function(n,u,s){return u instanceof Pe?u:new Pe(n,{pub:u,pubEnc:s})},Pe.fromPrivate=function(n,u,s){return u instanceof Pe?u:new Pe(n,{priv:u,privEnc:s})},Pe.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.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"}},Pe.prototype.getPublic=function(n,u){return typeof n=="string"&&(u=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),u?this.pub.encode(u,n):this.pub},Pe.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},Pe.prototype._importPrivate=function(n,u){this.priv=new Zp(n,u||16),this.priv=this.priv.umod(this.ec.curve.n)},Pe.prototype._importPublic=function(n,u){if(n.x||n.y){this.ec.curve.type==="mont"?_0(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&_0(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,u)},Pe.prototype.derive=function(n){return n.validate()||_0(n.validate(),"public point not validated"),n.mul(this.priv).getX()},Pe.prototype.sign=function(n,u,s){return this.ec.sign(n,this,u,s)},Pe.prototype.verify=function(n,u,s){return this.ec.verify(n,u,this,void 0,s)},Pe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ff=Ir,S0=We,Yp=S0.assert;function af(h,n){if(h instanceof af)return h;this._importDER(h,n)||(Yp(h.r&&h.s,"Signature without r or s"),this.r=new ff(h.r,16),this.s=new ff(h.s,16),h.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=h.recoveryParam)}var Jp=af;function Gp(){this.place=0}function A0(h,n){var u=h[n.place++];if(!(u&128))return u;var s=u&15;if(s===0||s>4||h[n.place]===0)return!1;for(var m=0,f=0,g=n.place;f<s;f++,g++)m<<=8,m|=h[g],m>>>=0;return m<=127?!1:(n.place=g,m)}function Gs(h){for(var n=0,u=h.length-1;!h[n]&&!(h[n+1]&128)&&n<u;)n++;return n===0?h:h.slice(n)}af.prototype._importDER=function(n,u){n=S0.toArray(n,u);var s=new Gp;if(n[s.place++]!==48)return!1;var m=A0(n,s);if(m===!1||m+s.place!==n.length||n[s.place++]!==2)return!1;var f=A0(n,s);if(f===!1||n[s.place]&128)return!1;var g=n.slice(s.place,f+s.place);if(s.place+=f,n[s.place++]!==2)return!1;var y=A0(n,s);if(y===!1||n.length!==y+s.place||n[s.place]&128)return!1;var S=n.slice(s.place,y+s.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(S[0]===0)if(S[1]&128)S=S.slice(1);else return!1;return this.r=new ff(g),this.s=new ff(S),this.recoveryParam=null,!0};function B0(h,n){if(n<128){h.push(n);return}var u=1+(Math.log(n)/Math.LN2>>>3);for(h.push(u|128);--u;)h.push(n>>>(u<<3)&255);h.push(n)}af.prototype.toDER=function(n){var u=this.r.toArray(),s=this.s.toArray();for(u[0]&128&&(u=[0].concat(u)),s[0]&128&&(s=[0].concat(s)),u=Gs(u),s=Gs(s);!s[0]&&!(s[1]&128);)s=s.slice(1);var m=[2];B0(m,u.length),m=m.concat(u),m.push(2),B0(m,s.length);var f=m.concat(s),g=[48];return B0(g,f.length),g=g.concat(f),S0.encode(g,n)};var E0,Xs;function Xp(){if(Xs)return E0;Xs=1;var h=Ir,n=Hp,u=We,s=tf,m=Gf(),f=u.assert,g=Vp,y=Jp;function S(B){if(!(this instanceof S))return new S(B);typeof B=="string"&&(f(Object.prototype.hasOwnProperty.call(s,B),"Unknown curve "+B),B=s[B]),B instanceof s.PresetCurve&&(B={curve:B}),this.curve=B.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=B.curve.g,this.g.precompute(B.curve.n.bitLength()+1),this.hash=B.hash||B.curve.hash}return E0=S,S.prototype.keyPair=function(M){return new g(this,M)},S.prototype.keyFromPrivate=function(M,x){return g.fromPrivate(this,M,x)},S.prototype.keyFromPublic=function(M,x){return g.fromPublic(this,M,x)},S.prototype.genKeyPair=function(M){M||(M={});for(var x=new n({hash:this.hash,pers:M.pers,persEnc:M.persEnc||"utf8",entropy:M.entropy||m(this.hash.hmacStrength),entropyEnc:M.entropy&&M.entropyEnc||"utf8",nonce:this.n.toArray()}),I=this.n.byteLength(),k=this.n.sub(new h(2));;){var D=new h(x.generate(I));if(!(D.cmp(k)>0))return D.iaddn(1),this.keyFromPrivate(D)}},S.prototype._truncateToN=function(M,x,I){var k;if(h.isBN(M)||typeof M=="number")M=new h(M,16),k=M.byteLength();else if(typeof M=="object")k=M.length,M=new h(M,16);else{var D=M.toString();k=D.length+1>>>1,M=new h(D,16)}typeof I!="number"&&(I=k*8);var L=I-this.n.bitLength();return L>0&&(M=M.ushrn(L)),!x&&M.cmp(this.n)>=0?M.sub(this.n):M},S.prototype.sign=function(M,x,I,k){if(typeof I=="object"&&(k=I,I=null),k||(k={}),typeof M!="string"&&typeof M!="number"&&!h.isBN(M)){f(typeof M=="object"&&M&&typeof M.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),f(M.length>>>0===M.length);for(var D=0;D<M.length;D++)f((M[D]&255)===M[D])}x=this.keyFromPrivate(x,I),M=this._truncateToN(M,!1,k.msgBitLength),f(!M.isNeg(),"Can not sign a negative message");var L=this.n.byteLength(),W=x.getPrivate().toArray("be",L),z=M.toArray("be",L);f(new h(z).eq(M),"Can not sign message");for(var $=new n({hash:this.hash,entropy:W,nonce:z,pers:k.pers,persEnc:k.persEnc||"utf8"}),lt=this.n.sub(new h(1)),H=0;;H++){var At=k.k?k.k(H):new h($.generate(this.n.byteLength()));if(At=this._truncateToN(At,!0),!(At.cmpn(1)<=0||At.cmp(lt)>=0)){var Bt=this.g.mul(At);if(!Bt.isInfinity()){var Ct=Bt.getX(),Et=Ct.umod(this.n);if(Et.cmpn(0)!==0){var Y=At.invm(this.n).mul(Et.mul(x.getPrivate()).iadd(M));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var It=(Bt.getY().isOdd()?1:0)|(Ct.cmp(Et)!==0?2:0);return k.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),It^=1),new y({r:Et,s:Y,recoveryParam:It})}}}}}},S.prototype.verify=function(M,x,I,k,D){D||(D={}),M=this._truncateToN(M,!1,D.msgBitLength),I=this.keyFromPublic(I,k),x=new y(x,"hex");var L=x.r,W=x.s;if(L.cmpn(1)<0||L.cmp(this.n)>=0||W.cmpn(1)<0||W.cmp(this.n)>=0)return!1;var z=W.invm(this.n),$=z.mul(M).umod(this.n),lt=z.mul(L).umod(this.n),H;return this.curve._maxwellTrick?(H=this.g.jmulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.eqXToP(L)):(H=this.g.mulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.getX().umod(this.n).cmp(L)===0)},S.prototype.recoverPubKey=function(B,M,x,I){f((3&x)===x,"The recovery param is more than two bits"),M=new y(M,I);var k=this.n,D=new h(B),L=M.r,W=M.s,z=x&1,$=x>>1;if(L.cmp(this.curve.p.umod(this.curve.n))>=0&&$)throw new Error("Unable to find sencond key candinate");$?L=this.curve.pointFromX(L.add(this.curve.n),z):L=this.curve.pointFromX(L,z);var lt=M.r.invm(k),H=k.sub(D).mul(lt).umod(k),At=W.mul(lt).umod(k);return this.g.mulAdd(H,L,At)},S.prototype.getKeyRecoveryParam=function(B,M,x,I){if(M=new y(M,I),M.recoveryParam!==null)return M.recoveryParam;for(var k=0;k<4;k++){var D;try{D=this.recoverPubKey(B,M,k)}catch(L){continue}if(D.eq(x))return k}throw new Error("Unable to find valid recovery factor")},E0}var an=We,js=an.assert,Qs=an.parseBytes,ki=an.cachedProperty;function Ee(h,n){this.eddsa=h,this._secret=Qs(n.secret),h.isPoint(n.pub)?this._pub=n.pub:this._pubBytes=Qs(n.pub)}Ee.fromPublic=function(n,u){return u instanceof Ee?u:new Ee(n,{pub:u})},Ee.fromSecret=function(n,u){return u instanceof Ee?u:new Ee(n,{secret:u})},Ee.prototype.secret=function(){return this._secret},ki(Ee,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),ki(Ee,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),ki(Ee,"privBytes",function(){var n=this.eddsa,u=this.hash(),s=n.encodingLength-1,m=u.slice(0,n.encodingLength);return m[0]&=248,m[s]&=127,m[s]|=64,m}),ki(Ee,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),ki(Ee,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),ki(Ee,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Ee.prototype.sign=function(n){return js(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)},Ee.prototype.verify=function(n,u){return this.eddsa.verify(n,u,this)},Ee.prototype.getSecret=function(n){return js(this._secret,"KeyPair is public only"),an.encode(this.secret(),n)},Ee.prototype.getPublic=function(n){return an.encode(this.pubBytes(),n)};var jp=Ee,Qp=Ir,hf=We,to=hf.assert,sf=hf.cachedProperty,tm=hf.parseBytes;function ai(h,n){this.eddsa=h,typeof n!="object"&&(n=tm(n)),Array.isArray(n)&&(to(n.length===h.encodingLength*2,"Signature has invalid size"),n={R:n.slice(0,h.encodingLength),S:n.slice(h.encodingLength)}),to(n.R&&n.S,"Signature without R or S"),h.isPoint(n.R)&&(this._R=n.R),n.S instanceof Qp&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}sf(ai,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),sf(ai,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),sf(ai,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),sf(ai,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),ai.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},ai.prototype.toHex=function(){return hf.encode(this.toBytes(),"hex").toUpperCase()};var em=ai,rm=ef,im=tf,Ii=We,nm=Ii.assert,eo=Ii.parseBytes,ro=jp,io=em;function Oe(h){if(nm(h==="ed25519","only tested with ed25519 so far"),!(this instanceof Oe))return new Oe(h);h=im[h].curve,this.curve=h,this.g=h.g,this.g.precompute(h.n.bitLength()+1),this.pointClass=h.point().constructor,this.encodingLength=Math.ceil(h.n.bitLength()/8),this.hash=rm.sha512}var fm=Oe;Oe.prototype.sign=function(n,u){n=eo(n);var s=this.keyFromSecret(u),m=this.hashInt(s.messagePrefix(),n),f=this.g.mul(m),g=this.encodePoint(f),y=this.hashInt(g,s.pubBytes(),n).mul(s.priv()),S=m.add(y).umod(this.curve.n);return this.makeSignature({R:f,S,Rencoded:g})},Oe.prototype.verify=function(n,u,s){if(n=eo(n),u=this.makeSignature(u),u.S().gte(u.eddsa.curve.n)||u.S().isNeg())return!1;var m=this.keyFromPublic(s),f=this.hashInt(u.Rencoded(),m.pubBytes(),n),g=this.g.mul(u.S()),y=u.R().add(m.pub().mul(f));return y.eq(g)},Oe.prototype.hashInt=function(){for(var n=this.hash(),u=0;u<arguments.length;u++)n.update(arguments[u]);return Ii.intFromLE(n.digest()).umod(this.curve.n)},Oe.prototype.keyFromPublic=function(n){return ro.fromPublic(this,n)},Oe.prototype.keyFromSecret=function(n){return ro.fromSecret(this,n)},Oe.prototype.makeSignature=function(n){return n instanceof io?n:new io(this,n)},Oe.prototype.encodePoint=function(n){var u=n.getY().toArray("le",this.encodingLength);return u[this.encodingLength-1]|=n.getX().isOdd()?128:0,u},Oe.prototype.decodePoint=function(n){n=Ii.parseBytes(n);var u=n.length-1,s=n.slice(0,u).concat(n[u]&-129),m=(n[u]&128)!==0,f=Ii.intFromLE(s);return this.curve.pointFromY(f,m)},Oe.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)},Oe.prototype.decodeInt=function(n){return Ii.intFromLE(n)},Oe.prototype.isPoint=function(n){return n instanceof this.pointClass};var no;function k0(){return no||(no=1,function(h){var n=h;n.version=av.version,n.utils=We,n.rand=Gf(),n.curve=p0,n.curves=tf,n.ec=Xp(),n.eddsa=fm}(d0)),d0}var fr={},I0={},R0={exports:{}};R0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(R0);var am=R0.exports,T0={},fo;function hm(){return fo||(fo=1,function(h){var n=sn(),u=Kt,s=h;s.define=function(g,y){return new m(g,y)};function m(f,g){this.name=f,this.body=g,this.decoders={},this.encoders={}}m.prototype._createNamed=function(g){var y;try{y=Ne.runInThisContext("(function "+this.name+`(entity) {
|
|
12
|
+
*/var lc=50;mt.TYPED_ARRAY_SUPPORT=Ti.TYPED_ARRAY_SUPPORT!==void 0?Ti.TYPED_ARRAY_SUPPORT:!0,Tn();function Tn(){return mt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ar(h,n){if(Tn()<n)throw new RangeError("Invalid typed array length");return mt.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=mt.prototype):(h===null&&(h=new mt(n)),h.length=n),h}function mt(h,n,u){if(!mt.TYPED_ARRAY_SUPPORT&&!(this instanceof mt))return new mt(h,n,u);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return Df(this,h)}return ch(this,h,n,u)}mt.poolSize=8192,mt._augment=function(h){return h.__proto__=mt.prototype,h};function ch(h,n,u,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer?vc(h,n,u,s):typeof n=="string"?cc(h,n,u):pc(h,n)}mt.from=function(h,n,u){return ch(null,h,n,u)},mt.TYPED_ARRAY_SUPPORT&&(mt.prototype.__proto__=Uint8Array.prototype,mt.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&mt[Symbol.species]);function vh(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function dc(h,n,u,s){return vh(n),n<=0?Ar(h,n):u!==void 0?typeof s=="string"?Ar(h,n).fill(u,s):Ar(h,n).fill(u):Ar(h,n)}mt.alloc=function(h,n,u){return dc(null,h,n,u)};function Df(h,n){if(vh(n),h=Ar(h,n<0?0:$f(n)|0),!mt.TYPED_ARRAY_SUPPORT)for(var u=0;u<n;++u)h[u]=0;return h}mt.allocUnsafe=function(h){return Df(null,h)},mt.allocUnsafeSlow=function(h){return Df(null,h)};function cc(h,n,u){if((typeof u!="string"||u==="")&&(u="utf8"),!mt.isEncoding(u))throw new TypeError('"encoding" must be a valid string encoding');var s=ph(n,u)|0;h=Ar(h,s);var m=h.write(n,u);return m!==s&&(h=h.slice(0,m)),h}function Nf(h,n){var u=n.length<0?0:$f(n.length)|0;h=Ar(h,u);for(var s=0;s<u;s+=1)h[s]=n[s]&255;return h}function vc(h,n,u,s){if(n.byteLength,u<0||n.byteLength<u)throw new RangeError("'offset' is out of bounds");if(n.byteLength<u+(s||0))throw new RangeError("'length' is out of bounds");return u===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,u):n=new Uint8Array(n,u,s),mt.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=mt.prototype):h=Nf(h,n),h}function pc(h,n){if(cr(n)){var u=$f(n.length)|0;return h=Ar(h,u),h.length===0||n.copy(h,0,0,u),h}if(n){if(typeof ArrayBuffer!="undefined"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||qc(n.length)?Ar(h,0):Nf(h,n);if(n.type==="Buffer"&&dh(n.data))return Nf(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function $f(h){if(h>=Tn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tn().toString(16)+" bytes");return h|0}mt.isBuffer=Pc;function cr(h){return!!(h!=null&&h._isBuffer)}mt.compare=function(n,u){if(!cr(n)||!cr(u))throw new TypeError("Arguments must be Buffers");if(n===u)return 0;for(var s=n.length,m=u.length,f=0,g=Math.min(s,m);f<g;++f)if(n[f]!==u[f]){s=n[f],m=u[f];break}return s<m?-1:m<s?1:0},mt.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},mt.concat=function(n,u){if(!dh(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return mt.alloc(0);var s;if(u===void 0)for(u=0,s=0;s<n.length;++s)u+=n[s].length;var m=mt.allocUnsafe(u),f=0;for(s=0;s<n.length;++s){var g=n[s];if(!cr(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(m,f),f+=g.length}return m};function ph(h,n){if(cr(h))return h.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var u=h.length;if(u===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":case void 0:return qn(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return Sh(h).length;default:if(s)return qn(h).length;n=(""+n).toLowerCase(),s=!0}}mt.byteLength=ph;function mc(h,n,u){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,n>>>=0,u<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return Bc(this,n,u);case"utf8":case"utf-8":return yh(this,n,u);case"ascii":return Sc(this,n,u);case"latin1":case"binary":return Ac(this,n,u);case"base64":return xc(this,n,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ec(this,n,u);default:if(s)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),s=!0}}mt.prototype._isBuffer=!0;function Qr(h,n,u){var s=h[n];h[n]=h[u],h[u]=s}mt.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<n;u+=2)Qr(this,u,u+1);return this},mt.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<n;u+=4)Qr(this,u,u+3),Qr(this,u+1,u+2);return this},mt.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<n;u+=8)Qr(this,u,u+7),Qr(this,u+1,u+6),Qr(this,u+2,u+5),Qr(this,u+3,u+4);return this},mt.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?yh(this,0,n):mc.apply(this,arguments)},mt.prototype.equals=function(n){if(!cr(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:mt.compare(this,n)===0},mt.prototype.inspect=function(){var n="",u=lc;return this.length>0&&(n=this.toString("hex",0,u).match(/.{2}/g).join(" "),this.length>u&&(n+=" ... ")),"<Buffer "+n+">"},mt.prototype.compare=function(n,u,s,m,f){if(!cr(n))throw new TypeError("Argument must be a Buffer");if(u===void 0&&(u=0),s===void 0&&(s=n?n.length:0),m===void 0&&(m=0),f===void 0&&(f=this.length),u<0||s>n.length||m<0||f>this.length)throw new RangeError("out of range index");if(m>=f&&u>=s)return 0;if(m>=f)return-1;if(u>=s)return 1;if(u>>>=0,s>>>=0,m>>>=0,f>>>=0,this===n)return 0;for(var g=f-m,y=s-u,S=Math.min(g,y),B=this.slice(m,f),M=n.slice(u,s),x=0;x<S;++x)if(B[x]!==M[x]){g=B[x],y=M[x];break}return g<y?-1:y<g?1:0};function mh(h,n,u,s,m){if(h.length===0)return-1;if(typeof u=="string"?(s=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,isNaN(u)&&(u=m?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(m)return-1;u=h.length-1}else if(u<0)if(m)u=0;else return-1;if(typeof n=="string"&&(n=mt.from(n,s)),cr(n))return n.length===0?-1:gh(h,n,u,s,m);if(typeof n=="number")return n=n&255,mt.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(h,n,u):Uint8Array.prototype.lastIndexOf.call(h,n,u):gh(h,[n],u,s,m);throw new TypeError("val must be string, number or Buffer")}function gh(h,n,u,s,m){var f=1,g=h.length,y=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(h.length<2||n.length<2)return-1;f=2,g/=2,y/=2,u/=2}function S(k,D){return f===1?k[D]:k.readUInt16BE(D*f)}var B;if(m){var M=-1;for(B=u;B<g;B++)if(S(h,B)===S(n,M===-1?0:B-M)){if(M===-1&&(M=B),B-M+1===y)return M*f}else M!==-1&&(B-=B-M),M=-1}else for(u+y>g&&(u=g-y),B=u;B>=0;B--){for(var x=!0,I=0;I<y;I++)if(S(h,B+I)!==S(n,I)){x=!1;break}if(x)return B}return-1}mt.prototype.includes=function(n,u,s){return this.indexOf(n,u,s)!==-1},mt.prototype.indexOf=function(n,u,s){return mh(this,n,u,s,!0)},mt.prototype.lastIndexOf=function(n,u,s){return mh(this,n,u,s,!1)};function gc(h,n,u,s){u=Number(u)||0;var m=h.length-u;s?(s=Number(s),s>m&&(s=m)):s=m;var f=n.length;if(f%2!==0)throw new TypeError("Invalid hex string");s>f/2&&(s=f/2);for(var g=0;g<s;++g){var y=parseInt(n.substr(g*2,2),16);if(isNaN(y))return g;h[u+g]=y}return g}function bc(h,n,u,s){return Pn(qn(n,h.length-u),h,u,s)}function bh(h,n,u,s){return Pn(Cc(n),h,u,s)}function yc(h,n,u,s){return bh(h,n,u,s)}function wc(h,n,u,s){return Pn(Sh(n),h,u,s)}function Mc(h,n,u,s){return Pn(Fc(n,h.length-u),h,u,s)}mt.prototype.write=function(n,u,s,m){if(u===void 0)m="utf8",s=this.length,u=0;else if(s===void 0&&typeof u=="string")m=u,s=this.length,u=0;else if(isFinite(u))u=u|0,isFinite(s)?(s=s|0,m===void 0&&(m="utf8")):(m=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-u;if((s===void 0||s>f)&&(s=f),n.length>0&&(s<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var g=!1;;)switch(m){case"hex":return gc(this,n,u,s);case"utf8":case"utf-8":return bc(this,n,u,s);case"ascii":return bh(this,n,u,s);case"latin1":case"binary":return yc(this,n,u,s);case"base64":return wc(this,n,u,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mc(this,n,u,s);default:if(g)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),g=!0}},mt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xc(h,n,u){return n===0&&u===h.length?uh(h):uh(h.slice(n,u))}function yh(h,n,u){u=Math.min(h.length,u);for(var s=[],m=n;m<u;){var f=h[m],g=null,y=f>239?4:f>223?3:f>191?2:1;if(m+y<=u){var S,B,M,x;switch(y){case 1:f<128&&(g=f);break;case 2:S=h[m+1],(S&192)===128&&(x=(f&31)<<6|S&63,x>127&&(g=x));break;case 3:S=h[m+1],B=h[m+2],(S&192)===128&&(B&192)===128&&(x=(f&15)<<12|(S&63)<<6|B&63,x>2047&&(x<55296||x>57343)&&(g=x));break;case 4:S=h[m+1],B=h[m+2],M=h[m+3],(S&192)===128&&(B&192)===128&&(M&192)===128&&(x=(f&15)<<18|(S&63)<<12|(B&63)<<6|M&63,x>65535&&x<1114112&&(g=x))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),m+=y}return _c(s)}var wh=4096;function _c(h){var n=h.length;if(n<=wh)return String.fromCharCode.apply(String,h);for(var u="",s=0;s<n;)u+=String.fromCharCode.apply(String,h.slice(s,s+=wh));return u}function Sc(h,n,u){var s="";u=Math.min(h.length,u);for(var m=n;m<u;++m)s+=String.fromCharCode(h[m]&127);return s}function Ac(h,n,u){var s="";u=Math.min(h.length,u);for(var m=n;m<u;++m)s+=String.fromCharCode(h[m]);return s}function Bc(h,n,u){var s=h.length;(!n||n<0)&&(n=0),(!u||u<0||u>s)&&(u=s);for(var m="",f=n;f<u;++f)m+=Tc(h[f]);return m}function Ec(h,n,u){for(var s=h.slice(n,u),m="",f=0;f<s.length;f+=2)m+=String.fromCharCode(s[f]+s[f+1]*256);return m}mt.prototype.slice=function(n,u){var s=this.length;n=~~n,u=u===void 0?s:~~u,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),u<0?(u+=s,u<0&&(u=0)):u>s&&(u=s),u<n&&(u=n);var m;if(mt.TYPED_ARRAY_SUPPORT)m=this.subarray(n,u),m.__proto__=mt.prototype;else{var f=u-n;m=new mt(f,void 0);for(var g=0;g<f;++g)m[g]=this[g+n]}return m};function Se(h,n,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>u)throw new RangeError("Trying to access beyond buffer length")}mt.prototype.readUIntLE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n],f=1,g=0;++g<u&&(f*=256);)m+=this[n+g]*f;return m},mt.prototype.readUIntBE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n+--u],f=1;u>0&&(f*=256);)m+=this[n+--u]*f;return m},mt.prototype.readUInt8=function(n,u){return u||Se(n,1,this.length),this[n]},mt.prototype.readUInt16LE=function(n,u){return u||Se(n,2,this.length),this[n]|this[n+1]<<8},mt.prototype.readUInt16BE=function(n,u){return u||Se(n,2,this.length),this[n]<<8|this[n+1]},mt.prototype.readUInt32LE=function(n,u){return u||Se(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},mt.prototype.readUInt32BE=function(n,u){return u||Se(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},mt.prototype.readIntLE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=this[n],f=1,g=0;++g<u&&(f*=256);)m+=this[n+g]*f;return f*=128,m>=f&&(m-=Math.pow(2,8*u)),m},mt.prototype.readIntBE=function(n,u,s){n=n|0,u=u|0,s||Se(n,u,this.length);for(var m=u,f=1,g=this[n+--m];m>0&&(f*=256);)g+=this[n+--m]*f;return f*=128,g>=f&&(g-=Math.pow(2,8*u)),g},mt.prototype.readInt8=function(n,u){return u||Se(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},mt.prototype.readInt16LE=function(n,u){u||Se(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},mt.prototype.readInt16BE=function(n,u){u||Se(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},mt.prototype.readInt32LE=function(n,u){return u||Se(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},mt.prototype.readInt32BE=function(n,u){return u||Se(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},mt.prototype.readFloatLE=function(n,u){return u||Se(n,4,this.length),Rn(this,n,!0,23,4)},mt.prototype.readFloatBE=function(n,u){return u||Se(n,4,this.length),Rn(this,n,!1,23,4)},mt.prototype.readDoubleLE=function(n,u){return u||Se(n,8,this.length),Rn(this,n,!0,52,8)},mt.prototype.readDoubleBE=function(n,u){return u||Se(n,8,this.length),Rn(this,n,!1,52,8)};function $e(h,n,u,s,m,f){if(!cr(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>m||n<f)throw new RangeError('"value" argument is out of bounds');if(u+s>h.length)throw new RangeError("Index out of range")}mt.prototype.writeUIntLE=function(n,u,s,m){if(n=+n,u=u|0,s=s|0,!m){var f=Math.pow(2,8*s)-1;$e(this,n,u,s,f,0)}var g=1,y=0;for(this[u]=n&255;++y<s&&(g*=256);)this[u+y]=n/g&255;return u+s},mt.prototype.writeUIntBE=function(n,u,s,m){if(n=+n,u=u|0,s=s|0,!m){var f=Math.pow(2,8*s)-1;$e(this,n,u,s,f,0)}var g=s-1,y=1;for(this[u+g]=n&255;--g>=0&&(y*=256);)this[u+g]=n/y&255;return u+s},mt.prototype.writeUInt8=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,1,255,0),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[u]=n&255,u+1};function Cn(h,n,u,s){n<0&&(n=65535+n+1);for(var m=0,f=Math.min(h.length-u,2);m<f;++m)h[u+m]=(n&255<<8*(s?m:1-m))>>>(s?m:1-m)*8}mt.prototype.writeUInt16LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8):Cn(this,n,u,!0),u+2},mt.prototype.writeUInt16BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>8,this[u+1]=n&255):Cn(this,n,u,!1),u+2};function Fn(h,n,u,s){n<0&&(n=4294967295+n+1);for(var m=0,f=Math.min(h.length-u,4);m<f;++m)h[u+m]=n>>>(s?m:3-m)*8&255}mt.prototype.writeUInt32LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[u+3]=n>>>24,this[u+2]=n>>>16,this[u+1]=n>>>8,this[u]=n&255):Fn(this,n,u,!0),u+4},mt.prototype.writeUInt32BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>24,this[u+1]=n>>>16,this[u+2]=n>>>8,this[u+3]=n&255):Fn(this,n,u,!1),u+4},mt.prototype.writeIntLE=function(n,u,s,m){if(n=+n,u=u|0,!m){var f=Math.pow(2,8*s-1);$e(this,n,u,s,f-1,-f)}var g=0,y=1,S=0;for(this[u]=n&255;++g<s&&(y*=256);)n<0&&S===0&&this[u+g-1]!==0&&(S=1),this[u+g]=(n/y>>0)-S&255;return u+s},mt.prototype.writeIntBE=function(n,u,s,m){if(n=+n,u=u|0,!m){var f=Math.pow(2,8*s-1);$e(this,n,u,s,f-1,-f)}var g=s-1,y=1,S=0;for(this[u+g]=n&255;--g>=0&&(y*=256);)n<0&&S===0&&this[u+g+1]!==0&&(S=1),this[u+g]=(n/y>>0)-S&255;return u+s},mt.prototype.writeInt8=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,1,127,-128),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[u]=n&255,u+1},mt.prototype.writeInt16LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8):Cn(this,n,u,!0),u+2},mt.prototype.writeInt16BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>8,this[u+1]=n&255):Cn(this,n,u,!1),u+2},mt.prototype.writeInt32LE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,2147483647,-2147483648),mt.TYPED_ARRAY_SUPPORT?(this[u]=n&255,this[u+1]=n>>>8,this[u+2]=n>>>16,this[u+3]=n>>>24):Fn(this,n,u,!0),u+4},mt.prototype.writeInt32BE=function(n,u,s){return n=+n,u=u|0,s||$e(this,n,u,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),mt.TYPED_ARRAY_SUPPORT?(this[u]=n>>>24,this[u+1]=n>>>16,this[u+2]=n>>>8,this[u+3]=n&255):Fn(this,n,u,!1),u+4};function Mh(h,n,u,s,m,f){if(u+s>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function xh(h,n,u,s,m){return m||Mh(h,n,u,4),lh(h,n,u,s,23,4),u+4}mt.prototype.writeFloatLE=function(n,u,s){return xh(this,n,u,!0,s)},mt.prototype.writeFloatBE=function(n,u,s){return xh(this,n,u,!1,s)};function _h(h,n,u,s,m){return m||Mh(h,n,u,8),lh(h,n,u,s,52,8),u+8}mt.prototype.writeDoubleLE=function(n,u,s){return _h(this,n,u,!0,s)},mt.prototype.writeDoubleBE=function(n,u,s){return _h(this,n,u,!1,s)},mt.prototype.copy=function(n,u,s,m){if(s||(s=0),!m&&m!==0&&(m=this.length),u>=n.length&&(u=n.length),u||(u=0),m>0&&m<s&&(m=s),m===s||n.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),n.length-u<m-s&&(m=n.length-u+s);var f=m-s,g;if(this===n&&s<u&&u<m)for(g=f-1;g>=0;--g)n[g+u]=this[g+s];else if(f<1e3||!mt.TYPED_ARRAY_SUPPORT)for(g=0;g<f;++g)n[g+u]=this[g+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+f),u);return f},mt.prototype.fill=function(n,u,s,m){if(typeof n=="string"){if(typeof u=="string"?(m=u,u=0,s=this.length):typeof s=="string"&&(m=s,s=this.length),n.length===1){var f=n.charCodeAt(0);f<256&&(n=f)}if(m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!mt.isEncoding(m))throw new TypeError("Unknown encoding: "+m)}else typeof n=="number"&&(n=n&255);if(u<0||this.length<u||this.length<s)throw new RangeError("Out of range index");if(s<=u)return this;u=u>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var g;if(typeof n=="number")for(g=u;g<s;++g)this[g]=n;else{var y=cr(n)?n:qn(new mt(n,m).toString()),S=y.length;for(g=0;g<s-u;++g)this[g+u]=y[g%S]}return this};var kc=/[^+\/0-9A-Za-z-_]/g;function Ic(h){if(h=Rc(h).replace(kc,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Rc(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Tc(h){return h<16?"0"+h.toString(16):h.toString(16)}function qn(h,n){n=n||1/0;for(var u,s=h.length,m=null,f=[],g=0;g<s;++g){if(u=h.charCodeAt(g),u>55295&&u<57344){if(!m){if(u>56319){(n-=3)>-1&&f.push(239,191,189);continue}else if(g+1===s){(n-=3)>-1&&f.push(239,191,189);continue}m=u;continue}if(u<56320){(n-=3)>-1&&f.push(239,191,189),m=u;continue}u=(m-55296<<10|u-56320)+65536}else m&&(n-=3)>-1&&f.push(239,191,189);if(m=null,u<128){if((n-=1)<0)break;f.push(u)}else if(u<2048){if((n-=2)<0)break;f.push(u>>6|192,u&63|128)}else if(u<65536){if((n-=3)<0)break;f.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((n-=4)<0)break;f.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return f}function Cc(h){for(var n=[],u=0;u<h.length;++u)n.push(h.charCodeAt(u)&255);return n}function Fc(h,n){for(var u,s,m,f=[],g=0;g<h.length&&!((n-=2)<0);++g)u=h.charCodeAt(g),s=u>>8,m=u%256,f.push(m),f.push(s);return f}function Sh(h){return hc(Ic(h))}function Pn(h,n,u,s){for(var m=0;m<s&&!(m+u>=n.length||m>=h.length);++m)n[m+u]=h[m];return m}function qc(h){return h!==h}function Pc(h){return h!=null&&(!!h._isBuffer||Ah(h)||Dc(h))}function Ah(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function Dc(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&Ah(h.slice(0,0))}var Yi=function(n,u){for(var s=Math.min(n.length,u.length),m=new mt(s),f=0;f<s;++f)m[f]=n[f]^u[f];return m},Bh=Yi;qf.encrypt=function(h,n){var u=Bh(n,h._prev);return h._prev=h._cipher.encryptBlock(u),h._prev},qf.decrypt=function(h,n){var u=h._prev;h._prev=n;var s=h._cipher.decryptBlock(n);return Bh(s,u)};var Eh={},Ji=zt.Buffer,Nc=Yi;function kh(h,n,u){var s=n.length,m=Nc(n,h._cache);return h._cache=h._cache.slice(s),h._prev=Ji.concat([h._prev,u?n:m]),m}Eh.encrypt=function(h,n,u){for(var s=Ji.allocUnsafe(0),m;n.length;)if(h._cache.length===0&&(h._cache=h._cipher.encryptBlock(h._prev),h._prev=Ji.allocUnsafe(0)),h._cache.length<=n.length)m=h._cache.length,s=Ji.concat([s,kh(h,n.slice(0,m),u)]),n=n.slice(m);else{s=Ji.concat([s,kh(h,n,u)]);break}return s};var Ih={},Uf=zt.Buffer;function $c(h,n,u){var s=h._cipher.encryptBlock(h._prev),m=s[0]^n;return h._prev=Uf.concat([h._prev.slice(1),Uf.from([u?n:m])]),m}Ih.encrypt=function(h,n,u){for(var s=n.length,m=Uf.allocUnsafe(s),f=-1;++f<s;)m[f]=$c(h,n[f],u);return m};var Rh={},Dn=zt.Buffer;function Uc(h,n,u){for(var s,m=-1,f=8,g=0,y,S;++m<f;)s=h._cipher.encryptBlock(h._prev),y=n&1<<7-m?128:0,S=s[0]^y,g+=(S&128)>>m%8,h._prev=Lc(h._prev,u?y:S);return g}function Lc(h,n){var u=h.length,s=-1,m=Dn.allocUnsafe(h.length);for(h=Dn.concat([h,Dn.from([n])]);++s<u;)m[s]=h[s]<<1|h[s+1]>>7;return m}Rh.encrypt=function(h,n,u){for(var s=n.length,m=Dn.allocUnsafe(s),f=-1;++f<s;)m[f]=Uc(h,n[f],u);return m};var Th={},Oc=Yi;function zc(h){return h._prev=h._cipher.encryptBlock(h._prev),h._prev}Th.encrypt=function(h,n){for(;h._cache.length<n.length;)h._cache=mt.concat([h._cache,zc(h)]);var u=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),Oc(n,u)};var Lf={};function Kc(h){for(var n=h.length,u;n--;)if(u=h.readUInt8(n),u===255)h.writeUInt8(0,n);else{u++,h.writeUInt8(u,n);break}}var Ch=Kc,Hc=Yi,Fh=zt.Buffer,Zc=Ch;function Wc(h){var n=h._cipher.encryptBlockRaw(h._prev);return Zc(h._prev),n}var Of=16;Lf.encrypt=function(h,n){var u=Math.ceil(n.length/Of),s=h._cache.length;h._cache=Fh.concat([h._cache,Fh.allocUnsafe(u*Of)]);for(var m=0;m<u;m++){var f=Wc(h),g=s+m*Of;h._cache.writeUInt32BE(f[0],g+0),h._cache.writeUInt32BE(f[1],g+4),h._cache.writeUInt32BE(f[2],g+8),h._cache.writeUInt32BE(f[3],g+12)}var y=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),Hc(n,y)};const qh={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var Vc={ECB:Ff,CBC:qf,CFB:Eh,CFB8:Ih,CFB1:Rh,OFB:Th,CTR:Lf,GCM:Lf},Nn=qh;for(var Ph in Nn)Nn[Ph].module=Vc[Nn[Ph].mode];var zf=Nn,Gi={},$n=zt.Buffer;function Kf(h){$n.isBuffer(h)||(h=$n.from(h));for(var n=h.length/4|0,u=new Array(n),s=0;s<n;s++)u[s]=h.readUInt32BE(s*4);return u}function Hf(h){for(var n=0;n<h.length;h++)h[n]=0}function Dh(h,n,u,s,m){for(var f=u[0],g=u[1],y=u[2],S=u[3],B=h[0]^n[0],M=h[1]^n[1],x=h[2]^n[2],I=h[3]^n[3],k,D,L,W,z=4,$=1;$<m;$++)k=f[B>>>24]^g[M>>>16&255]^y[x>>>8&255]^S[I&255]^n[z++],D=f[M>>>24]^g[x>>>16&255]^y[I>>>8&255]^S[B&255]^n[z++],L=f[x>>>24]^g[I>>>16&255]^y[B>>>8&255]^S[M&255]^n[z++],W=f[I>>>24]^g[B>>>16&255]^y[M>>>8&255]^S[x&255]^n[z++],B=k,M=D,x=L,I=W;return k=(s[B>>>24]<<24|s[M>>>16&255]<<16|s[x>>>8&255]<<8|s[I&255])^n[z++],D=(s[M>>>24]<<24|s[x>>>16&255]<<16|s[I>>>8&255]<<8|s[B&255])^n[z++],L=(s[x>>>24]<<24|s[I>>>16&255]<<16|s[B>>>8&255]<<8|s[M&255])^n[z++],W=(s[I>>>24]<<24|s[B>>>16&255]<<16|s[M>>>8&255]<<8|s[x&255])^n[z++],k=k>>>0,D=D>>>0,L=L>>>0,W=W>>>0,[k,D,L,W]}var Yc=[0,1,2,4,8,16,32,64,128,27,54],we=function(){for(var h=new Array(256),n=0;n<256;n++)n<128?h[n]=n<<1:h[n]=n<<1^283;for(var u=[],s=[],m=[[],[],[],[]],f=[[],[],[],[]],g=0,y=0,S=0;S<256;++S){var B=y^y<<1^y<<2^y<<3^y<<4;B=B>>>8^B&255^99,u[g]=B,s[B]=g;var M=h[g],x=h[M],I=h[x],k=h[B]*257^B*16843008;m[0][g]=k<<24|k>>>8,m[1][g]=k<<16|k>>>16,m[2][g]=k<<8|k>>>24,m[3][g]=k,k=I*16843009^x*65537^M*257^g*16843008,f[0][B]=k<<24|k>>>8,f[1][B]=k<<16|k>>>16,f[2][B]=k<<8|k>>>24,f[3][B]=k,g===0?g=y=1:(g=M^h[h[h[I^M]]],y^=h[h[y]])}return{SBOX:u,INV_SBOX:s,SUB_MIX:m,INV_SUB_MIX:f}}();function Xe(h){this._key=Kf(h),this._reset()}Xe.blockSize=4*4,Xe.keySize=256/8,Xe.prototype.blockSize=Xe.blockSize,Xe.prototype.keySize=Xe.keySize,Xe.prototype._reset=function(){for(var h=this._key,n=h.length,u=n+6,s=(u+1)*4,m=[],f=0;f<n;f++)m[f]=h[f];for(f=n;f<s;f++){var g=m[f-1];f%n===0?(g=g<<8|g>>>24,g=we.SBOX[g>>>24]<<24|we.SBOX[g>>>16&255]<<16|we.SBOX[g>>>8&255]<<8|we.SBOX[g&255],g^=Yc[f/n|0]<<24):n>6&&f%n===4&&(g=we.SBOX[g>>>24]<<24|we.SBOX[g>>>16&255]<<16|we.SBOX[g>>>8&255]<<8|we.SBOX[g&255]),m[f]=m[f-n]^g}for(var y=[],S=0;S<s;S++){var B=s-S,M=m[B-(S%4?0:4)];S<4||B<=4?y[S]=M:y[S]=we.INV_SUB_MIX[0][we.SBOX[M>>>24]]^we.INV_SUB_MIX[1][we.SBOX[M>>>16&255]]^we.INV_SUB_MIX[2][we.SBOX[M>>>8&255]]^we.INV_SUB_MIX[3][we.SBOX[M&255]]}this._nRounds=u,this._keySchedule=m,this._invKeySchedule=y},Xe.prototype.encryptBlockRaw=function(h){return h=Kf(h),Dh(h,this._keySchedule,we.SUB_MIX,we.SBOX,this._nRounds)},Xe.prototype.encryptBlock=function(h){var n=this.encryptBlockRaw(h),u=$n.allocUnsafe(16);return u.writeUInt32BE(n[0],0),u.writeUInt32BE(n[1],4),u.writeUInt32BE(n[2],8),u.writeUInt32BE(n[3],12),u},Xe.prototype.decryptBlock=function(h){h=Kf(h);var n=h[1];h[1]=h[3],h[3]=n;var u=Dh(h,this._invKeySchedule,we.INV_SUB_MIX,we.INV_SBOX,this._nRounds),s=$n.allocUnsafe(16);return s.writeUInt32BE(u[0],0),s.writeUInt32BE(u[3],4),s.writeUInt32BE(u[2],8),s.writeUInt32BE(u[1],12),s},Xe.prototype.scrub=function(){Hf(this._keySchedule),Hf(this._invKeySchedule),Hf(this._key)},Gi.AES=Xe;var pi=zt.Buffer,Jc=pi.alloc(16,0);function Gc(h){return[h.readUInt32BE(0),h.readUInt32BE(4),h.readUInt32BE(8),h.readUInt32BE(12)]}function Nh(h){var n=pi.allocUnsafe(16);return n.writeUInt32BE(h[0]>>>0,0),n.writeUInt32BE(h[1]>>>0,4),n.writeUInt32BE(h[2]>>>0,8),n.writeUInt32BE(h[3]>>>0,12),n}function Xi(h){this.h=h,this.state=pi.alloc(16,0),this.cache=pi.allocUnsafe(0)}Xi.prototype.ghash=function(h){for(var n=-1;++n<h.length;)this.state[n]^=h[n];this._multiply()},Xi.prototype._multiply=function(){for(var h=Gc(this.h),n=[0,0,0,0],u,s,m,f=-1;++f<128;){for(s=(this.state[~~(f/8)]&1<<7-f%8)!==0,s&&(n[0]^=h[0],n[1]^=h[1],n[2]^=h[2],n[3]^=h[3]),m=(h[3]&1)!==0,u=3;u>0;u--)h[u]=h[u]>>>1|(h[u-1]&1)<<31;h[0]=h[0]>>>1,m&&(h[0]=h[0]^225<<24)}this.state=Nh(n)},Xi.prototype.update=function(h){this.cache=pi.concat([this.cache,h]);for(var n;this.cache.length>=16;)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)},Xi.prototype.final=function(h,n){return this.cache.length&&this.ghash(pi.concat([this.cache,Jc],16)),this.ghash(Nh([0,h,0,n])),this.state};var Xc=Xi,jc=Gi,Ue=zt.Buffer,$h=Nr,Qc=Kt,Uh=Xc,t1=Yi,e1=Ch;function r1(h,n){var u=0;h.length!==n.length&&u++;for(var s=Math.min(h.length,n.length),m=0;m<s;++m)u+=h[m]^n[m];return u}function i1(h,n,u){if(n.length===12)return h._finID=Ue.concat([n,Ue.from([0,0,0,1])]),Ue.concat([n,Ue.from([0,0,0,2])]);var s=new Uh(u),m=n.length,f=m%16;s.update(n),f&&(f=16-f,s.update(Ue.alloc(f,0))),s.update(Ue.alloc(8,0));var g=m*8,y=Ue.alloc(8);y.writeUIntBE(g,0,8),s.update(y),h._finID=s.state;var S=Ue.from(h._finID);return e1(S),S}function ti(h,n,u,s){$h.call(this);var m=Ue.alloc(4,0);this._cipher=new jc.AES(n);var f=this._cipher.encryptBlock(m);this._ghash=new Uh(f),u=i1(this,u,f),this._prev=Ue.from(u),this._cache=Ue.allocUnsafe(0),this._secCache=Ue.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=h,this._authTag=null,this._called=!1}Qc(ti,$h),ti.prototype._update=function(h){if(!this._called&&this._alen){var n=16-this._alen%16;n<16&&(n=Ue.alloc(n,0),this._ghash.update(n))}this._called=!0;var u=this._mode.encrypt(this,h);return this._decrypt?this._ghash.update(h):this._ghash.update(u),this._len+=h.length,u},ti.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var h=t1(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&r1(h,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=h,this._cipher.scrub()},ti.prototype.getAuthTag=function(){if(this._decrypt||!Ue.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},ti.prototype.setAuthTag=function(n){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=n},ti.prototype.setAAD=function(n){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(n),this._alen+=n.length};var Lh=ti,n1=Gi,Zf=zt.Buffer,Oh=Nr,f1=Kt;function Un(h,n,u,s){Oh.call(this),this._cipher=new n1.AES(n),this._prev=Zf.from(u),this._cache=Zf.allocUnsafe(0),this._secCache=Zf.allocUnsafe(0),this._decrypt=s,this._mode=h}f1(Un,Oh),Un.prototype._update=function(h){return this._mode.encrypt(this,h,this._decrypt)},Un.prototype._final=function(){this._cipher.scrub()};var zh=Un,ei=zt.Buffer,a1=yf;function h1(h,n,u,s){if(ei.isBuffer(h)||(h=ei.from(h,"binary")),n&&(ei.isBuffer(n)||(n=ei.from(n,"binary")),n.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var m=u/8,f=ei.alloc(m),g=ei.alloc(s||0),y=ei.alloc(0);m>0||s>0;){var S=new a1;S.update(y),S.update(h),n&&S.update(n),y=S.digest();var B=0;if(m>0){var M=f.length-m;B=Math.min(m,y.length),y.copy(f,M,0,B),m-=B}if(B<y.length&&s>0){var x=g.length-s,I=Math.min(s,y.length-B);y.copy(g,x,B,B+I),s-=I}}return y.fill(0),{key:f,iv:g}}var Ln=h1,Kh=zf,s1=Lh,Br=zt.Buffer,o1=zh,Hh=Nr,u1=Gi,l1=Ln,d1=Kt;function ji(h,n,u){Hh.call(this),this._cache=new On,this._cipher=new u1.AES(n),this._prev=Br.from(u),this._mode=h,this._autopadding=!0}d1(ji,Hh),ji.prototype._update=function(h){this._cache.add(h);for(var n,u,s=[];n=this._cache.get();)u=this._mode.encrypt(this,n),s.push(u);return Br.concat(s)};var c1=Br.alloc(16,16);ji.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return h=this._mode.encrypt(this,h),this._cipher.scrub(),h;if(!h.equals(c1))throw this._cipher.scrub(),new Error("data not multiple of block length")},ji.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function On(){this.cache=Br.allocUnsafe(0)}On.prototype.add=function(h){this.cache=Br.concat([this.cache,h])},On.prototype.get=function(){if(this.cache.length>15){var h=this.cache.slice(0,16);return this.cache=this.cache.slice(16),h}return null},On.prototype.flush=function(){for(var h=16-this.cache.length,n=Br.allocUnsafe(h),u=-1;++u<h;)n.writeUInt8(h,u);return Br.concat([this.cache,n])};function Zh(h,n,u){var s=Kh[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof n=="string"&&(n=Br.from(n)),n.length!==s.key/8)throw new TypeError("invalid key length "+n.length);if(typeof u=="string"&&(u=Br.from(u)),s.mode!=="GCM"&&u.length!==s.iv)throw new TypeError("invalid iv length "+u.length);return s.type==="stream"?new o1(s.module,n,u):s.type==="auth"?new s1(s.module,n,u):new ji(s.module,n,u)}function v1(h,n){var u=Kh[h.toLowerCase()];if(!u)throw new TypeError("invalid suite type");var s=l1(n,!1,u.key,u.iv);return Zh(h,s.key,s.iv)}Cf.createCipheriv=Zh,Cf.createCipher=v1;var Wf={},p1=Lh,mi=zt.Buffer,Wh=zf,m1=zh,Vh=Nr,g1=Gi,b1=Ln,y1=Kt;function Qi(h,n,u){Vh.call(this),this._cache=new zn,this._last=void 0,this._cipher=new g1.AES(n),this._prev=mi.from(u),this._mode=h,this._autopadding=!0}y1(Qi,Vh),Qi.prototype._update=function(h){this._cache.add(h);for(var n,u,s=[];n=this._cache.get(this._autopadding);)u=this._mode.decrypt(this,n),s.push(u);return mi.concat(s)},Qi.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return w1(this._mode.decrypt(this,h));if(h)throw new Error("data not multiple of block length")},Qi.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function zn(){this.cache=mi.allocUnsafe(0)}zn.prototype.add=function(h){this.cache=mi.concat([this.cache,h])},zn.prototype.get=function(h){var n;if(h){if(this.cache.length>16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n}else if(this.cache.length>=16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n;return null},zn.prototype.flush=function(){if(this.cache.length)return this.cache};function w1(h){var n=h[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var u=-1;++u<n;)if(h[u+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return h.slice(0,16-n)}function Yh(h,n,u){var s=Wh[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof u=="string"&&(u=mi.from(u)),s.mode!=="GCM"&&u.length!==s.iv)throw new TypeError("invalid iv length "+u.length);if(typeof n=="string"&&(n=mi.from(n)),n.length!==s.key/8)throw new TypeError("invalid key length "+n.length);return s.type==="stream"?new m1(s.module,n,u,!0):s.type==="auth"?new p1(s.module,n,u,!0):new Qi(s.module,n,u)}function M1(h,n){var u=Wh[h.toLowerCase()];if(!u)throw new TypeError("invalid suite type");var s=b1(n,!1,u.key,u.iv);return Yh(h,s.key,s.iv)}Wf.createDecipher=M1,Wf.createDecipheriv=Yh;var Jh=Cf,Gh=Wf,x1=qh;function _1(){return Object.keys(x1)}Ze.createCipher=Ze.Cipher=Jh.createCipher,Ze.createCipheriv=Ze.Cipheriv=Jh.createCipheriv,Ze.createDecipher=Ze.Decipher=Gh.createDecipher,Ze.createDecipheriv=Ze.Decipheriv=Gh.createDecipheriv,Ze.listCiphers=Ze.getCiphers=_1;var Xh={};(function(h){h["des-ecb"]={key:8,iv:0},h["des-cbc"]=h.des={key:8,iv:8},h["des-ede3-cbc"]=h.des3={key:24,iv:8},h["des-ede3"]={key:24,iv:0},h["des-ede-cbc"]={key:16,iv:8},h["des-ede"]={key:16,iv:0}})(Xh);var jh=fc,Vf=Ze,Ur=zf,Er=Xh,Qh=Ln;function S1(h,n){h=h.toLowerCase();var u,s;if(Ur[h])u=Ur[h].key,s=Ur[h].iv;else if(Er[h])u=Er[h].key*8,s=Er[h].iv;else throw new TypeError("invalid suite type");var m=Qh(n,!1,u,s);return ts(h,m.key,m.iv)}function A1(h,n){h=h.toLowerCase();var u,s;if(Ur[h])u=Ur[h].key,s=Ur[h].iv;else if(Er[h])u=Er[h].key*8,s=Er[h].iv;else throw new TypeError("invalid suite type");var m=Qh(n,!1,u,s);return es(h,m.key,m.iv)}function ts(h,n,u){if(h=h.toLowerCase(),Ur[h])return Vf.createCipheriv(h,n,u);if(Er[h])return new jh({key:n,iv:u,mode:h});throw new TypeError("invalid suite type")}function es(h,n,u){if(h=h.toLowerCase(),Ur[h])return Vf.createDecipheriv(h,n,u);if(Er[h])return new jh({key:n,iv:u,mode:h,decrypt:!0});throw new TypeError("invalid suite type")}function B1(){return Object.keys(Er).concat(Vf.getCiphers())}rr.createCipher=rr.Cipher=S1,rr.createCipheriv=rr.Cipheriv=ts,rr.createDecipher=rr.Decipher=A1,rr.createDecipheriv=rr.Decipheriv=es,rr.listCiphers=rr.getCiphers=B1;var ri={},Yf={exports:{}};Yf.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(Yf);var rs=Yf.exports,Jf={exports:{}};Jf.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(Jf);var E1=Jf.exports,Kn={exports:{}},is;function Gf(){if(is)return Kn.exports;is=1;var h;Kn.exports=function(m){return h||(h=new n(null)),h.generate(m)};function n(s){this.rand=s}if(Kn.exports.Rand=n,n.prototype.generate=function(m){return this._rand(m)},n.prototype._rand=function(m){if(this.rand.getBytes)return this.rand.getBytes(m);for(var f=new Uint8Array(m),g=0;g<f.length;g++)f[g]=this.rand.getByte();return f},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.msCrypto.getRandomValues(f),f}:typeof window=="object"&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var u=Qo();if(typeof u.randomBytes!="function")throw new Error("Not supported");n.prototype._rand=function(m){return u.randomBytes(m)}}catch(s){}return Kn.exports}var Xf,ns;function fs(){if(ns)return Xf;ns=1;var h=E1,n=Gf();function u(s){this.rand=s||new n.Rand}return Xf=u,u.create=function(m){return new u(m)},u.prototype._randbelow=function(m){var f=m.bitLength(),g=Math.ceil(f/8);do var y=new h(this.rand.generate(g));while(y.cmp(m)>=0);return y},u.prototype._randrange=function(m,f){var g=f.sub(m);return m.add(this._randbelow(g))},u.prototype.test=function(m,f,g){var y=m.bitLength(),S=h.mont(m),B=new h(1).toRed(S);f||(f=Math.max(1,y/48|0));for(var M=m.subn(1),x=0;!M.testn(x);x++);for(var I=m.shrn(x),k=M.toRed(S),D=!0;f>0;f--){var L=this._randrange(new h(2),M);g&&g(L);var W=L.toRed(S).redPow(I);if(!(W.cmp(B)===0||W.cmp(k)===0)){for(var z=1;z<x;z++){if(W=W.redSqr(),W.cmp(B)===0)return!1;if(W.cmp(k)===0)break}if(z===x)return!1}}return D},u.prototype.getDivisor=function(m,f){var g=m.bitLength(),y=h.mont(m),S=new h(1).toRed(y);f||(f=Math.max(1,g/48|0));for(var B=m.subn(1),M=0;!B.testn(M);M++);for(var x=m.shrn(M),I=B.toRed(y);f>0;f--){var k=this._randrange(new h(2),B),D=m.gcd(k);if(D.cmpn(1)!==0)return D;var L=k.toRed(y).redPow(x);if(!(L.cmp(S)===0||L.cmp(I)===0)){for(var W=1;W<M;W++){if(L=L.redSqr(),L.cmp(S)===0)return L.fromRed().subn(1).gcd(m);if(L.cmp(I)===0)break}if(W===M)return L=L.redSqr(),L.fromRed().subn(1).gcd(m)}}return!1},Xf}var jf,as;function hs(){if(as)return jf;as=1;var h=li;jf=W,W.simpleSieve=D,W.fermatTest=L;var n=rs,u=new n(24),s=fs(),m=new s,f=new n(1),g=new n(2),y=new n(5);new n(16),new n(8);var S=new n(10),B=new n(3);new n(7);var M=new n(11),x=new n(4);new n(12);var I=null;function k(){if(I!==null)return I;var z=1048576,$=[];$[0]=2;for(var lt=1,H=3;H<z;H+=2){for(var At=Math.ceil(Math.sqrt(H)),Bt=0;Bt<lt&&$[Bt]<=At&&H%$[Bt]!==0;Bt++);lt!==Bt&&$[Bt]<=At||($[lt++]=H)}return I=$,$}function D(z){for(var $=k(),lt=0;lt<$.length;lt++)if(z.modn($[lt])===0)return z.cmpn($[lt])===0;return!0}function L(z){var $=n.mont(z);return g.toRed($).redPow(z.subn(1)).fromRed().cmpn(1)===0}function W(z,$){if(z<16)return $===2||$===5?new n([140,123]):new n([140,39]);$=new n($);for(var lt,H;;){for(lt=new n(h(Math.ceil(z/8)));lt.bitLength()>z;)lt.ishrn(1);if(lt.isEven()&<.iadd(f),lt.testn(1)||lt.iadd(g),$.cmp(g)){if(!$.cmp(y))for(;lt.mod(S).cmp(B);)lt.iadd(x)}else for(;lt.mod(u).cmp(M);)lt.iadd(x);if(H=lt.shrn(1),D(H)&&D(lt)&&L(H)&&L(lt)&&m.test(H)&&m.test(lt))return lt}}return jf}const k1={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}};var Qf,ss;function I1(){if(ss)return Qf;ss=1;var h=rs,n=fs(),u=new n,s=new h(24),m=new h(11),f=new h(10),g=new h(3),y=new h(7),S=hs(),B=li;Qf=D;function M(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._pub=new h(W),this}function x(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._priv=new h(W),this}var I={};function k(W,z){var $=z.toString("hex"),lt=[$,W.toString(16)].join("_");if(lt in I)return I[lt];var H=0;if(W.isEven()||!S.simpleSieve||!S.fermatTest(W)||!u.test(W))return H+=1,$==="02"||$==="05"?H+=8:H+=4,I[lt]=H,H;u.test(W.shrn(1))||(H+=2);var At;switch($){case"02":W.mod(s).cmp(m)&&(H+=8);break;case"05":At=W.mod(f),At.cmp(g)&&At.cmp(y)&&(H+=8);break;default:H+=4}return I[lt]=H,H}function D(W,z,$){this.setGenerator(z),this.__prime=new h(W),this._prime=h.mont(this.__prime),this._primeLen=W.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$?(this.setPublicKey=M,this.setPrivateKey=x):this._primeCode=8}Object.defineProperty(D.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=k(this.__prime,this.__gen)),this._primeCode}}),D.prototype.generateKeys=function(){return this._priv||(this._priv=new h(B(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},D.prototype.computeSecret=function(W){W=new h(W),W=W.toRed(this._prime);var z=W.redPow(this._priv).fromRed(),$=new mt(z.toArray()),lt=this.getPrime();if($.length<lt.length){var H=new mt(lt.length-$.length);H.fill(0),$=mt.concat([H,$])}return $},D.prototype.getPublicKey=function(z){return L(this._pub,z)},D.prototype.getPrivateKey=function(z){return L(this._priv,z)},D.prototype.getPrime=function(W){return L(this.__prime,W)},D.prototype.getGenerator=function(W){return L(this._gen,W)},D.prototype.setGenerator=function(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this.__gen=W,this._gen=new h(W),this};function L(W,z){var $=new mt(W.toArray());return z?$.toString(z):$}return Qf}var os;function R1(){if(os)return ri;os=1;var h=hs(),n=k1,u=I1();function s(g){var y=new mt(n[g].prime,"hex"),S=new mt(n[g].gen,"hex");return new u(y,S)}var m={binary:!0,hex:!0,base64:!0};function f(g,y,S,B){return mt.isBuffer(y)||m[y]===void 0?f(g,"binary",y,S):(y=y||"binary",B=B||"binary",S=S||new mt([2]),mt.isBuffer(S)||(S=new mt(S,B)),typeof g=="number"?new u(h(g,S),S,!0):(mt.isBuffer(g)||(g=new mt(g,y)),new u(g,S,!0)))}return ri.DiffieHellmanGroup=ri.createDiffieHellmanGroup=ri.getDiffieHellman=s,ri.createDiffieHellman=ri.DiffieHellman=f,ri}var t0={exports:{}},e0={exports:{}};typeof ye=="undefined"||!ye.version||ye.version.indexOf("v0.")===0||ye.version.indexOf("v1.")===0&&ye.version.indexOf("v1.8.")!==0?e0.exports={nextTick:T1}:e0.exports=ye;function T1(h,n,u,s){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var m=arguments.length,f,g;switch(m){case 0:case 1:return ye.nextTick(h);case 2:return ye.nextTick(function(){h.call(null,n)});case 3:return ye.nextTick(function(){h.call(null,n,u)});case 4:return ye.nextTick(function(){h.call(null,n,u,s)});default:for(f=new Array(m-1),g=0;g<f.length;)f[g++]=arguments[g];return ye.nextTick(function(){h.apply(null,f)})}}var Hn=e0.exports,C1={}.toString,F1=Array.isArray||function(h){return C1.call(h)=="[object Array]"},us=Ne.EventEmitter,r0={exports:{}};(function(h,n){var u=Ke,s=u.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?h.exports=u:(m(u,n),n.Buffer=f);function f(g,y,S){return s(g,y,S)}m(s,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return s(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=s(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(g)}})(r0,r0.exports);var i0=r0.exports,Me={};function q1(h){return Array.isArray?Array.isArray(h):Zn(h)==="[object Array]"}Me.isArray=q1;function P1(h){return typeof h=="boolean"}Me.isBoolean=P1;function D1(h){return h===null}Me.isNull=D1;function N1(h){return h==null}Me.isNullOrUndefined=N1;function $1(h){return typeof h=="number"}Me.isNumber=$1;function U1(h){return typeof h=="string"}Me.isString=U1;function L1(h){return typeof h=="symbol"}Me.isSymbol=L1;function O1(h){return h===void 0}Me.isUndefined=O1;function z1(h){return Zn(h)==="[object RegExp]"}Me.isRegExp=z1;function K1(h){return typeof h=="object"&&h!==null}Me.isObject=K1;function H1(h){return Zn(h)==="[object Date]"}Me.isDate=H1;function Z1(h){return Zn(h)==="[object Error]"||h instanceof Error}Me.isError=Z1;function W1(h){return typeof h=="function"}Me.isFunction=W1;function V1(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h=="undefined"}Me.isPrimitive=V1,Me.isBuffer=Ke.Buffer.isBuffer;function Zn(h){return Object.prototype.toString.call(h)}var n0={exports:{}},ls;function Y1(){return ls||(ls=1,function(h){function n(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var u=i0.Buffer,s=Ne;function m(f,g,y){f.copy(g,y)}h.exports=function(){function f(){n(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(y){var S={data:y,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},f.prototype.unshift=function(y){var S={data:y,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},f.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(y){if(this.length===0)return"";for(var S=this.head,B=""+S.data;S=S.next;)B+=y+S.data;return B},f.prototype.concat=function(y){if(this.length===0)return u.alloc(0);for(var S=u.allocUnsafe(y>>>0),B=this.head,M=0;B;)m(B.data,S,M),M+=B.data.length,B=B.next;return S},f}(),s&&s.inspect&&s.inspect.custom&&(h.exports.prototype[s.inspect.custom]=function(){var f=s.inspect({length:this.length});return this.constructor.name+" "+f})}(n0)),n0.exports}var Wn=Hn;function J1(h,n){var u=this,s=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return s||m?(n?n(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Wn.nextTick(Vn,this,h)):Wn.nextTick(Vn,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(f){!n&&f?u._writableState?u._writableState.errorEmitted||(u._writableState.errorEmitted=!0,Wn.nextTick(Vn,u,f)):Wn.nextTick(Vn,u,f):n&&n(f)}),this)}function G1(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Vn(h,n){h.emit("error",n)}var ds={destroy:J1,undestroy:G1},X1=j1;function j1(h,n){if(f0("noDeprecation"))return h;var u=!1;function s(){if(!u){if(f0("throwDeprecation"))throw new Error(n);f0("traceDeprecation")?console.trace(n):console.warn(n),u=!0}return h.apply(this,arguments)}return s}function f0(h){try{if(!Ft.localStorage)return!1}catch(u){return!1}var n=Ft.localStorage[h];return n==null?!1:String(n).toLowerCase()==="true"}var a0,cs;function vs(){if(cs)return a0;cs=1;var h=Hn;a0=L;function n(c){var v=this;this.next=null,this.entry=null,this.finish=function(){d(v,c)}}var u=!ye.browser&&["v0.10","v0.9."].indexOf(ye.version.slice(0,5))>-1?setImmediate:h.nextTick,s;L.WritableState=k;var m=Object.create(Me);m.inherits=Kt;var f={deprecate:X1},g=us,y=i0.Buffer,S=(typeof Ft!="undefined"?Ft:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function B(c){return y.from(c)}function M(c){return y.isBuffer(c)||c instanceof S}var x=ds;m.inherits(L,g);function I(){}function k(c,v){s=s||gi(),c=c||{};var o=v instanceof s;this.objectMode=!!c.objectMode,o&&(this.objectMode=this.objectMode||!!c.writableObjectMode);var e=c.highWaterMark,l=c.writableHighWaterMark,b=this.objectMode?16:16*1024;e||e===0?this.highWaterMark=e:o&&(l||l===0)?this.highWaterMark=l:this.highWaterMark=b,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _=c.decodeStrings===!1;this.decodeStrings=!_,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(C){Ct(v,C)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}k.prototype.getBuffer=function(){for(var v=this.bufferedRequest,o=[];v;)o.push(v),v=v.next;return o},function(){try{Object.defineProperty(k.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(c){}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(c){return D.call(this,c)?!0:this!==L?!1:c&&c._writableState instanceof k}})):D=function(c){return c instanceof this};function L(c){if(s=s||gi(),!D.call(L,this)&&!(this instanceof s))return new L(c);this._writableState=new k(c,this),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),g.call(this)}L.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function W(c,v){var o=new Error("write after end");c.emit("error",o),h.nextTick(v,o)}function z(c,v,o,e){var l=!0,b=!1;return o===null?b=new TypeError("May not write null values to stream"):typeof o!="string"&&o!==void 0&&!v.objectMode&&(b=new TypeError("Invalid non-string/buffer chunk")),b&&(c.emit("error",b),h.nextTick(e,b),l=!1),l}L.prototype.write=function(c,v,o){var e=this._writableState,l=!1,b=!e.objectMode&&M(c);return b&&!y.isBuffer(c)&&(c=B(c)),typeof v=="function"&&(o=v,v=null),b?v="buffer":v||(v=e.defaultEncoding),typeof o!="function"&&(o=I),e.ended?W(this,o):(b||z(this,e,c,o))&&(e.pendingcb++,l=lt(this,e,b,c,v,o)),l},L.prototype.cork=function(){var c=this._writableState;c.corked++},L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&It(this,c))},L.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+v);return this._writableState.defaultEncoding=v,this};function $(c,v,o){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=y.from(v,o)),v}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function lt(c,v,o,e,l,b){if(!o){var _=$(v,e,l);e!==_&&(o=!0,l="buffer",e=_)}var C=v.objectMode?1:e.length;v.length+=C;var q=v.length<v.highWaterMark;if(q||(v.needDrain=!0),v.writing||v.corked){var O=v.lastBufferedRequest;v.lastBufferedRequest={chunk:e,encoding:l,isBuf:o,callback:b,next:null},O?O.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else H(c,v,!1,C,e,l,b);return q}function H(c,v,o,e,l,b,_){v.writelen=e,v.writecb=_,v.writing=!0,v.sync=!0,o?c._writev(l,v.onwrite):c._write(l,b,v.onwrite),v.sync=!1}function At(c,v,o,e,l){--v.pendingcb,o?(h.nextTick(l,e),h.nextTick(i,c,v),c._writableState.errorEmitted=!0,c.emit("error",e)):(l(e),c._writableState.errorEmitted=!0,c.emit("error",e),i(c,v))}function Bt(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function Ct(c,v){var o=c._writableState,e=o.sync,l=o.writecb;if(Bt(o),v)At(c,o,e,v,l);else{var b=p(o);!b&&!o.corked&&!o.bufferProcessing&&o.bufferedRequest&&It(c,o),e?u(Et,c,o,b,l):Et(c,o,b,l)}}function Et(c,v,o,e){o||Y(c,v),v.pendingcb--,e(),i(c,v)}function Y(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function It(c,v){v.bufferProcessing=!0;var o=v.bufferedRequest;if(c._writev&&o&&o.next){var e=v.bufferedRequestCount,l=new Array(e),b=v.corkedRequestsFree;b.entry=o;for(var _=0,C=!0;o;)l[_]=o,o.isBuf||(C=!1),o=o.next,_+=1;l.allBuffers=C,H(c,v,!0,v.length,l,"",b.finish),v.pendingcb++,v.lastBufferedRequest=null,b.next?(v.corkedRequestsFree=b.next,b.next=null):v.corkedRequestsFree=new n(v),v.bufferedRequestCount=0}else{for(;o;){var q=o.chunk,O=o.encoding,R=o.callback,P=v.objectMode?1:q.length;if(H(c,v,!1,P,q,O,R),o=o.next,v.bufferedRequestCount--,v.writing)break}o===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=o,v.bufferProcessing=!1}L.prototype._write=function(c,v,o){o(new Error("_write() is not implemented"))},L.prototype._writev=null,L.prototype.end=function(c,v,o){var e=this._writableState;typeof c=="function"?(o=c,c=null,v=null):typeof v=="function"&&(o=v,v=null),c!=null&&this.write(c,v),e.corked&&(e.corked=1,this.uncork()),e.ending||a(this,e,o)};function p(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function t(c,v){c._final(function(o){v.pendingcb--,o&&c.emit("error",o),v.prefinished=!0,c.emit("prefinish"),i(c,v)})}function r(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"?(v.pendingcb++,v.finalCalled=!0,h.nextTick(t,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function i(c,v){var o=p(v);return o&&(r(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"))),o}function a(c,v,o){v.ending=!0,i(c,v),o&&(v.finished?h.nextTick(o):c.once("finish",o)),v.ended=!0,c.writable=!1}function d(c,v,o){var e=c.entry;for(c.entry=null;e;){var l=e.callback;v.pendingcb--,l(o),e=e.next}v.corkedRequestsFree.next=c}return Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(c){this._writableState&&(this._writableState.destroyed=c)}}),L.prototype.destroy=x.destroy,L.prototype._undestroy=x.undestroy,L.prototype._destroy=function(c,v){this.end(),v(c)},a0}var h0,ps;function gi(){if(ps)return h0;ps=1;var h=Hn,n=Object.keys||function(x){var I=[];for(var k in x)I.push(k);return I};h0=S;var u=Object.create(Me);u.inherits=Kt;var s=gs(),m=vs();u.inherits(S,s);for(var f=n(m.prototype),g=0;g<f.length;g++){var y=f[g];S.prototype[y]||(S.prototype[y]=m.prototype[y])}function S(x){if(!(this instanceof S))return new S(x);s.call(this,x),m.call(this,x),x&&x.readable===!1&&(this.readable=!1),x&&x.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,x&&x.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",B)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(){this.allowHalfOpen||this._writableState.ended||h.nextTick(M,this)}function M(x){x.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(x){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=x,this._writableState.destroyed=x)}}),S.prototype._destroy=function(x,I){this.push(null),this.end(),h.nextTick(I,x)},h0}var s0,ms;function gs(){if(ms)return s0;ms=1;var h=Hn;s0=$;var n=F1,u;$.ReadableState=z,Ne.EventEmitter;var s=function(R,P){return R.listeners(P).length},m=us,f=i0.Buffer,g=(typeof Ft!="undefined"?Ft:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function y(R){return f.from(R)}function S(R){return f.isBuffer(R)||R instanceof g}var B=Object.create(Me);B.inherits=Kt;var M=Ne,x=void 0;M&&M.debuglog?x=M.debuglog("stream"):x=function(){};var I=Y1(),k=ds,D;B.inherits($,m);var L=["error","close","destroy","pause","resume"];function W(R,P,N){if(typeof R.prependListener=="function")return R.prependListener(P,N);!R._events||!R._events[P]?R.on(P,N):n(R._events[P])?R._events[P].unshift(N):R._events[P]=[N,R._events[P]]}function z(R,P){u=u||gi(),R=R||{};var N=P instanceof u;this.objectMode=!!R.objectMode,N&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var K=R.highWaterMark,kt=R.readableHighWaterMark,Z=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:N&&(kt||kt===0)?this.highWaterMark=kt:this.highWaterMark=Z,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(D||(D=wn.StringDecoder),this.decoder=new D(R.encoding),this.encoding=R.encoding)}function $(R){if(u=u||gi(),!(this instanceof $))return new $(R);this._readableState=new z(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),m.call(this)}Object.defineProperty($.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),$.prototype.destroy=k.destroy,$.prototype._undestroy=k.undestroy,$.prototype._destroy=function(R,P){this.push(null),P(R)},$.prototype.push=function(R,P){var N=this._readableState,K;return N.objectMode?K=!0:typeof R=="string"&&(P=P||N.defaultEncoding,P!==N.encoding&&(R=f.from(R,P),P=""),K=!0),lt(this,R,P,!1,K)},$.prototype.unshift=function(R){return lt(this,R,null,!0,!1)};function lt(R,P,N,K,kt){var Z=R._readableState;if(P===null)Z.reading=!1,It(R,Z);else{var J;kt||(J=At(Z,P)),J?R.emit("error",J):Z.objectMode||P&&P.length>0?(typeof P!="string"&&!Z.objectMode&&Object.getPrototypeOf(P)!==f.prototype&&(P=y(P)),K?Z.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):H(R,Z,P,!0):Z.ended?R.emit("error",new Error("stream.push() after EOF")):(Z.reading=!1,Z.decoder&&!N?(P=Z.decoder.write(P),Z.objectMode||P.length!==0?H(R,Z,P,!1):r(R,Z)):H(R,Z,P,!1))):K||(Z.reading=!1)}return Bt(Z)}function H(R,P,N,K){P.flowing&&P.length===0&&!P.sync?(R.emit("data",N),R.read(0)):(P.length+=P.objectMode?1:N.length,K?P.buffer.unshift(N):P.buffer.push(N),P.needReadable&&p(R)),r(R,P)}function At(R,P){var N;return!S(P)&&typeof P!="string"&&P!==void 0&&!R.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}function Bt(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(R){return D||(D=wn.StringDecoder),this._readableState.decoder=new D(R),this._readableState.encoding=R,this};var Ct=8388608;function Et(R){return R>=Ct?R=Ct:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function Y(R,P){return R<=0||P.length===0&&P.ended?0:P.objectMode?1:R!==R?P.flowing&&P.length?P.buffer.head.data.length:P.length:(R>P.highWaterMark&&(P.highWaterMark=Et(R)),R<=P.length?R:P.ended?P.length:(P.needReadable=!0,0))}$.prototype.read=function(R){x("read",R),R=parseInt(R,10);var P=this._readableState,N=R;if(R!==0&&(P.emittedReadable=!1),R===0&&P.needReadable&&(P.length>=P.highWaterMark||P.ended))return x("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?C(this):p(this),null;if(R=Y(R,P),R===0&&P.ended)return P.length===0&&C(this),null;var K=P.needReadable;x("need readable",K),(P.length===0||P.length-R<P.highWaterMark)&&(K=!0,x("length less than watermark",K)),P.ended||P.reading?(K=!1,x("reading or ended",K)):K&&(x("do read"),P.reading=!0,P.sync=!0,P.length===0&&(P.needReadable=!0),this._read(P.highWaterMark),P.sync=!1,P.reading||(R=Y(N,P)));var kt;return R>0?kt=e(R,P):kt=null,kt===null?(P.needReadable=!0,R=0):P.length-=R,P.length===0&&(P.ended||(P.needReadable=!0),N!==R&&P.ended&&C(this)),kt!==null&&this.emit("data",kt),kt};function It(R,P){if(!P.ended){if(P.decoder){var N=P.decoder.end();N&&N.length&&(P.buffer.push(N),P.length+=P.objectMode?1:N.length)}P.ended=!0,p(R)}}function p(R){var P=R._readableState;P.needReadable=!1,P.emittedReadable||(x("emitReadable",P.flowing),P.emittedReadable=!0,P.sync?h.nextTick(t,R):t(R))}function t(R){x("emit readable"),R.emit("readable"),o(R)}function r(R,P){P.readingMore||(P.readingMore=!0,h.nextTick(i,R,P))}function i(R,P){for(var N=P.length;!P.reading&&!P.flowing&&!P.ended&&P.length<P.highWaterMark&&(x("maybeReadMore read 0"),R.read(0),N!==P.length);)N=P.length;P.readingMore=!1}$.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},$.prototype.pipe=function(R,P){var N=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=R;break;case 1:K.pipes=[K.pipes,R];break;default:K.pipes.push(R);break}K.pipesCount+=1,x("pipe count=%d opts=%j",K.pipesCount,P);var kt=(!P||P.end!==!1)&&R!==ye.stdout&&R!==ye.stderr,Z=kt?qt:Pt;K.endEmitted?h.nextTick(Z):N.once("end",Z),R.on("unpipe",J);function J(Q,ct){x("onunpipe"),Q===N&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Nt())}function qt(){x("onend"),R.end()}var tt=a(N);R.on("drain",tt);var vt=!1;function Nt(){x("cleanup"),R.removeListener("close",j),R.removeListener("finish",dt),R.removeListener("drain",tt),R.removeListener("error",Dt),R.removeListener("unpipe",J),N.removeListener("end",qt),N.removeListener("end",Pt),N.removeListener("data",pt),vt=!0,K.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&tt()}var et=!1;N.on("data",pt);function pt(Q){x("ondata"),et=!1;var ct=R.write(Q);ct===!1&&!et&&((K.pipesCount===1&&K.pipes===R||K.pipesCount>1&&O(K.pipes,R)!==-1)&&!vt&&(x("false write response, pause",K.awaitDrain),K.awaitDrain++,et=!0),N.pause())}function Dt(Q){x("onerror",Q),Pt(),R.removeListener("error",Dt),s(R,"error")===0&&R.emit("error",Q)}W(R,"error",Dt);function j(){R.removeListener("finish",dt),Pt()}R.once("close",j);function dt(){x("onfinish"),R.removeListener("close",j),Pt()}R.once("finish",dt);function Pt(){x("unpipe"),N.unpipe(R)}return R.emit("pipe",N),K.flowing||(x("pipe resume"),N.resume()),R};function a(R){return function(){var P=R._readableState;x("pipeOnDrain",P.awaitDrain),P.awaitDrain&&P.awaitDrain--,P.awaitDrain===0&&s(R,"data")&&(P.flowing=!0,o(R))}}$.prototype.unpipe=function(R){var P=this._readableState,N={hasUnpiped:!1};if(P.pipesCount===0)return this;if(P.pipesCount===1)return R&&R!==P.pipes?this:(R||(R=P.pipes),P.pipes=null,P.pipesCount=0,P.flowing=!1,R&&R.emit("unpipe",this,N),this);if(!R){var K=P.pipes,kt=P.pipesCount;P.pipes=null,P.pipesCount=0,P.flowing=!1;for(var Z=0;Z<kt;Z++)K[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var J=O(P.pipes,R);return J===-1?this:(P.pipes.splice(J,1),P.pipesCount-=1,P.pipesCount===1&&(P.pipes=P.pipes[0]),R.emit("unpipe",this,N),this)},$.prototype.on=function(R,P){var N=m.prototype.on.call(this,R,P);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var K=this._readableState;!K.endEmitted&&!K.readableListening&&(K.readableListening=K.needReadable=!0,K.emittedReadable=!1,K.reading?K.length&&p(this):h.nextTick(d,this))}return N},$.prototype.addListener=$.prototype.on;function d(R){x("readable nexttick read 0"),R.read(0)}$.prototype.resume=function(){var R=this._readableState;return R.flowing||(x("resume"),R.flowing=!0,c(this,R)),this};function c(R,P){P.resumeScheduled||(P.resumeScheduled=!0,h.nextTick(v,R,P))}function v(R,P){P.reading||(x("resume read 0"),R.read(0)),P.resumeScheduled=!1,P.awaitDrain=0,R.emit("resume"),o(R),P.flowing&&!P.reading&&R.read(0)}$.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function o(R){var P=R._readableState;for(x("flow",P.flowing);P.flowing&&R.read()!==null;);}$.prototype.wrap=function(R){var P=this,N=this._readableState,K=!1;R.on("end",function(){if(x("wrapped end"),N.decoder&&!N.ended){var J=N.decoder.end();J&&J.length&&P.push(J)}P.push(null)}),R.on("data",function(J){if(x("wrapped data"),N.decoder&&(J=N.decoder.write(J)),!(N.objectMode&&J==null)&&!(!N.objectMode&&(!J||!J.length))){var qt=P.push(J);qt||(K=!0,R.pause())}});for(var kt in R)this[kt]===void 0&&typeof R[kt]=="function"&&(this[kt]=function(J){return function(){return R[J].apply(R,arguments)}}(kt));for(var Z=0;Z<L.length;Z++)R.on(L[Z],this.emit.bind(this,L[Z]));return this._read=function(J){x("wrapped _read",J),K&&(K=!1,R.resume())},this},Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),$._fromList=e;function e(R,P){if(P.length===0)return null;var N;return P.objectMode?N=P.buffer.shift():!R||R>=P.length?(P.decoder?N=P.buffer.join(""):P.buffer.length===1?N=P.buffer.head.data:N=P.buffer.concat(P.length),P.buffer.clear()):N=l(R,P.buffer,P.decoder),N}function l(R,P,N){var K;return R<P.head.data.length?(K=P.head.data.slice(0,R),P.head.data=P.head.data.slice(R)):R===P.head.data.length?K=P.shift():K=N?b(R,P):_(R,P),K}function b(R,P){var N=P.head,K=1,kt=N.data;for(R-=kt.length;N=N.next;){var Z=N.data,J=R>Z.length?Z.length:R;if(J===Z.length?kt+=Z:kt+=Z.slice(0,R),R-=J,R===0){J===Z.length?(++K,N.next?P.head=N.next:P.head=P.tail=null):(P.head=N,N.data=Z.slice(J));break}++K}return P.length-=K,kt}function _(R,P){var N=f.allocUnsafe(R),K=P.head,kt=1;for(K.data.copy(N),R-=K.data.length;K=K.next;){var Z=K.data,J=R>Z.length?Z.length:R;if(Z.copy(N,N.length-R,0,J),R-=J,R===0){J===Z.length?(++kt,K.next?P.head=K.next:P.head=P.tail=null):(P.head=K,K.data=Z.slice(J));break}++kt}return P.length-=kt,N}function C(R){var P=R._readableState;if(P.length>0)throw new Error('"endReadable()" called on non-empty stream');P.endEmitted||(P.ended=!0,h.nextTick(q,P,R))}function q(R,P){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,P.readable=!1,P.emit("end"))}function O(R,P){for(var N=0,K=R.length;N<K;N++)if(R[N]===P)return N;return-1}return s0}var bs=kr,Yn=gi(),ys=Object.create(Me);ys.inherits=Kt,ys.inherits(kr,Yn);function Q1(h,n){var u=this._transformState;u.transforming=!1;var s=u.writecb;if(!s)return this.emit("error",new Error("write callback called multiple times"));u.writechunk=null,u.writecb=null,n!=null&&this.push(n),s(h);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function kr(h){if(!(this instanceof kr))return new kr(h);Yn.call(this,h),this._transformState={afterTransform:Q1.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",tv)}function tv(){var h=this;typeof this._flush=="function"?this._flush(function(n,u){ws(h,n,u)}):ws(this,null,null)}kr.prototype.push=function(h,n){return this._transformState.needTransform=!1,Yn.prototype.push.call(this,h,n)},kr.prototype._transform=function(h,n,u){throw new Error("_transform() is not implemented")},kr.prototype._write=function(h,n,u){var s=this._transformState;if(s.writecb=u,s.writechunk=h,s.writeencoding=n,!s.transforming){var m=this._readableState;(s.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},kr.prototype._read=function(h){var n=this._transformState;n.writechunk!==null&&n.writecb&&!n.transforming?(n.transforming=!0,this._transform(n.writechunk,n.writeencoding,n.afterTransform)):n.needTransform=!0},kr.prototype._destroy=function(h,n){var u=this;Yn.prototype._destroy.call(this,h,function(s){n(s),u.emit("close")})};function ws(h,n,u){if(n)return h.emit("error",n);if(u!=null&&h.push(u),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}var ev=tn,Ms=bs,xs=Object.create(Me);xs.inherits=Kt,xs.inherits(tn,Ms);function tn(h){if(!(this instanceof tn))return new tn(h);Ms.call(this,h)}tn.prototype._transform=function(h,n,u){u(null,h)},function(h,n){n=h.exports=gs(),n.Stream=n,n.Readable=n,n.Writable=vs(),n.Duplex=gi(),n.Transform=bs,n.PassThrough=ev}(t0,t0.exports);var rv=t0.exports,en={exports:{}},o0={exports:{}};o0.exports,function(h){(function(n,u){function s(r,i){if(!r)throw new Error(i||"Assertion failed")}function m(r,i){r.super_=i;var a=function(){};a.prototype=i.prototype,r.prototype=new a,r.prototype.constructor=r}function f(r,i,a){if(f.isBN(r))return r;this.negative=0,this.words=null,this.length=0,this.red=null,r!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(r||0,i||10,a||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(r){}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,a){return i.cmp(a)>0?i:a},f.min=function(i,a){return i.cmp(a)<0?i:a},f.prototype._init=function(i,a,d){if(typeof i=="number")return this._initNumber(i,a,d);if(typeof i=="object")return this._initArray(i,a,d);a==="hex"&&(a=16),s(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c<i.length&&(a===16?this._parseHex(i,c,d):(this._parseBase(i,a,c),d==="le"&&this._initArray(this.toArray(),a,d)))},f.prototype._initNumber=function(i,a,d){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(s(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),a,d)},f.prototype._initArray=function(i,a,d){if(s(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v,o,e=0;if(d==="be")for(c=i.length-1,v=0;c>=0;c-=3)o=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[v]|=o<<e&67108863,this.words[v+1]=o>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);else if(d==="le")for(c=0,v=0;c<i.length;c+=3)o=i[c]|i[c+1]<<8|i[c+2]<<16,this.words[v]|=o<<e&67108863,this.words[v+1]=o>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);return this._strip()};function y(r,i){var a=r.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;s(!1,"Invalid character in "+r)}function S(r,i,a){var d=y(r,a);return a-1>=i&&(d|=y(r,a-1)<<4),d}f.prototype._parseHex=function(i,a,d){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v=0,o=0,e;if(d==="be")for(c=i.length-1;c>=a;c-=2)e=S(i,a,c)<<v,this.words[o]|=e&67108863,v>=18?(v-=18,o+=1,this.words[o]|=e>>>26):v+=8;else{var l=i.length-a;for(c=l%2===0?a+1:a;c<i.length;c+=2)e=S(i,a,c)<<v,this.words[o]|=e&67108863,v>=18?(v-=18,o+=1,this.words[o]|=e>>>26):v+=8}this._strip()};function B(r,i,a,d){for(var c=0,v=0,o=Math.min(r.length,a),e=i;e<o;e++){var l=r.charCodeAt(e)-48;c*=d,l>=49?v=l-49+10:l>=17?v=l-17+10:v=l,s(l>=0&&v<d,"Invalid character"),c+=v}return c}f.prototype._parseBase=function(i,a,d){this.words=[0],this.length=1;for(var c=0,v=1;v<=67108863;v*=a)c++;c--,v=v/a|0;for(var o=i.length-d,e=o%c,l=Math.min(o,o-e)+d,b=0,_=d;_<l;_+=c)b=B(i,_,_+c,a),this.imuln(v),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(e!==0){var C=1;for(b=B(i,_,i.length,a),_=0;_<e;_++)C*=a;this.imuln(C),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var a=0;a<this.length;a++)i.words[a]=this.words[a];i.length=this.length,i.negative=this.negative,i.red=this.red};function M(r,i){r.words=i.words,r.length=i.length,r.negative=i.negative,r.red=i.red}if(f.prototype._move=function(i){M(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch(r){f.prototype.inspect=x}else f.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","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"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(i,a){i=i||10,a=a|0||1;var d;if(i===16||i==="hex"){d="";for(var c=0,v=0,o=0;o<this.length;o++){var e=this.words[o],l=((e<<c|v)&16777215).toString(16);v=e>>>24-c&16777215,c+=2,c>=26&&(c-=26,o--),v!==0||o!==this.length-1?d=I[6-l.length]+l+d:d=l+d}for(v!==0&&(d=v.toString(16)+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(i===(i|0)&&i>=2&&i<=36){var b=k[i],_=D[i];d="";var C=this.clone();for(C.negative=0;!C.isZero();){var q=C.modrn(_).toString(i);C=C.idivn(_),C.isZero()?d=q+d:d=I[b-q.length]+q+d}for(this.isZero()&&(d="0"+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},g&&(f.prototype.toBuffer=function(i,a){return this.toArrayLike(g,i,a)}),f.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var L=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};f.prototype.toArrayLike=function(i,a,d){this._strip();var c=this.byteLength(),v=d||Math.max(1,c);s(c<=v,"byte array longer than desired length"),s(v>0,"Requested array length <= 0");var o=L(i,v),e=a==="le"?"LE":"BE";return this["_toArrayLike"+e](o,c),o},f.prototype._toArrayLikeLE=function(i,a){for(var d=0,c=0,v=0,o=0;v<this.length;v++){var e=this.words[v]<<o|c;i[d++]=e&255,d<i.length&&(i[d++]=e>>8&255),d<i.length&&(i[d++]=e>>16&255),o===6?(d<i.length&&(i[d++]=e>>24&255),c=0,o=0):(c=e>>>24,o+=2)}if(d<i.length)for(i[d++]=c;d<i.length;)i[d++]=0},f.prototype._toArrayLikeBE=function(i,a){for(var d=i.length-1,c=0,v=0,o=0;v<this.length;v++){var e=this.words[v]<<o|c;i[d--]=e&255,d>=0&&(i[d--]=e>>8&255),d>=0&&(i[d--]=e>>16&255),o===6?(d>=0&&(i[d--]=e>>24&255),c=0,o=0):(c=e>>>24,o+=2)}if(d>=0)for(i[d--]=c;d>=0;)i[d--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var a=i,d=0;return a>=4096&&(d+=13,a>>>=13),a>=64&&(d+=7,a>>>=7),a>=8&&(d+=4,a>>>=4),a>=2&&(d+=2,a>>>=2),d+a},f.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,d=0;return a&8191||(d+=13,a>>>=13),a&127||(d+=7,a>>>=7),a&15||(d+=4,a>>>=4),a&3||(d+=2,a>>>=2),a&1||d++,d},f.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function W(r){for(var i=new Array(r.bitLength()),a=0;a<i.length;a++){var d=a/26|0,c=a%26;i[a]=r.words[d]>>>c&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;a<this.length;a++){var d=this._zeroBits(this.words[a]);if(i+=d,d!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var a=0;a<i.length;a++)this.words[a]=this.words[a]|i.words[a];return this._strip()},f.prototype.ior=function(i){return s((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]&i.words[d];return this.length=a.length,this._strip()},f.prototype.iand=function(i){return s((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var a,d;this.length>i.length?(a=this,d=i):(a=i,d=this);for(var c=0;c<d.length;c++)this.words[c]=a.words[c]^d.words[c];if(this!==a)for(;c<a.length;c++)this.words[c]=a.words[c];return this.length=a.length,this._strip()},f.prototype.ixor=function(i){return s((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){s(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,d=i%26;this._expand(a),d>0&&a--;for(var c=0;c<a;c++)this.words[c]=~this.words[c]&67108863;return d>0&&(this.words[c]=~this.words[c]&67108863>>26-d),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,a){s(typeof i=="number"&&i>=0);var d=i/26|0,c=i%26;return this._expand(d+1),a?this.words[d]=this.words[d]|1<<c:this.words[d]=this.words[d]&~(1<<c),this._strip()},f.prototype.iadd=function(i){var a;if(this.negative!==0&&i.negative===0)return this.negative=0,a=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,a=this.isub(i),i.negative=1,a._normSign();var d,c;this.length>i.length?(d=this,c=i):(d=i,c=this);for(var v=0,o=0;o<c.length;o++)a=(d.words[o]|0)+(c.words[o]|0)+v,this.words[o]=a&67108863,v=a>>>26;for(;v!==0&&o<d.length;o++)a=(d.words[o]|0)+v,this.words[o]=a&67108863,v=a>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;o<d.length;o++)this.words[o]=d.words[o];return this},f.prototype.add=function(i){var a;return i.negative!==0&&this.negative===0?(i.negative=0,a=this.sub(i),i.negative^=1,a):i.negative===0&&this.negative!==0?(this.negative=0,a=i.sub(this),this.negative=1,a):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var d=this.cmp(i);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,v;d>0?(c=this,v=i):(c=i,v=this);for(var o=0,e=0;e<v.length;e++)a=(c.words[e]|0)-(v.words[e]|0)+o,o=a>>26,this.words[e]=a&67108863;for(;o!==0&&e<c.length;e++)a=(c.words[e]|0)+o,o=a>>26,this.words[e]=a&67108863;if(o===0&&e<c.length&&c!==this)for(;e<c.length;e++)this.words[e]=c.words[e];return this.length=Math.max(this.length,e),c!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function z(r,i,a){a.negative=i.negative^r.negative;var d=r.length+i.length|0;a.length=d,d=d-1|0;var c=r.words[0]|0,v=i.words[0]|0,o=c*v,e=o&67108863,l=o/67108864|0;a.words[0]=e;for(var b=1;b<d;b++){for(var _=l>>>26,C=l&67108863,q=Math.min(b,i.length-1),O=Math.max(0,b-r.length+1);O<=q;O++){var R=b-O|0;c=r.words[R]|0,v=i.words[O]|0,o=c*v+C,_+=o/67108864|0,C=o&67108863}a.words[b]=C|0,l=_|0}return l!==0?a.words[b]=l|0:a.length--,a._strip()}var $=function(i,a,d){var c=i.words,v=a.words,o=d.words,e=0,l,b,_,C=c[0]|0,q=C&8191,O=C>>>13,R=c[1]|0,P=R&8191,N=R>>>13,K=c[2]|0,kt=K&8191,Z=K>>>13,J=c[3]|0,qt=J&8191,tt=J>>>13,vt=c[4]|0,Nt=vt&8191,et=vt>>>13,pt=c[5]|0,Dt=pt&8191,j=pt>>>13,dt=c[6]|0,Pt=dt&8191,Q=dt>>>13,ct=c[7]|0,Ot=ct&8191,E=ct>>>13,w=c[8]|0,A=w&8191,T=w>>>13,F=c[9]|0,V=F&8191,U=F>>>13,X=v[0]|0,Tt=X&8191,G=X>>>13,rt=v[1]|0,Rt=rt&8191,it=rt>>>13,gt=v[2]|0,Ht=gt&8191,nt=gt>>>13,bt=v[3]|0,Zt=bt&8191,ft=bt>>>13,yt=v[4]|0,Wt=yt&8191,at=yt>>>13,wt=v[5]|0,Vt=wt&8191,ht=wt>>>13,Mt=v[6]|0,Yt=Mt&8191,st=Mt>>>13,xt=v[7]|0,Jt=xt&8191,ot=xt>>>13,_t=v[8]|0,Gt=_t&8191,ut=_t>>>13,St=v[9]|0,$t=St&8191,Ut=St>>>13;d.negative=i.negative^a.negative,d.length=19,l=Math.imul(q,Tt),b=Math.imul(q,G),b=b+Math.imul(O,Tt)|0,_=Math.imul(O,G);var jt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul(P,Tt),b=Math.imul(P,G),b=b+Math.imul(N,Tt)|0,_=Math.imul(N,G),l=l+Math.imul(q,Rt)|0,b=b+Math.imul(q,it)|0,b=b+Math.imul(O,Rt)|0,_=_+Math.imul(O,it)|0;var Qt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(kt,Tt),b=Math.imul(kt,G),b=b+Math.imul(Z,Tt)|0,_=Math.imul(Z,G),l=l+Math.imul(P,Rt)|0,b=b+Math.imul(P,it)|0,b=b+Math.imul(N,Rt)|0,_=_+Math.imul(N,it)|0,l=l+Math.imul(q,Ht)|0,b=b+Math.imul(q,nt)|0,b=b+Math.imul(O,Ht)|0,_=_+Math.imul(O,nt)|0;var te=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(qt,Tt),b=Math.imul(qt,G),b=b+Math.imul(tt,Tt)|0,_=Math.imul(tt,G),l=l+Math.imul(kt,Rt)|0,b=b+Math.imul(kt,it)|0,b=b+Math.imul(Z,Rt)|0,_=_+Math.imul(Z,it)|0,l=l+Math.imul(P,Ht)|0,b=b+Math.imul(P,nt)|0,b=b+Math.imul(N,Ht)|0,_=_+Math.imul(N,nt)|0,l=l+Math.imul(q,Zt)|0,b=b+Math.imul(q,ft)|0,b=b+Math.imul(O,Zt)|0,_=_+Math.imul(O,ft)|0;var ee=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(Nt,Tt),b=Math.imul(Nt,G),b=b+Math.imul(et,Tt)|0,_=Math.imul(et,G),l=l+Math.imul(qt,Rt)|0,b=b+Math.imul(qt,it)|0,b=b+Math.imul(tt,Rt)|0,_=_+Math.imul(tt,it)|0,l=l+Math.imul(kt,Ht)|0,b=b+Math.imul(kt,nt)|0,b=b+Math.imul(Z,Ht)|0,_=_+Math.imul(Z,nt)|0,l=l+Math.imul(P,Zt)|0,b=b+Math.imul(P,ft)|0,b=b+Math.imul(N,Zt)|0,_=_+Math.imul(N,ft)|0,l=l+Math.imul(q,Wt)|0,b=b+Math.imul(q,at)|0,b=b+Math.imul(O,Wt)|0,_=_+Math.imul(O,at)|0;var re=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(Dt,Tt),b=Math.imul(Dt,G),b=b+Math.imul(j,Tt)|0,_=Math.imul(j,G),l=l+Math.imul(Nt,Rt)|0,b=b+Math.imul(Nt,it)|0,b=b+Math.imul(et,Rt)|0,_=_+Math.imul(et,it)|0,l=l+Math.imul(qt,Ht)|0,b=b+Math.imul(qt,nt)|0,b=b+Math.imul(tt,Ht)|0,_=_+Math.imul(tt,nt)|0,l=l+Math.imul(kt,Zt)|0,b=b+Math.imul(kt,ft)|0,b=b+Math.imul(Z,Zt)|0,_=_+Math.imul(Z,ft)|0,l=l+Math.imul(P,Wt)|0,b=b+Math.imul(P,at)|0,b=b+Math.imul(N,Wt)|0,_=_+Math.imul(N,at)|0,l=l+Math.imul(q,Vt)|0,b=b+Math.imul(q,ht)|0,b=b+Math.imul(O,Vt)|0,_=_+Math.imul(O,ht)|0;var ie=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(Pt,Tt),b=Math.imul(Pt,G),b=b+Math.imul(Q,Tt)|0,_=Math.imul(Q,G),l=l+Math.imul(Dt,Rt)|0,b=b+Math.imul(Dt,it)|0,b=b+Math.imul(j,Rt)|0,_=_+Math.imul(j,it)|0,l=l+Math.imul(Nt,Ht)|0,b=b+Math.imul(Nt,nt)|0,b=b+Math.imul(et,Ht)|0,_=_+Math.imul(et,nt)|0,l=l+Math.imul(qt,Zt)|0,b=b+Math.imul(qt,ft)|0,b=b+Math.imul(tt,Zt)|0,_=_+Math.imul(tt,ft)|0,l=l+Math.imul(kt,Wt)|0,b=b+Math.imul(kt,at)|0,b=b+Math.imul(Z,Wt)|0,_=_+Math.imul(Z,at)|0,l=l+Math.imul(P,Vt)|0,b=b+Math.imul(P,ht)|0,b=b+Math.imul(N,Vt)|0,_=_+Math.imul(N,ht)|0,l=l+Math.imul(q,Yt)|0,b=b+Math.imul(q,st)|0,b=b+Math.imul(O,Yt)|0,_=_+Math.imul(O,st)|0;var ne=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(Ot,Tt),b=Math.imul(Ot,G),b=b+Math.imul(E,Tt)|0,_=Math.imul(E,G),l=l+Math.imul(Pt,Rt)|0,b=b+Math.imul(Pt,it)|0,b=b+Math.imul(Q,Rt)|0,_=_+Math.imul(Q,it)|0,l=l+Math.imul(Dt,Ht)|0,b=b+Math.imul(Dt,nt)|0,b=b+Math.imul(j,Ht)|0,_=_+Math.imul(j,nt)|0,l=l+Math.imul(Nt,Zt)|0,b=b+Math.imul(Nt,ft)|0,b=b+Math.imul(et,Zt)|0,_=_+Math.imul(et,ft)|0,l=l+Math.imul(qt,Wt)|0,b=b+Math.imul(qt,at)|0,b=b+Math.imul(tt,Wt)|0,_=_+Math.imul(tt,at)|0,l=l+Math.imul(kt,Vt)|0,b=b+Math.imul(kt,ht)|0,b=b+Math.imul(Z,Vt)|0,_=_+Math.imul(Z,ht)|0,l=l+Math.imul(P,Yt)|0,b=b+Math.imul(P,st)|0,b=b+Math.imul(N,Yt)|0,_=_+Math.imul(N,st)|0,l=l+Math.imul(q,Jt)|0,b=b+Math.imul(q,ot)|0,b=b+Math.imul(O,Jt)|0,_=_+Math.imul(O,ot)|0;var fe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(A,Tt),b=Math.imul(A,G),b=b+Math.imul(T,Tt)|0,_=Math.imul(T,G),l=l+Math.imul(Ot,Rt)|0,b=b+Math.imul(Ot,it)|0,b=b+Math.imul(E,Rt)|0,_=_+Math.imul(E,it)|0,l=l+Math.imul(Pt,Ht)|0,b=b+Math.imul(Pt,nt)|0,b=b+Math.imul(Q,Ht)|0,_=_+Math.imul(Q,nt)|0,l=l+Math.imul(Dt,Zt)|0,b=b+Math.imul(Dt,ft)|0,b=b+Math.imul(j,Zt)|0,_=_+Math.imul(j,ft)|0,l=l+Math.imul(Nt,Wt)|0,b=b+Math.imul(Nt,at)|0,b=b+Math.imul(et,Wt)|0,_=_+Math.imul(et,at)|0,l=l+Math.imul(qt,Vt)|0,b=b+Math.imul(qt,ht)|0,b=b+Math.imul(tt,Vt)|0,_=_+Math.imul(tt,ht)|0,l=l+Math.imul(kt,Yt)|0,b=b+Math.imul(kt,st)|0,b=b+Math.imul(Z,Yt)|0,_=_+Math.imul(Z,st)|0,l=l+Math.imul(P,Jt)|0,b=b+Math.imul(P,ot)|0,b=b+Math.imul(N,Jt)|0,_=_+Math.imul(N,ot)|0,l=l+Math.imul(q,Gt)|0,b=b+Math.imul(q,ut)|0,b=b+Math.imul(O,Gt)|0,_=_+Math.imul(O,ut)|0;var ae=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(V,Tt),b=Math.imul(V,G),b=b+Math.imul(U,Tt)|0,_=Math.imul(U,G),l=l+Math.imul(A,Rt)|0,b=b+Math.imul(A,it)|0,b=b+Math.imul(T,Rt)|0,_=_+Math.imul(T,it)|0,l=l+Math.imul(Ot,Ht)|0,b=b+Math.imul(Ot,nt)|0,b=b+Math.imul(E,Ht)|0,_=_+Math.imul(E,nt)|0,l=l+Math.imul(Pt,Zt)|0,b=b+Math.imul(Pt,ft)|0,b=b+Math.imul(Q,Zt)|0,_=_+Math.imul(Q,ft)|0,l=l+Math.imul(Dt,Wt)|0,b=b+Math.imul(Dt,at)|0,b=b+Math.imul(j,Wt)|0,_=_+Math.imul(j,at)|0,l=l+Math.imul(Nt,Vt)|0,b=b+Math.imul(Nt,ht)|0,b=b+Math.imul(et,Vt)|0,_=_+Math.imul(et,ht)|0,l=l+Math.imul(qt,Yt)|0,b=b+Math.imul(qt,st)|0,b=b+Math.imul(tt,Yt)|0,_=_+Math.imul(tt,st)|0,l=l+Math.imul(kt,Jt)|0,b=b+Math.imul(kt,ot)|0,b=b+Math.imul(Z,Jt)|0,_=_+Math.imul(Z,ot)|0,l=l+Math.imul(P,Gt)|0,b=b+Math.imul(P,ut)|0,b=b+Math.imul(N,Gt)|0,_=_+Math.imul(N,ut)|0,l=l+Math.imul(q,$t)|0,b=b+Math.imul(q,Ut)|0,b=b+Math.imul(O,$t)|0,_=_+Math.imul(O,Ut)|0;var he=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(he>>>26)|0,he&=67108863,l=Math.imul(V,Rt),b=Math.imul(V,it),b=b+Math.imul(U,Rt)|0,_=Math.imul(U,it),l=l+Math.imul(A,Ht)|0,b=b+Math.imul(A,nt)|0,b=b+Math.imul(T,Ht)|0,_=_+Math.imul(T,nt)|0,l=l+Math.imul(Ot,Zt)|0,b=b+Math.imul(Ot,ft)|0,b=b+Math.imul(E,Zt)|0,_=_+Math.imul(E,ft)|0,l=l+Math.imul(Pt,Wt)|0,b=b+Math.imul(Pt,at)|0,b=b+Math.imul(Q,Wt)|0,_=_+Math.imul(Q,at)|0,l=l+Math.imul(Dt,Vt)|0,b=b+Math.imul(Dt,ht)|0,b=b+Math.imul(j,Vt)|0,_=_+Math.imul(j,ht)|0,l=l+Math.imul(Nt,Yt)|0,b=b+Math.imul(Nt,st)|0,b=b+Math.imul(et,Yt)|0,_=_+Math.imul(et,st)|0,l=l+Math.imul(qt,Jt)|0,b=b+Math.imul(qt,ot)|0,b=b+Math.imul(tt,Jt)|0,_=_+Math.imul(tt,ot)|0,l=l+Math.imul(kt,Gt)|0,b=b+Math.imul(kt,ut)|0,b=b+Math.imul(Z,Gt)|0,_=_+Math.imul(Z,ut)|0,l=l+Math.imul(P,$t)|0,b=b+Math.imul(P,Ut)|0,b=b+Math.imul(N,$t)|0,_=_+Math.imul(N,Ut)|0;var se=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(se>>>26)|0,se&=67108863,l=Math.imul(V,Ht),b=Math.imul(V,nt),b=b+Math.imul(U,Ht)|0,_=Math.imul(U,nt),l=l+Math.imul(A,Zt)|0,b=b+Math.imul(A,ft)|0,b=b+Math.imul(T,Zt)|0,_=_+Math.imul(T,ft)|0,l=l+Math.imul(Ot,Wt)|0,b=b+Math.imul(Ot,at)|0,b=b+Math.imul(E,Wt)|0,_=_+Math.imul(E,at)|0,l=l+Math.imul(Pt,Vt)|0,b=b+Math.imul(Pt,ht)|0,b=b+Math.imul(Q,Vt)|0,_=_+Math.imul(Q,ht)|0,l=l+Math.imul(Dt,Yt)|0,b=b+Math.imul(Dt,st)|0,b=b+Math.imul(j,Yt)|0,_=_+Math.imul(j,st)|0,l=l+Math.imul(Nt,Jt)|0,b=b+Math.imul(Nt,ot)|0,b=b+Math.imul(et,Jt)|0,_=_+Math.imul(et,ot)|0,l=l+Math.imul(qt,Gt)|0,b=b+Math.imul(qt,ut)|0,b=b+Math.imul(tt,Gt)|0,_=_+Math.imul(tt,ut)|0,l=l+Math.imul(kt,$t)|0,b=b+Math.imul(kt,Ut)|0,b=b+Math.imul(Z,$t)|0,_=_+Math.imul(Z,Ut)|0;var oe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(V,Zt),b=Math.imul(V,ft),b=b+Math.imul(U,Zt)|0,_=Math.imul(U,ft),l=l+Math.imul(A,Wt)|0,b=b+Math.imul(A,at)|0,b=b+Math.imul(T,Wt)|0,_=_+Math.imul(T,at)|0,l=l+Math.imul(Ot,Vt)|0,b=b+Math.imul(Ot,ht)|0,b=b+Math.imul(E,Vt)|0,_=_+Math.imul(E,ht)|0,l=l+Math.imul(Pt,Yt)|0,b=b+Math.imul(Pt,st)|0,b=b+Math.imul(Q,Yt)|0,_=_+Math.imul(Q,st)|0,l=l+Math.imul(Dt,Jt)|0,b=b+Math.imul(Dt,ot)|0,b=b+Math.imul(j,Jt)|0,_=_+Math.imul(j,ot)|0,l=l+Math.imul(Nt,Gt)|0,b=b+Math.imul(Nt,ut)|0,b=b+Math.imul(et,Gt)|0,_=_+Math.imul(et,ut)|0,l=l+Math.imul(qt,$t)|0,b=b+Math.imul(qt,Ut)|0,b=b+Math.imul(tt,$t)|0,_=_+Math.imul(tt,Ut)|0;var ue=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ue>>>26)|0,ue&=67108863,l=Math.imul(V,Wt),b=Math.imul(V,at),b=b+Math.imul(U,Wt)|0,_=Math.imul(U,at),l=l+Math.imul(A,Vt)|0,b=b+Math.imul(A,ht)|0,b=b+Math.imul(T,Vt)|0,_=_+Math.imul(T,ht)|0,l=l+Math.imul(Ot,Yt)|0,b=b+Math.imul(Ot,st)|0,b=b+Math.imul(E,Yt)|0,_=_+Math.imul(E,st)|0,l=l+Math.imul(Pt,Jt)|0,b=b+Math.imul(Pt,ot)|0,b=b+Math.imul(Q,Jt)|0,_=_+Math.imul(Q,ot)|0,l=l+Math.imul(Dt,Gt)|0,b=b+Math.imul(Dt,ut)|0,b=b+Math.imul(j,Gt)|0,_=_+Math.imul(j,ut)|0,l=l+Math.imul(Nt,$t)|0,b=b+Math.imul(Nt,Ut)|0,b=b+Math.imul(et,$t)|0,_=_+Math.imul(et,Ut)|0;var le=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(V,Vt),b=Math.imul(V,ht),b=b+Math.imul(U,Vt)|0,_=Math.imul(U,ht),l=l+Math.imul(A,Yt)|0,b=b+Math.imul(A,st)|0,b=b+Math.imul(T,Yt)|0,_=_+Math.imul(T,st)|0,l=l+Math.imul(Ot,Jt)|0,b=b+Math.imul(Ot,ot)|0,b=b+Math.imul(E,Jt)|0,_=_+Math.imul(E,ot)|0,l=l+Math.imul(Pt,Gt)|0,b=b+Math.imul(Pt,ut)|0,b=b+Math.imul(Q,Gt)|0,_=_+Math.imul(Q,ut)|0,l=l+Math.imul(Dt,$t)|0,b=b+Math.imul(Dt,Ut)|0,b=b+Math.imul(j,$t)|0,_=_+Math.imul(j,Ut)|0;var de=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(de>>>26)|0,de&=67108863,l=Math.imul(V,Yt),b=Math.imul(V,st),b=b+Math.imul(U,Yt)|0,_=Math.imul(U,st),l=l+Math.imul(A,Jt)|0,b=b+Math.imul(A,ot)|0,b=b+Math.imul(T,Jt)|0,_=_+Math.imul(T,ot)|0,l=l+Math.imul(Ot,Gt)|0,b=b+Math.imul(Ot,ut)|0,b=b+Math.imul(E,Gt)|0,_=_+Math.imul(E,ut)|0,l=l+Math.imul(Pt,$t)|0,b=b+Math.imul(Pt,Ut)|0,b=b+Math.imul(Q,$t)|0,_=_+Math.imul(Q,Ut)|0;var ce=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,l=Math.imul(V,Jt),b=Math.imul(V,ot),b=b+Math.imul(U,Jt)|0,_=Math.imul(U,ot),l=l+Math.imul(A,Gt)|0,b=b+Math.imul(A,ut)|0,b=b+Math.imul(T,Gt)|0,_=_+Math.imul(T,ut)|0,l=l+Math.imul(Ot,$t)|0,b=b+Math.imul(Ot,Ut)|0,b=b+Math.imul(E,$t)|0,_=_+Math.imul(E,Ut)|0;var ve=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,l=Math.imul(V,Gt),b=Math.imul(V,ut),b=b+Math.imul(U,Gt)|0,_=Math.imul(U,ut),l=l+Math.imul(A,$t)|0,b=b+Math.imul(A,Ut)|0,b=b+Math.imul(T,$t)|0,_=_+Math.imul(T,Ut)|0;var ea=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ea>>>26)|0,ea&=67108863,l=Math.imul(V,$t),b=Math.imul(V,Ut),b=b+Math.imul(U,$t)|0,_=Math.imul(U,Ut);var ra=(e+l|0)+((b&8191)<<13)|0;return e=(_+(b>>>13)|0)+(ra>>>26)|0,ra&=67108863,o[0]=jt,o[1]=Qt,o[2]=te,o[3]=ee,o[4]=re,o[5]=ie,o[6]=ne,o[7]=fe,o[8]=ae,o[9]=he,o[10]=se,o[11]=oe,o[12]=ue,o[13]=le,o[14]=de,o[15]=ce,o[16]=ve,o[17]=ea,o[18]=ra,e!==0&&(o[19]=e,d.length++),d};Math.imul||($=z);function lt(r,i,a){a.negative=i.negative^r.negative,a.length=r.length+i.length;for(var d=0,c=0,v=0;v<a.length-1;v++){var o=c;c=0;for(var e=d&67108863,l=Math.min(v,i.length-1),b=Math.max(0,v-r.length+1);b<=l;b++){var _=v-b,C=r.words[_]|0,q=i.words[b]|0,O=C*q,R=O&67108863;o=o+(O/67108864|0)|0,R=R+e|0,e=R&67108863,o=o+(R>>>26)|0,c+=o>>>26,o&=67108863}a.words[v]=e,d=o,o=c}return d!==0?a.words[v]=d:a.length--,a._strip()}function H(r,i,a){return lt(r,i,a)}f.prototype.mulTo=function(i,a){var d,c=this.length+i.length;return this.length===10&&i.length===10?d=$(this,i,a):c<63?d=z(this,i,a):c<1024?d=lt(this,i,a):d=H(this,i,a),d},f.prototype.mul=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),this.mulTo(i,a)},f.prototype.mulf=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),H(this,i,a)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var a=i<0;a&&(i=-i),s(typeof i=="number"),s(i<67108864);for(var d=0,c=0;c<this.length;c++){var v=(this.words[c]|0)*i,o=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=o>>>26,this.words[c]=o&67108863}return d!==0&&(this.words[c]=d,this.length++),this.length=i===0?1:this.length,a?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var a=W(i);if(a.length===0)return new f(1);for(var d=this,c=0;c<a.length&&a[c]===0;c++,d=d.sqr());if(++c<a.length)for(var v=d.sqr();c<a.length;c++,v=v.sqr())a[c]!==0&&(d=d.mul(v));return d},f.prototype.iushln=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=67108863>>>26-a<<26-a,v;if(a!==0){var o=0;for(v=0;v<this.length;v++){var e=this.words[v]&c,l=(this.words[v]|0)-e<<a;this.words[v]=l|o,o=e>>>26-a}o&&(this.words[v]=o,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},f.prototype.ishln=function(i){return s(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,a,d){s(typeof i=="number"&&i>=0);var c;a?c=(a-a%26)/26:c=0;var v=i%26,o=Math.min((i-v)/26,this.length),e=67108863^67108863>>>v<<v,l=d;if(c-=o,c=Math.max(0,c),l){for(var b=0;b<o;b++)l.words[b]=this.words[b];l.length=o}if(o!==0)if(this.length>o)for(this.length-=o,b=0;b<this.length;b++)this.words[b]=this.words[b+o];else this.words[0]=0,this.length=1;var _=0;for(b=this.length-1;b>=0&&(_!==0||b>=c);b--){var C=this.words[b]|0;this.words[b]=_<<26-v|C>>>v,_=C&e}return l&&_!==0&&(l.words[l.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,a,d){return s(this.negative===0),this.iushrn(i,a,d)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return!1;var v=this.words[d];return!!(v&c)},f.prototype.imaskn=function(i){s(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(a!==0&&d++,this.length=Math.min(d,this.length),a!==0){var c=67108863^67108863>>>a<<a;this.words[this.length-1]&=c}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return s(typeof i=="number"),s(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var a=0;a<this.length&&this.words[a]>=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},f.prototype.isubn=function(i){if(s(typeof i=="number"),s(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a<this.length&&this.words[a]<0;a++)this.words[a]+=67108864,this.words[a+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,a,d){var c=i.length+d,v;this._expand(c);var o,e=0;for(v=0;v<i.length;v++){o=(this.words[v+d]|0)+e;var l=(i.words[v]|0)*a;o-=l&67108863,e=(o>>26)-(l/67108864|0),this.words[v+d]=o&67108863}for(;v<this.length-d;v++)o=(this.words[v+d]|0)+e,e=o>>26,this.words[v+d]=o&67108863;if(e===0)return this._strip();for(s(e===-1),e=0,v=0;v<this.length;v++)o=-(this.words[v]|0)+e,e=o>>26,this.words[v]=o&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,a){var d=this.length-i.length,c=this.clone(),v=i,o=v.words[v.length-1]|0,e=this._countBits(o);d=26-e,d!==0&&(v=v.ushln(d),c.iushln(d),o=v.words[v.length-1]|0);var l=c.length-v.length,b;if(a!=="mod"){b=new f(null),b.length=l+1,b.words=new Array(b.length);for(var _=0;_<b.length;_++)b.words[_]=0}var C=c.clone()._ishlnsubmul(v,1,l);C.negative===0&&(c=C,b&&(b.words[l]=1));for(var q=l-1;q>=0;q--){var O=(c.words[v.length+q]|0)*67108864+(c.words[v.length+q-1]|0);for(O=Math.min(O/o|0,67108863),c._ishlnsubmul(v,O,q);c.negative!==0;)O--,c.negative=0,c._ishlnsubmul(v,1,q),c.isZero()||(c.negative^=1);b&&(b.words[q]=O)}return b&&b._strip(),c._strip(),a!=="div"&&d!==0&&c.iushrn(d),{div:b||null,mod:c}},f.prototype.divmod=function(i,a,d){if(s(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var c,v,o;return this.negative!==0&&i.negative===0?(o=this.neg().divmod(i,a),a!=="mod"&&(c=o.div.neg()),a!=="div"&&(v=o.mod.neg(),d&&v.negative!==0&&v.iadd(i)),{div:c,mod:v}):this.negative===0&&i.negative!==0?(o=this.divmod(i.neg(),a),a!=="mod"&&(c=o.div.neg()),{div:c,mod:o.mod}):this.negative&i.negative?(o=this.neg().divmod(i.neg(),a),a!=="div"&&(v=o.mod.neg(),d&&v.negative!==0&&v.isub(i)),{div:o.div,mod:v}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,a)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var d=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),v=i.andln(1),o=d.cmp(c);return o<0||v===1&&o===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},f.prototype.modrn=function(i){var a=i<0;a&&(i=-i),s(i<=67108863);for(var d=(1<<26)%i,c=0,v=this.length-1;v>=0;v--)c=(d*c+(this.words[v]|0))%i;return a?-c:c},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var a=i<0;a&&(i=-i),s(i<=67108863);for(var d=0,c=this.length-1;c>=0;c--){var v=(this.words[c]|0)+d*67108864;this.words[c]=v/i|0,d=v%i}return this._strip(),a?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){s(i.negative===0),s(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),o=new f(0),e=new f(1),l=0;a.isEven()&&d.isEven();)a.iushrn(1),d.iushrn(1),++l;for(var b=d.clone(),_=a.clone();!a.isZero();){for(var C=0,q=1;!(a.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(a.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(b),v.isub(_)),c.iushrn(1),v.iushrn(1);for(var O=0,R=1;!(d.words[0]&R)&&O<26;++O,R<<=1);if(O>0)for(d.iushrn(O);O-- >0;)(o.isOdd()||e.isOdd())&&(o.iadd(b),e.isub(_)),o.iushrn(1),e.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(o),v.isub(e)):(d.isub(a),o.isub(c),e.isub(v))}return{a:o,b:e,gcd:d.iushln(l)}},f.prototype._invmp=function(i){s(i.negative===0),s(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),o=d.clone();a.cmpn(1)>0&&d.cmpn(1)>0;){for(var e=0,l=1;!(a.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(a.iushrn(e);e-- >0;)c.isOdd()&&c.iadd(o),c.iushrn(1);for(var b=0,_=1;!(d.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(d.iushrn(b);b-- >0;)v.isOdd()&&v.iadd(o),v.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(v)):(d.isub(a),v.isub(c))}var C;return a.cmpn(1)===0?C=c:C=v,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),d=i.clone();a.negative=0,d.negative=0;for(var c=0;a.isEven()&&d.isEven();c++)a.iushrn(1),d.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=a.cmp(d);if(v<0){var o=a;a=d,d=o}else if(v===0||d.cmpn(1)===0)break;a.isub(d)}while(!0);return d.iushln(c)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){s(typeof i=="number");var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return this._expand(d+1),this.words[d]|=c,this;for(var v=c,o=d;v!==0&&o<this.length;o++){var e=this.words[o]|0;e+=v,v=e>>>26,e&=67108863,this.words[o]=e}return v!==0&&(this.words[o]=v,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var d;if(this.length>1)d=1;else{a&&(i=-i),s(i<=67108863,"Number is too big");var c=this.words[0]|0;d=c===i?0:c<i?-1:1}return this.negative!==0?-d|0:d},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var a=this.ucmp(i);return this.negative!==0?-a|0:a},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var a=0,d=this.length-1;d>=0;d--){var c=this.words[d]|0,v=i.words[d]|0;if(c!==v){c<v?a=-1:c>v&&(a=1);break}}return a},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new p(i)},f.prototype.toRed=function(i){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return s(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return s(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var At={k256:null,p224:null,p192:null,p25519:null};function Bt(r,i){this.name=r,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Bt.prototype.ireduce=function(i){var a=i,d;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),d=a.bitLength();while(d>this.n);var c=d<this.n?-1:a.ucmp(this.p);return c===0?(a.words[0]=0,a.length=1):c>0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Bt.prototype.split=function(i,a){i.iushrn(this.n,0,a)},Bt.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(Ct,Bt),Ct.prototype.split=function(i,a){for(var d=4194303,c=Math.min(i.length,9),v=0;v<c;v++)a.words[v]=i.words[v];if(a.length=c,i.length<=9){i.words[0]=0,i.length=1;return}var o=i.words[9];for(a.words[a.length++]=o&d,v=10;v<i.length;v++){var e=i.words[v]|0;i.words[v-10]=(e&d)<<4|o>>>22,o=e}o>>>=22,i.words[v-10]=o,o===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,d=0;d<i.length;d++){var c=i.words[d]|0;a+=c*977,i.words[d]=a&67108863,a=c*64+(a/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Et(){Bt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Et,Bt);function Y(){Bt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Y,Bt);function It(){Bt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(It,Bt),It.prototype.imulK=function(i){for(var a=0,d=0;d<i.length;d++){var c=(i.words[d]|0)*19+a,v=c&67108863;c>>>=26,i.words[d]=v,a=c}return a!==0&&(i.words[i.length++]=a),i},f._prime=function(i){if(At[i])return At[i];var a;if(i==="k256")a=new Ct;else if(i==="p224")a=new Et;else if(i==="p192")a=new Y;else if(i==="p25519")a=new It;else throw new Error("Unknown prime "+i);return At[i]=a,a};function p(r){if(typeof r=="string"){var i=f._prime(r);this.m=i.p,this.prime=i}else s(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}p.prototype._verify1=function(i){s(i.negative===0,"red works only with positives"),s(i.red,"red works only with red numbers")},p.prototype._verify2=function(i,a){s((i.negative|a.negative)===0,"red works only with positives"),s(i.red&&i.red===a.red,"red works only with red numbers")},p.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(M(i,i.umod(this.m)._forceRed(this)),i)},p.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},p.prototype.add=function(i,a){this._verify2(i,a);var d=i.add(a);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},p.prototype.iadd=function(i,a){this._verify2(i,a);var d=i.iadd(a);return d.cmp(this.m)>=0&&d.isub(this.m),d},p.prototype.sub=function(i,a){this._verify2(i,a);var d=i.sub(a);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},p.prototype.isub=function(i,a){this._verify2(i,a);var d=i.isub(a);return d.cmpn(0)<0&&d.iadd(this.m),d},p.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},p.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},p.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},p.prototype.isqr=function(i){return this.imul(i,i.clone())},p.prototype.sqr=function(i){return this.mul(i,i)},p.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(s(a%2===1),a===3){var d=this.m.add(new f(1)).iushrn(2);return this.pow(i,d)}for(var c=this.m.subn(1),v=0;!c.isZero()&&c.andln(1)===0;)v++,c.iushrn(1);s(!c.isZero());var o=new f(1).toRed(this),e=o.redNeg(),l=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new f(2*b*b).toRed(this);this.pow(b,l).cmp(e)!==0;)b.redIAdd(e);for(var _=this.pow(b,c),C=this.pow(i,c.addn(1).iushrn(1)),q=this.pow(i,c),O=v;q.cmp(o)!==0;){for(var R=q,P=0;R.cmp(o)!==0;P++)R=R.redSqr();s(P<O);var N=this.pow(_,new f(1).iushln(O-P-1));C=C.redMul(N),_=N.redSqr(),q=q.redMul(_),O=P}return C},p.prototype.invm=function(i){var a=i._invmp(this.m);return a.negative!==0?(a.negative=0,this.imod(a).redNeg()):this.imod(a)},p.prototype.pow=function(i,a){if(a.isZero())return new f(1).toRed(this);if(a.cmpn(1)===0)return i.clone();var d=4,c=new Array(1<<d);c[0]=new f(1).toRed(this),c[1]=i;for(var v=2;v<c.length;v++)c[v]=this.mul(c[v-1],i);var o=c[0],e=0,l=0,b=a.bitLength()%26;for(b===0&&(b=26),v=a.length-1;v>=0;v--){for(var _=a.words[v],C=b-1;C>=0;C--){var q=_>>C&1;if(o!==c[0]&&(o=this.sqr(o)),q===0&&e===0){l=0;continue}e<<=1,e|=q,l++,!(l!==d&&(v!==0||C!==0))&&(o=this.mul(o,c[e]),l=0,e=0)}b=26}return o},p.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},p.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},f.mont=function(i){return new t(i)};function t(r){p.call(this,r),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(t,p),t.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},t.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},t.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var d=i.imul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),o=v;return v.cmp(this.m)>=0?o=v.isub(this.m):v.cmpn(0)<0&&(o=v.iadd(this.m)),o._forceRed(this)},t.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new f(0)._forceRed(this);var d=i.mul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),o=v;return v.cmp(this.m)>=0?o=v.isub(this.m):v.cmpn(0)<0&&(o=v.iadd(this.m)),o._forceRed(this)},t.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(h,Ft)}(o0);var u0=o0.exports,bi=u0,iv=li,nv=zt.Buffer;function _s(h){var n=h.modulus.byteLength(),u;do u=new bi(iv(n));while(u.cmp(h.modulus)>=0||!u.umod(h.prime1)||!u.umod(h.prime2));return u}function fv(h){var n=_s(h),u=n.toRed(bi.mont(h.modulus)).redPow(new bi(h.publicExponent)).fromRed();return{blinder:u,unblinder:n.invm(h.modulus)}}function Ss(h,n){var u=fv(n),s=n.modulus.byteLength(),m=new bi(h).mul(u.blinder).umod(n.modulus),f=m.toRed(bi.mont(n.prime1)),g=m.toRed(bi.mont(n.prime2)),y=n.coefficient,S=n.prime1,B=n.prime2,M=f.redPow(n.exponent1).fromRed(),x=g.redPow(n.exponent2).fromRed(),I=M.isub(x).imul(y).umod(S).imul(B);return x.iadd(I).imul(u.unblinder).umod(n.modulus).toArrayLike(nv,"be",s)}Ss.getr=_s;var l0=Ss,d0={};const av={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}};var We={},c0={exports:{}};c0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(c0);var Ir=c0.exports,v0={};(function(h){var n=h;function u(f,g){if(Array.isArray(f))return f.slice();if(!f)return[];var y=[];if(typeof f!="string"){for(var S=0;S<f.length;S++)y[S]=f[S]|0;return y}if(g==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var S=0;S<f.length;S+=2)y.push(parseInt(f[S]+f[S+1],16))}else for(var S=0;S<f.length;S++){var B=f.charCodeAt(S),M=B>>8,x=B&255;M?y.push(M,x):y.push(x)}return y}n.toArray=u;function s(f){return f.length===1?"0"+f:f}n.zero2=s;function m(f){for(var g="",y=0;y<f.length;y++)g+=s(f[y].toString(16));return g}n.toHex=m,n.encode=function(g,y){return y==="hex"?m(g):g}})(v0),function(h){var n=h,u=Ir,s=Ye,m=v0;n.assert=s,n.toArray=m.toArray,n.zero2=m.zero2,n.toHex=m.toHex,n.encode=m.encode;function f(M,x,I){var k=new Array(Math.max(M.bitLength(),I)+1),D;for(D=0;D<k.length;D+=1)k[D]=0;var L=1<<x+1,W=M.clone();for(D=0;D<k.length;D++){var z,$=W.andln(L-1);W.isOdd()?($>(L>>1)-1?z=(L>>1)-$:z=$,W.isubn(z)):z=0,k[D]=z,W.iushrn(1)}return k}n.getNAF=f;function g(M,x){var I=[[],[]];M=M.clone(),x=x.clone();for(var k=0,D=0,L;M.cmpn(-k)>0||x.cmpn(-D)>0;){var W=M.andln(3)+k&3,z=x.andln(3)+D&3;W===3&&(W=-1),z===3&&(z=-1);var $;W&1?(L=M.andln(7)+k&7,(L===3||L===5)&&z===2?$=-W:$=W):$=0,I[0].push($);var lt;z&1?(L=x.andln(7)+D&7,(L===3||L===5)&&W===2?lt=-z:lt=z):lt=0,I[1].push(lt),2*k===$+1&&(k=1-k),2*D===lt+1&&(D=1-D),M.iushrn(1),x.iushrn(1)}return I}n.getJSF=g;function y(M,x,I){var k="_"+x;M.prototype[x]=function(){return this[k]!==void 0?this[k]:this[k]=I.call(this)}}n.cachedProperty=y;function S(M){return typeof M=="string"?n.toArray(M,"hex"):M}n.parseBytes=S;function B(M){return new u(M,"hex","le")}n.intFromLE=B}(We);var p0={},ii=Ir,rn=We,Jn=rn.getNAF,hv=rn.getJSF,Gn=rn.assert;function Lr(h,n){this.type=h,this.p=new ii(n.p,16),this.red=n.prime?ii.red(n.prime):ii.mont(this.p),this.zero=new ii(0).toRed(this.red),this.one=new ii(1).toRed(this.red),this.two=new ii(2).toRed(this.red),this.n=n.n&&new ii(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.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 u=this.n&&this.p.div(this.n);!u||u.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Xn=Lr;Lr.prototype.point=function(){throw new Error("Not implemented")},Lr.prototype.validate=function(){throw new Error("Not implemented")},Lr.prototype._fixedNafMul=function(n,u){Gn(n.precomputed);var s=n._getDoubles(),m=Jn(u,1,this._bitLength),f=(1<<s.step+1)-(s.step%2===0?2:1);f/=3;var g=[],y,S;for(y=0;y<m.length;y+=s.step){S=0;for(var B=y+s.step-1;B>=y;B--)S=(S<<1)+m[B];g.push(S)}for(var M=this.jpoint(null,null,null),x=this.jpoint(null,null,null),I=f;I>0;I--){for(y=0;y<g.length;y++)S=g[y],S===I?x=x.mixedAdd(s.points[y]):S===-I&&(x=x.mixedAdd(s.points[y].neg()));M=M.add(x)}return M.toP()},Lr.prototype._wnafMul=function(n,u){var s=4,m=n._getNAFPoints(s);s=m.wnd;for(var f=m.points,g=Jn(u,s,this._bitLength),y=this.jpoint(null,null,null),S=g.length-1;S>=0;S--){for(var B=0;S>=0&&g[S]===0;S--)B++;if(S>=0&&B++,y=y.dblp(B),S<0)break;var M=g[S];Gn(M!==0),n.type==="affine"?M>0?y=y.mixedAdd(f[M-1>>1]):y=y.mixedAdd(f[-M-1>>1].neg()):M>0?y=y.add(f[M-1>>1]):y=y.add(f[-M-1>>1].neg())}return n.type==="affine"?y.toP():y},Lr.prototype._wnafMulAdd=function(n,u,s,m,f){var g=this._wnafT1,y=this._wnafT2,S=this._wnafT3,B=0,M,x,I;for(M=0;M<m;M++){I=u[M];var k=I._getNAFPoints(n);g[M]=k.wnd,y[M]=k.points}for(M=m-1;M>=1;M-=2){var D=M-1,L=M;if(g[D]!==1||g[L]!==1){S[D]=Jn(s[D],g[D],this._bitLength),S[L]=Jn(s[L],g[L],this._bitLength),B=Math.max(S[D].length,B),B=Math.max(S[L].length,B);continue}var W=[u[D],null,null,u[L]];u[D].y.cmp(u[L].y)===0?(W[1]=u[D].add(u[L]),W[2]=u[D].toJ().mixedAdd(u[L].neg())):u[D].y.cmp(u[L].y.redNeg())===0?(W[1]=u[D].toJ().mixedAdd(u[L]),W[2]=u[D].add(u[L].neg())):(W[1]=u[D].toJ().mixedAdd(u[L]),W[2]=u[D].toJ().mixedAdd(u[L].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],$=hv(s[D],s[L]);for(B=Math.max($[0].length,B),S[D]=new Array(B),S[L]=new Array(B),x=0;x<B;x++){var lt=$[0][x]|0,H=$[1][x]|0;S[D][x]=z[(lt+1)*3+(H+1)],S[L][x]=0,y[D]=W}}var At=this.jpoint(null,null,null),Bt=this._wnafT4;for(M=B;M>=0;M--){for(var Ct=0;M>=0;){var Et=!0;for(x=0;x<m;x++)Bt[x]=S[x][M]|0,Bt[x]!==0&&(Et=!1);if(!Et)break;Ct++,M--}if(M>=0&&Ct++,At=At.dblp(Ct),M<0)break;for(x=0;x<m;x++){var Y=Bt[x];Y!==0&&(Y>0?I=y[x][Y-1>>1]:Y<0&&(I=y[x][-Y-1>>1].neg()),I.type==="affine"?At=At.mixedAdd(I):At=At.add(I))}}for(M=0;M<m;M++)y[M]=null;return f?At:At.toP()};function je(h,n){this.curve=h,this.type=n,this.precomputed=null}Lr.BasePoint=je,je.prototype.eq=function(){throw new Error("Not implemented")},je.prototype.validate=function(){return this.curve.validate(this)},Lr.prototype.decodePoint=function(n,u){n=rn.toArray(n,u);var s=this.p.byteLength();if((n[0]===4||n[0]===6||n[0]===7)&&n.length-1===2*s){n[0]===6?Gn(n[n.length-1]%2===0):n[0]===7&&Gn(n[n.length-1]%2===1);var m=this.point(n.slice(1,1+s),n.slice(1+s,1+2*s));return m}else if((n[0]===2||n[0]===3)&&n.length-1===s)return this.pointFromX(n.slice(1,1+s),n[0]===3);throw new Error("Unknown point format")},je.prototype.encodeCompressed=function(n){return this.encode(n,!0)},je.prototype._encode=function(n){var u=this.curve.p.byteLength(),s=this.getX().toArray("be",u);return n?[this.getY().isEven()?2:3].concat(s):[4].concat(s,this.getY().toArray("be",u))},je.prototype.encode=function(n,u){return rn.encode(this._encode(u),n)},je.prototype.precompute=function(n){if(this.precomputed)return this;var u={doubles:null,naf:null,beta:null};return u.naf=this._getNAFPoints(8),u.doubles=this._getDoubles(4,n),u.beta=this._getBeta(),this.precomputed=u,this},je.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var u=this.precomputed.doubles;return u?u.points.length>=Math.ceil((n.bitLength()+1)/u.step):!1},je.prototype._getDoubles=function(n,u){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var s=[this],m=this,f=0;f<u;f+=n){for(var g=0;g<n;g++)m=m.dbl();s.push(m)}return{step:n,points:s}},je.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var u=[this],s=(1<<n)-1,m=s===1?null:this.dbl(),f=1;f<s;f++)u[f]=u[f-1].add(m);return{wnd:n,points:u}},je.prototype._getBeta=function(){return null},je.prototype.dblp=function(n){for(var u=this,s=0;s<n;s++)u=u.dbl();return u};var sv=We,be=Ir,m0=Kt,yi=Xn,ov=sv.assert;function Qe(h){yi.call(this,"short",h),this.a=new be(h.a,16).toRed(this.red),this.b=new be(h.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(h),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}m0(Qe,yi);var uv=Qe;Qe.prototype._getEndomorphism=function(n){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var u,s;if(n.beta)u=new be(n.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);u=m[0].cmp(m[1])<0?m[0]:m[1],u=u.toRed(this.red)}if(n.lambda)s=new be(n.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(u))===0?s=f[0]:(s=f[1],ov(this.g.mul(s).x.cmp(this.g.x.redMul(u))===0))}var g;return n.basis?g=n.basis.map(function(y){return{a:new be(y.a,16),b:new be(y.b,16)}}):g=this._getEndoBasis(s),{beta:u,lambda:s,basis:g}}},Qe.prototype._getEndoRoots=function(n){var u=n===this.p?this.red:be.mont(n),s=new be(2).toRed(u).redInvm(),m=s.redNeg(),f=new be(3).toRed(u).redNeg().redSqrt().redMul(s),g=m.redAdd(f).fromRed(),y=m.redSub(f).fromRed();return[g,y]},Qe.prototype._getEndoBasis=function(n){for(var u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),s=n,m=this.n.clone(),f=new be(1),g=new be(0),y=new be(0),S=new be(1),B,M,x,I,k,D,L,W=0,z,$;s.cmpn(0)!==0;){var lt=m.div(s);z=m.sub(lt.mul(s)),$=y.sub(lt.mul(f));var H=S.sub(lt.mul(g));if(!x&&z.cmp(u)<0)B=L.neg(),M=f,x=z.neg(),I=$;else if(x&&++W===2)break;L=z,m=s,s=z,y=f,f=$,S=g,g=H}k=z.neg(),D=$;var At=x.sqr().add(I.sqr()),Bt=k.sqr().add(D.sqr());return Bt.cmp(At)>=0&&(k=B,D=M),x.negative&&(x=x.neg(),I=I.neg()),k.negative&&(k=k.neg(),D=D.neg()),[{a:x,b:I},{a:k,b:D}]},Qe.prototype._endoSplit=function(n){var u=this.endo.basis,s=u[0],m=u[1],f=m.b.mul(n).divRound(this.n),g=s.b.neg().mul(n).divRound(this.n),y=f.mul(s.a),S=g.mul(m.a),B=f.mul(s.b),M=g.mul(m.b),x=n.sub(y).sub(S),I=B.add(M).neg();return{k1:x,k2:I}},Qe.prototype.pointFromX=function(n,u){n=new be(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),m=s.redSqrt();if(m.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var f=m.fromRed().isOdd();return(u&&!f||!u&&f)&&(m=m.redNeg()),this.point(n,m)},Qe.prototype.validate=function(n){if(n.inf)return!0;var u=n.x,s=n.y,m=this.a.redMul(u),f=u.redSqr().redMul(u).redIAdd(m).redIAdd(this.b);return s.redSqr().redISub(f).cmpn(0)===0},Qe.prototype._endoWnafMulAdd=function(n,u,s){for(var m=this._endoWnafT1,f=this._endoWnafT2,g=0;g<n.length;g++){var y=this._endoSplit(u[g]),S=n[g],B=S._getBeta();y.k1.negative&&(y.k1.ineg(),S=S.neg(!0)),y.k2.negative&&(y.k2.ineg(),B=B.neg(!0)),m[g*2]=S,m[g*2+1]=B,f[g*2]=y.k1,f[g*2+1]=y.k2}for(var M=this._wnafMulAdd(1,m,f,g*2,s),x=0;x<g*2;x++)m[x]=null,f[x]=null;return M};function Ae(h,n,u,s){yi.BasePoint.call(this,h,"affine"),n===null&&u===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new be(n,16),this.y=new be(u,16),s&&(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)}m0(Ae,yi.BasePoint),Qe.prototype.point=function(n,u,s){return new Ae(this,n,u,s)},Qe.prototype.pointFromJSON=function(n,u){return Ae.fromJSON(this,n,u)},Ae.prototype._getBeta=function(){if(this.curve.endo){var n=this.precomputed;if(n&&n.beta)return n.beta;var u=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(n){var s=this.curve,m=function(f){return s.point(f.x.redMul(s.endo.beta),f.y)};n.beta=u,u.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(m)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(m)}}}return u}},Ae.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]},Ae.fromJSON=function(n,u,s){typeof u=="string"&&(u=JSON.parse(u));var m=n.point(u[0],u[1],s);if(!u[2])return m;function f(y){return n.point(y[0],y[1],s)}var g=u[2];return m.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[m].concat(g.doubles.points.map(f))},naf:g.naf&&{wnd:g.naf.wnd,points:[m].concat(g.naf.points.map(f))}},m},Ae.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)+">"},Ae.prototype.isInfinity=function(){return this.inf},Ae.prototype.add=function(n){if(this.inf)return n;if(n.inf)return this;if(this.eq(n))return this.dbl();if(this.neg().eq(n))return this.curve.point(null,null);if(this.x.cmp(n.x)===0)return this.curve.point(null,null);var u=this.y.redSub(n.y);u.cmpn(0)!==0&&(u=u.redMul(this.x.redSub(n.x).redInvm()));var s=u.redSqr().redISub(this.x).redISub(n.x),m=u.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,m)},Ae.prototype.dbl=function(){if(this.inf)return this;var n=this.y.redAdd(this.y);if(n.cmpn(0)===0)return this.curve.point(null,null);var u=this.curve.a,s=this.x.redSqr(),m=n.redInvm(),f=s.redAdd(s).redIAdd(s).redIAdd(u).redMul(m),g=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)},Ae.prototype.getX=function(){return this.x.fromRed()},Ae.prototype.getY=function(){return this.y.fromRed()},Ae.prototype.mul=function(n){return n=new be(n,16),this.isInfinity()?this:this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)},Ae.prototype.mulAdd=function(n,u,s){var m=[this,u],f=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(m,f):this.curve._wnafMulAdd(1,m,f,2)},Ae.prototype.jmulAdd=function(n,u,s){var m=[this,u],f=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(m,f,!0):this.curve._wnafMulAdd(1,m,f,2,!0)},Ae.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||this.x.cmp(n.x)===0&&this.y.cmp(n.y)===0)},Ae.prototype.neg=function(n){if(this.inf)return this;var u=this.curve.point(this.x,this.y.redNeg());if(n&&this.precomputed){var s=this.precomputed,m=function(f){return f.neg()};u.precomputed={naf:s.naf&&{wnd:s.naf.wnd,points:s.naf.points.map(m)},doubles:s.doubles&&{step:s.doubles.step,points:s.doubles.points.map(m)}}}return u},Ae.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var n=this.curve.jpoint(this.x,this.y,this.curve.one);return n};function Ie(h,n,u,s){yi.BasePoint.call(this,h,"jacobian"),n===null&&u===null&&s===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new be(0)):(this.x=new be(n,16),this.y=new be(u,16),this.z=new be(s,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}m0(Ie,yi.BasePoint),Qe.prototype.jpoint=function(n,u,s){return new Ie(this,n,u,s)},Ie.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),u=n.redSqr(),s=this.x.redMul(u),m=this.y.redMul(u).redMul(n);return this.curve.point(s,m)},Ie.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ie.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var u=n.z.redSqr(),s=this.z.redSqr(),m=this.x.redMul(u),f=n.x.redMul(s),g=this.y.redMul(u.redMul(n.z)),y=n.y.redMul(s.redMul(this.z)),S=m.redSub(f),B=g.redSub(y);if(S.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var M=S.redSqr(),x=M.redMul(S),I=m.redMul(M),k=B.redSqr().redIAdd(x).redISub(I).redISub(I),D=B.redMul(I.redISub(k)).redISub(g.redMul(x)),L=this.z.redMul(n.z).redMul(S);return this.curve.jpoint(k,D,L)},Ie.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var u=this.z.redSqr(),s=this.x,m=n.x.redMul(u),f=this.y,g=n.y.redMul(u).redMul(this.z),y=s.redSub(m),S=f.redSub(g);if(y.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var B=y.redSqr(),M=B.redMul(y),x=s.redMul(B),I=S.redSqr().redIAdd(M).redISub(x).redISub(x),k=S.redMul(x.redISub(I)).redISub(f.redMul(M)),D=this.z.redMul(y);return this.curve.jpoint(I,k,D)},Ie.prototype.dblp=function(n){if(n===0)return this;if(this.isInfinity())return this;if(!n)return this.dbl();var u;if(this.curve.zeroA||this.curve.threeA){var s=this;for(u=0;u<n;u++)s=s.dbl();return s}var m=this.curve.a,f=this.curve.tinv,g=this.x,y=this.y,S=this.z,B=S.redSqr().redSqr(),M=y.redAdd(y);for(u=0;u<n;u++){var x=g.redSqr(),I=M.redSqr(),k=I.redSqr(),D=x.redAdd(x).redIAdd(x).redIAdd(m.redMul(B)),L=g.redMul(I),W=D.redSqr().redISub(L.redAdd(L)),z=L.redISub(W),$=D.redMul(z);$=$.redIAdd($).redISub(k);var lt=M.redMul(S);u+1<n&&(B=B.redMul(k)),g=W,S=lt,M=$}return this.curve.jpoint(g,M.redMul(f),S)},Ie.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ie.prototype._zeroDbl=function(){var n,u,s;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m),B=S.redSqr().redISub(y).redISub(y),M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),n=B,u=S.redMul(y.redISub(B)).redISub(M),s=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),I=this.y.redSqr(),k=I.redSqr(),D=this.x.redAdd(I).redSqr().redISub(x).redISub(k);D=D.redIAdd(D);var L=x.redAdd(x).redIAdd(x),W=L.redSqr(),z=k.redIAdd(k);z=z.redIAdd(z),z=z.redIAdd(z),n=W.redISub(D).redISub(D),u=L.redMul(D.redISub(n)).redISub(z),s=this.y.redMul(this.z),s=s.redIAdd(s)}return this.curve.jpoint(n,u,s)},Ie.prototype._threeDbl=function(){var n,u,s;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),B=S.redSqr().redISub(y).redISub(y);n=B;var M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),u=S.redMul(y.redISub(B)).redISub(M),s=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),I=this.y.redSqr(),k=this.x.redMul(I),D=this.x.redSub(x).redMul(this.x.redAdd(x));D=D.redAdd(D).redIAdd(D);var L=k.redIAdd(k);L=L.redIAdd(L);var W=L.redAdd(L);n=D.redSqr().redISub(W),s=this.y.redAdd(this.z).redSqr().redISub(I).redISub(x);var z=I.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),u=D.redMul(L.redISub(n)).redISub(z)}return this.curve.jpoint(n,u,s)},Ie.prototype._dbl=function(){var n=this.curve.a,u=this.x,s=this.y,m=this.z,f=m.redSqr().redSqr(),g=u.redSqr(),y=s.redSqr(),S=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),B=u.redAdd(u);B=B.redIAdd(B);var M=B.redMul(y),x=S.redSqr().redISub(M.redAdd(M)),I=M.redISub(x),k=y.redSqr();k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=S.redMul(I).redISub(k),L=s.redAdd(s).redMul(m);return this.curve.jpoint(x,D,L)},Ie.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var n=this.x.redSqr(),u=this.y.redSqr(),s=this.z.redSqr(),m=u.redSqr(),f=n.redAdd(n).redIAdd(n),g=f.redSqr(),y=this.x.redAdd(u).redSqr().redISub(n).redISub(m);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var S=y.redSqr(),B=m.redIAdd(m);B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var M=f.redIAdd(y).redSqr().redISub(g).redISub(S).redISub(B),x=u.redMul(M);x=x.redIAdd(x),x=x.redIAdd(x);var I=this.x.redMul(S).redISub(x);I=I.redIAdd(I),I=I.redIAdd(I);var k=this.y.redMul(M.redMul(B.redISub(M)).redISub(y.redMul(S)));k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=this.z.redAdd(y).redSqr().redISub(s).redISub(S);return this.curve.jpoint(I,k,D)},Ie.prototype.mul=function(n,u){return n=new be(n,u),this.curve._wnafMul(this,n)},Ie.prototype.eq=function(n){if(n.type==="affine")return this.eq(n.toJ());if(this===n)return!0;var u=this.z.redSqr(),s=n.z.redSqr();if(this.x.redMul(s).redISub(n.x.redMul(u)).cmpn(0)!==0)return!1;var m=u.redMul(this.z),f=s.redMul(n.z);return this.y.redMul(f).redISub(n.y.redMul(m)).cmpn(0)===0},Ie.prototype.eqXToP=function(n){var u=this.z.redSqr(),s=n.toRed(this.curve.red).redMul(u);if(this.x.cmp(s)===0)return!0;for(var m=n.clone(),f=this.curve.redN.redMul(u);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(f),this.x.cmp(s)===0)return!0}},Ie.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)+">"},Ie.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var wi=Ir,As=Kt,jn=Xn,lv=We;function Mi(h){jn.call(this,"mont",h),this.a=new wi(h.a,16).toRed(this.red),this.b=new wi(h.b,16).toRed(this.red),this.i4=new wi(4).toRed(this.red).redInvm(),this.two=new wi(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}As(Mi,jn);var dv=Mi;Mi.prototype.validate=function(n){var u=n.normalize().x,s=u.redSqr(),m=s.redMul(u).redAdd(s.redMul(this.a)).redAdd(u),f=m.redSqrt();return f.redSqr().cmp(m)===0};function Be(h,n,u){jn.BasePoint.call(this,h,"projective"),n===null&&u===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new wi(n,16),this.z=new wi(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}As(Be,jn.BasePoint),Mi.prototype.decodePoint=function(n,u){return this.point(lv.toArray(n,u),1)},Mi.prototype.point=function(n,u){return new Be(this,n,u)},Mi.prototype.pointFromJSON=function(n){return Be.fromJSON(this,n)},Be.prototype.precompute=function(){},Be.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Be.fromJSON=function(n,u){return new Be(n,u[0],u[1]||n.one)},Be.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)+">"},Be.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Be.prototype.dbl=function(){var n=this.x.redAdd(this.z),u=n.redSqr(),s=this.x.redSub(this.z),m=s.redSqr(),f=u.redSub(m),g=u.redMul(m),y=f.redMul(m.redAdd(this.curve.a24.redMul(f)));return this.curve.point(g,y)},Be.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.diffAdd=function(n,u){var s=this.x.redAdd(this.z),m=this.x.redSub(this.z),f=n.x.redAdd(n.z),g=n.x.redSub(n.z),y=g.redMul(s),S=f.redMul(m),B=u.z.redMul(y.redAdd(S).redSqr()),M=u.x.redMul(y.redISub(S).redSqr());return this.curve.point(B,M)},Be.prototype.mul=function(n){for(var u=n.clone(),s=this,m=this.curve.point(null,null),f=this,g=[];u.cmpn(0)!==0;u.iushrn(1))g.push(u.andln(1));for(var y=g.length-1;y>=0;y--)g[y]===0?(s=s.diffAdd(m,f),m=m.dbl()):(m=s.diffAdd(m,f),s=s.dbl());return m},Be.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Be.prototype.eq=function(n){return this.getX().cmp(n.getX())===0},Be.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Be.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var cv=We,Rr=Ir,Bs=Kt,Qn=Xn,vv=cv.assert;function vr(h){this.twisted=(h.a|0)!==1,this.mOneA=this.twisted&&(h.a|0)===-1,this.extended=this.mOneA,Qn.call(this,"edwards",h),this.a=new Rr(h.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Rr(h.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Rr(h.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),vv(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(h.c|0)===1}Bs(vr,Qn);var pv=vr;vr.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)},vr.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)},vr.prototype.jpoint=function(n,u,s,m){return this.point(n,u,s,m)},vr.prototype.pointFromX=function(n,u){n=new Rr(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr(),m=this.c2.redSub(this.a.redMul(s)),f=this.one.redSub(this.c2.redMul(this.d).redMul(s)),g=m.redMul(f.redInvm()),y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var S=y.fromRed().isOdd();return(u&&!S||!u&&S)&&(y=y.redNeg()),this.point(n,y)},vr.prototype.pointFromY=function(n,u){n=new Rr(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr(),m=s.redSub(this.c2),f=s.redMul(this.d).redMul(this.c2).redSub(this.a),g=m.redMul(f.redInvm());if(g.cmp(this.zero)===0){if(u)throw new Error("invalid point");return this.point(this.zero,n)}var y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==u&&(y=y.redNeg()),this.point(y,n)},vr.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var u=n.x.redSqr(),s=n.y.redSqr(),m=u.redMul(this.a).redAdd(s),f=this.c2.redMul(this.one.redAdd(this.d.redMul(u).redMul(s)));return m.cmp(f)===0};function pe(h,n,u,s,m){Qn.BasePoint.call(this,h,"projective"),n===null&&u===null&&s===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 Rr(n,16),this.y=new Rr(u,16),this.z=s?new Rr(s,16):this.curve.one,this.t=m&&new Rr(m,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()))))}Bs(pe,Qn.BasePoint),vr.prototype.pointFromJSON=function(n){return pe.fromJSON(this,n)},vr.prototype.point=function(n,u,s,m){return new pe(this,n,u,s,m)},pe.fromJSON=function(n,u){return new pe(n,u[0],u[1],u[2])},pe.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)+">"},pe.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},pe.prototype._extDbl=function(){var n=this.x.redSqr(),u=this.y.redSqr(),s=this.z.redSqr();s=s.redIAdd(s);var m=this.curve._mulA(n),f=this.x.redAdd(this.y).redSqr().redISub(n).redISub(u),g=m.redAdd(u),y=g.redSub(s),S=m.redSub(u),B=f.redMul(y),M=g.redMul(S),x=f.redMul(S),I=y.redMul(g);return this.curve.point(B,M,I,x)},pe.prototype._projDbl=function(){var n=this.x.redAdd(this.y).redSqr(),u=this.x.redSqr(),s=this.y.redSqr(),m,f,g,y,S,B;if(this.curve.twisted){y=this.curve._mulA(u);var M=y.redAdd(s);this.zOne?(m=n.redSub(u).redSub(s).redMul(M.redSub(this.curve.two)),f=M.redMul(y.redSub(s)),g=M.redSqr().redSub(M).redSub(M)):(S=this.z.redSqr(),B=M.redSub(S).redISub(S),m=n.redSub(u).redISub(s).redMul(B),f=M.redMul(y.redSub(s)),g=M.redMul(B))}else y=u.redAdd(s),S=this.curve._mulC(this.z).redSqr(),B=y.redSub(S).redSub(S),m=this.curve._mulC(n.redISub(y)).redMul(B),f=this.curve._mulC(y).redMul(u.redISub(s)),g=y.redMul(B);return this.curve.point(m,f,g)},pe.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},pe.prototype._extAdd=function(n){var u=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),s=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),m=this.t.redMul(this.curve.dd).redMul(n.t),f=this.z.redMul(n.z.redAdd(n.z)),g=s.redSub(u),y=f.redSub(m),S=f.redAdd(m),B=s.redAdd(u),M=g.redMul(y),x=S.redMul(B),I=g.redMul(B),k=y.redMul(S);return this.curve.point(M,x,k,I)},pe.prototype._projAdd=function(n){var u=this.z.redMul(n.z),s=u.redSqr(),m=this.x.redMul(n.x),f=this.y.redMul(n.y),g=this.curve.d.redMul(m).redMul(f),y=s.redSub(g),S=s.redAdd(g),B=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(m).redISub(f),M=u.redMul(y).redMul(B),x,I;return this.curve.twisted?(x=u.redMul(S).redMul(f.redSub(this.curve._mulA(m))),I=y.redMul(S)):(x=u.redMul(S).redMul(f.redSub(m)),I=this.curve._mulC(y).redMul(S)),this.curve.point(M,x,I)},pe.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)},pe.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)},pe.prototype.mulAdd=function(n,u,s){return this.curve._wnafMulAdd(1,[this,u],[n,s],2,!1)},pe.prototype.jmulAdd=function(n,u,s){return this.curve._wnafMulAdd(1,[this,u],[n,s],2,!0)},pe.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this},pe.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},pe.prototype.getX=function(){return this.normalize(),this.x.fromRed()},pe.prototype.getY=function(){return this.normalize(),this.y.fromRed()},pe.prototype.eq=function(n){return this===n||this.getX().cmp(n.getX())===0&&this.getY().cmp(n.getY())===0},pe.prototype.eqXToP=function(n){var u=n.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(u)===0)return!0;for(var s=n.clone(),m=this.curve.redN.redMul(this.z);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(m),this.x.cmp(u)===0)return!0}},pe.prototype.toP=pe.prototype.normalize,pe.prototype.mixedAdd=pe.prototype.add,function(h){var n=h;n.base=Xn,n.short=uv,n.mont=dv,n.edwards=pv}(p0);var tf={},ef={},Xt={},mv=Ye,gv=Kt;Xt.inherits=gv;function bv(h,n){return(h.charCodeAt(n)&64512)!==55296||n<0||n+1>=h.length?!1:(h.charCodeAt(n+1)&64512)===56320}function yv(h,n){if(Array.isArray(h))return h.slice();if(!h)return[];var u=[];if(typeof h=="string")if(n){if(n==="hex")for(h=h.replace(/[^a-z0-9]+/ig,""),h.length%2!==0&&(h="0"+h),m=0;m<h.length;m+=2)u.push(parseInt(h[m]+h[m+1],16))}else for(var s=0,m=0;m<h.length;m++){var f=h.charCodeAt(m);f<128?u[s++]=f:f<2048?(u[s++]=f>>6|192,u[s++]=f&63|128):bv(h,m)?(f=65536+((f&1023)<<10)+(h.charCodeAt(++m)&1023),u[s++]=f>>18|240,u[s++]=f>>12&63|128,u[s++]=f>>6&63|128,u[s++]=f&63|128):(u[s++]=f>>12|224,u[s++]=f>>6&63|128,u[s++]=f&63|128)}else for(m=0;m<h.length;m++)u[m]=h[m]|0;return u}Xt.toArray=yv;function wv(h){for(var n="",u=0;u<h.length;u++)n+=ks(h[u].toString(16));return n}Xt.toHex=wv;function Es(h){var n=h>>>24|h>>>8&65280|h<<8&16711680|(h&255)<<24;return n>>>0}Xt.htonl=Es;function Mv(h,n){for(var u="",s=0;s<h.length;s++){var m=h[s];n==="little"&&(m=Es(m)),u+=Is(m.toString(16))}return u}Xt.toHex32=Mv;function ks(h){return h.length===1?"0"+h:h}Xt.zero2=ks;function Is(h){return h.length===7?"0"+h:h.length===6?"00"+h:h.length===5?"000"+h:h.length===4?"0000"+h:h.length===3?"00000"+h:h.length===2?"000000"+h:h.length===1?"0000000"+h:h}Xt.zero8=Is;function xv(h,n,u,s){var m=u-n;mv(m%4===0);for(var f=new Array(m/4),g=0,y=n;g<f.length;g++,y+=4){var S;s==="big"?S=h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3]:S=h[y+3]<<24|h[y+2]<<16|h[y+1]<<8|h[y],f[g]=S>>>0}return f}Xt.join32=xv;function _v(h,n){for(var u=new Array(h.length*4),s=0,m=0;s<h.length;s++,m+=4){var f=h[s];n==="big"?(u[m]=f>>>24,u[m+1]=f>>>16&255,u[m+2]=f>>>8&255,u[m+3]=f&255):(u[m+3]=f>>>24,u[m+2]=f>>>16&255,u[m+1]=f>>>8&255,u[m]=f&255)}return u}Xt.split32=_v;function Sv(h,n){return h>>>n|h<<32-n}Xt.rotr32=Sv;function Av(h,n){return h<<n|h>>>32-n}Xt.rotl32=Av;function Bv(h,n){return h+n>>>0}Xt.sum32=Bv;function Ev(h,n,u){return h+n+u>>>0}Xt.sum32_3=Ev;function kv(h,n,u,s){return h+n+u+s>>>0}Xt.sum32_4=kv;function Iv(h,n,u,s,m){return h+n+u+s+m>>>0}Xt.sum32_5=Iv;function Rv(h,n,u,s){var m=h[n],f=h[n+1],g=s+f>>>0,y=(g<s?1:0)+u+m;h[n]=y>>>0,h[n+1]=g}Xt.sum64=Rv;function Tv(h,n,u,s){var m=n+s>>>0,f=(m<n?1:0)+h+u;return f>>>0}Xt.sum64_hi=Tv;function Cv(h,n,u,s){var m=n+s;return m>>>0}Xt.sum64_lo=Cv;function Fv(h,n,u,s,m,f,g,y){var S=0,B=n;B=B+s>>>0,S+=B<n?1:0,B=B+f>>>0,S+=B<f?1:0,B=B+y>>>0,S+=B<y?1:0;var M=h+u+m+g+S;return M>>>0}Xt.sum64_4_hi=Fv;function qv(h,n,u,s,m,f,g,y){var S=n+s+f+y;return S>>>0}Xt.sum64_4_lo=qv;function Pv(h,n,u,s,m,f,g,y,S,B){var M=0,x=n;x=x+s>>>0,M+=x<n?1:0,x=x+f>>>0,M+=x<f?1:0,x=x+y>>>0,M+=x<y?1:0,x=x+B>>>0,M+=x<B?1:0;var I=h+u+m+g+S+M;return I>>>0}Xt.sum64_5_hi=Pv;function Dv(h,n,u,s,m,f,g,y,S,B){var M=n+s+f+y+B;return M>>>0}Xt.sum64_5_lo=Dv;function Nv(h,n,u){var s=n<<32-u|h>>>u;return s>>>0}Xt.rotr64_hi=Nv;function $v(h,n,u){var s=h<<32-u|n>>>u;return s>>>0}Xt.rotr64_lo=$v;function Uv(h,n,u){return h>>>u}Xt.shr64_hi=Uv;function Lv(h,n,u){var s=h<<32-u|n>>>u;return s>>>0}Xt.shr64_lo=Lv;var xi={},Rs=Xt,Ov=Ye;function rf(){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}xi.BlockHash=rf,rf.prototype.update=function(n,u){if(n=Rs.toArray(n,u),this.pending?this.pending=this.pending.concat(n):this.pending=n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var s=n.length%this._delta8;this.pending=n.slice(n.length-s,n.length),this.pending.length===0&&(this.pending=null),n=Rs.join32(n,0,n.length-s,this.endian);for(var m=0;m<n.length;m+=this._delta32)this._update(n,m,m+this._delta32)}return this},rf.prototype.digest=function(n){return this.update(this._pad()),Ov(this.pending===null),this._digest(n)},rf.prototype._pad=function(){var n=this.pendingTotal,u=this._delta8,s=u-(n+this.padLength)%u,m=new Array(s+this.padLength);m[0]=128;for(var f=1;f<s;f++)m[f]=0;if(n<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)m[f++]=0;m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=n>>>24&255,m[f++]=n>>>16&255,m[f++]=n>>>8&255,m[f++]=n&255}else for(m[f++]=n&255,m[f++]=n>>>8&255,m[f++]=n>>>16&255,m[f++]=n>>>24&255,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,g=8;g<this.padLength;g++)m[f++]=0;return m};var _i={},pr={},zv=Xt,mr=zv.rotr32;function Kv(h,n,u,s){if(h===0)return Ts(n,u,s);if(h===1||h===3)return Fs(n,u,s);if(h===2)return Cs(n,u,s)}pr.ft_1=Kv;function Ts(h,n,u){return h&n^~h&u}pr.ch32=Ts;function Cs(h,n,u){return h&n^h&u^n&u}pr.maj32=Cs;function Fs(h,n,u){return h^n^u}pr.p32=Fs;function Hv(h){return mr(h,2)^mr(h,13)^mr(h,22)}pr.s0_256=Hv;function Zv(h){return mr(h,6)^mr(h,11)^mr(h,25)}pr.s1_256=Zv;function Wv(h){return mr(h,7)^mr(h,18)^h>>>3}pr.g0_256=Wv;function Vv(h){return mr(h,17)^mr(h,19)^h>>>10}pr.g1_256=Vv;var Si=Xt,Yv=xi,Jv=pr,g0=Si.rotl32,nn=Si.sum32,Gv=Si.sum32_5,Xv=Jv.ft_1,qs=Yv.BlockHash,jv=[1518500249,1859775393,2400959708,3395469782];function gr(){if(!(this instanceof gr))return new gr;qs.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Si.inherits(gr,qs);var Qv=gr;gr.blockSize=512,gr.outSize=160,gr.hmacStrength=80,gr.padLength=64,gr.prototype._update=function(n,u){for(var s=this.W,m=0;m<16;m++)s[m]=n[u+m];for(;m<s.length;m++)s[m]=g0(s[m-3]^s[m-8]^s[m-14]^s[m-16],1);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4];for(m=0;m<s.length;m++){var M=~~(m/20),x=Gv(g0(f,5),Xv(M,g,y,S),B,s[m],jv[M]);B=S,S=y,y=g0(g,30),g=f,f=x}this.h[0]=nn(this.h[0],f),this.h[1]=nn(this.h[1],g),this.h[2]=nn(this.h[2],y),this.h[3]=nn(this.h[3],S),this.h[4]=nn(this.h[4],B)},gr.prototype._digest=function(n){return n==="hex"?Si.toHex32(this.h,"big"):Si.split32(this.h,"big")};var Ai=Xt,tp=xi,Bi=pr,ep=Ye,ir=Ai.sum32,rp=Ai.sum32_4,ip=Ai.sum32_5,np=Bi.ch32,fp=Bi.maj32,ap=Bi.s0_256,hp=Bi.s1_256,sp=Bi.g0_256,op=Bi.g1_256,Ps=tp.BlockHash,up=[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 br(){if(!(this instanceof br))return new br;Ps.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=up,this.W=new Array(64)}Ai.inherits(br,Ps);var Ds=br;br.blockSize=512,br.outSize=256,br.hmacStrength=192,br.padLength=64,br.prototype._update=function(n,u){for(var s=this.W,m=0;m<16;m++)s[m]=n[u+m];for(;m<s.length;m++)s[m]=rp(op(s[m-2]),s[m-7],sp(s[m-15]),s[m-16]);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4],M=this.h[5],x=this.h[6],I=this.h[7];for(ep(this.k.length===s.length),m=0;m<s.length;m++){var k=ip(I,hp(B),np(B,M,x),this.k[m],s[m]),D=ir(ap(f),fp(f,g,y));I=x,x=M,M=B,B=ir(S,k),S=y,y=g,g=f,f=ir(k,D)}this.h[0]=ir(this.h[0],f),this.h[1]=ir(this.h[1],g),this.h[2]=ir(this.h[2],y),this.h[3]=ir(this.h[3],S),this.h[4]=ir(this.h[4],B),this.h[5]=ir(this.h[5],M),this.h[6]=ir(this.h[6],x),this.h[7]=ir(this.h[7],I)},br.prototype._digest=function(n){return n==="hex"?Ai.toHex32(this.h,"big"):Ai.split32(this.h,"big")};var b0=Xt,Ns=Ds;function Tr(){if(!(this instanceof Tr))return new Tr;Ns.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}b0.inherits(Tr,Ns);var lp=Tr;Tr.blockSize=512,Tr.outSize=224,Tr.hmacStrength=192,Tr.padLength=64,Tr.prototype._digest=function(n){return n==="hex"?b0.toHex32(this.h.slice(0,7),"big"):b0.split32(this.h.slice(0,7),"big")};var Le=Xt,dp=xi,cp=Ye,yr=Le.rotr64_hi,wr=Le.rotr64_lo,$s=Le.shr64_hi,Us=Le.shr64_lo,Or=Le.sum64,y0=Le.sum64_hi,w0=Le.sum64_lo,vp=Le.sum64_4_hi,pp=Le.sum64_4_lo,mp=Le.sum64_5_hi,gp=Le.sum64_5_lo,Ls=dp.BlockHash,bp=[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 nr(){if(!(this instanceof nr))return new nr;Ls.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=bp,this.W=new Array(160)}Le.inherits(nr,Ls);var Os=nr;nr.blockSize=1024,nr.outSize=512,nr.hmacStrength=192,nr.padLength=128,nr.prototype._prepareBlock=function(n,u){for(var s=this.W,m=0;m<32;m++)s[m]=n[u+m];for(;m<s.length;m+=2){var f=Ip(s[m-4],s[m-3]),g=Rp(s[m-4],s[m-3]),y=s[m-14],S=s[m-13],B=Ep(s[m-30],s[m-29]),M=kp(s[m-30],s[m-29]),x=s[m-32],I=s[m-31];s[m]=vp(f,g,y,S,B,M,x,I),s[m+1]=pp(f,g,y,S,B,M,x,I)}},nr.prototype._update=function(n,u){this._prepareBlock(n,u);var s=this.W,m=this.h[0],f=this.h[1],g=this.h[2],y=this.h[3],S=this.h[4],B=this.h[5],M=this.h[6],x=this.h[7],I=this.h[8],k=this.h[9],D=this.h[10],L=this.h[11],W=this.h[12],z=this.h[13],$=this.h[14],lt=this.h[15];cp(this.k.length===s.length);for(var H=0;H<s.length;H+=2){var At=$,Bt=lt,Ct=Ap(I,k),Et=Bp(I,k),Y=yp(I,k,D,L,W),It=wp(I,k,D,L,W,z),p=this.k[H],t=this.k[H+1],r=s[H],i=s[H+1],a=mp(At,Bt,Ct,Et,Y,It,p,t,r,i),d=gp(At,Bt,Ct,Et,Y,It,p,t,r,i);At=_p(m,f),Bt=Sp(m,f),Ct=Mp(m,f,g,y,S),Et=xp(m,f,g,y,S,B);var c=y0(At,Bt,Ct,Et),v=w0(At,Bt,Ct,Et);$=W,lt=z,W=D,z=L,D=I,L=k,I=y0(M,x,a,d),k=w0(x,x,a,d),M=S,x=B,S=g,B=y,g=m,y=f,m=y0(a,d,c,v),f=w0(a,d,c,v)}Or(this.h,0,m,f),Or(this.h,2,g,y),Or(this.h,4,S,B),Or(this.h,6,M,x),Or(this.h,8,I,k),Or(this.h,10,D,L),Or(this.h,12,W,z),Or(this.h,14,$,lt)},nr.prototype._digest=function(n){return n==="hex"?Le.toHex32(this.h,"big"):Le.split32(this.h,"big")};function yp(h,n,u,s,m){var f=h&u^~h&m;return f<0&&(f+=4294967296),f}function wp(h,n,u,s,m,f){var g=n&s^~n&f;return g<0&&(g+=4294967296),g}function Mp(h,n,u,s,m){var f=h&u^h&m^u&m;return f<0&&(f+=4294967296),f}function xp(h,n,u,s,m,f){var g=n&s^n&f^s&f;return g<0&&(g+=4294967296),g}function _p(h,n){var u=yr(h,n,28),s=yr(n,h,2),m=yr(n,h,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Sp(h,n){var u=wr(h,n,28),s=wr(n,h,2),m=wr(n,h,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Ap(h,n){var u=yr(h,n,14),s=yr(h,n,18),m=yr(n,h,9),f=u^s^m;return f<0&&(f+=4294967296),f}function Bp(h,n){var u=wr(h,n,14),s=wr(h,n,18),m=wr(n,h,9),f=u^s^m;return f<0&&(f+=4294967296),f}function Ep(h,n){var u=yr(h,n,1),s=yr(h,n,8),m=$s(h,n,7),f=u^s^m;return f<0&&(f+=4294967296),f}function kp(h,n){var u=wr(h,n,1),s=wr(h,n,8),m=Us(h,n,7),f=u^s^m;return f<0&&(f+=4294967296),f}function Ip(h,n){var u=yr(h,n,19),s=yr(n,h,29),m=$s(h,n,6),f=u^s^m;return f<0&&(f+=4294967296),f}function Rp(h,n){var u=wr(h,n,19),s=wr(n,h,29),m=Us(h,n,6),f=u^s^m;return f<0&&(f+=4294967296),f}var M0=Xt,zs=Os;function Cr(){if(!(this instanceof Cr))return new Cr;zs.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}M0.inherits(Cr,zs);var Tp=Cr;Cr.blockSize=1024,Cr.outSize=384,Cr.hmacStrength=192,Cr.padLength=128,Cr.prototype._digest=function(n){return n==="hex"?M0.toHex32(this.h.slice(0,12),"big"):M0.split32(this.h.slice(0,12),"big")},_i.sha1=Qv,_i.sha224=lp,_i.sha256=Ds,_i.sha384=Tp,_i.sha512=Os;var Ks={},ni=Xt,Cp=xi,nf=ni.rotl32,Hs=ni.sum32,fn=ni.sum32_3,Zs=ni.sum32_4,Ws=Cp.BlockHash;function Mr(){if(!(this instanceof Mr))return new Mr;Ws.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}ni.inherits(Mr,Ws),Ks.ripemd160=Mr,Mr.blockSize=512,Mr.outSize=160,Mr.hmacStrength=192,Mr.padLength=64,Mr.prototype._update=function(n,u){for(var s=this.h[0],m=this.h[1],f=this.h[2],g=this.h[3],y=this.h[4],S=s,B=m,M=f,x=g,I=y,k=0;k<80;k++){var D=Hs(nf(Zs(s,Vs(k,m,f,g),n[Pp[k]+u],Fp(k)),Np[k]),y);s=y,y=g,g=nf(f,10),f=m,m=D,D=Hs(nf(Zs(S,Vs(79-k,B,M,x),n[Dp[k]+u],qp(k)),$p[k]),I),S=I,I=x,x=nf(M,10),M=B,B=D}D=fn(this.h[1],f,x),this.h[1]=fn(this.h[2],g,I),this.h[2]=fn(this.h[3],y,S),this.h[3]=fn(this.h[4],s,B),this.h[4]=fn(this.h[0],m,M),this.h[0]=D},Mr.prototype._digest=function(n){return n==="hex"?ni.toHex32(this.h,"little"):ni.split32(this.h,"little")};function Vs(h,n,u,s){return h<=15?n^u^s:h<=31?n&u|~n&s:h<=47?(n|~u)^s:h<=63?n&s|u&~s:n^(u|~s)}function Fp(h){return h<=15?0:h<=31?1518500249:h<=47?1859775393:h<=63?2400959708:2840853838}function qp(h){return h<=15?1352829926:h<=31?1548603684:h<=47?1836072691:h<=63?2053994217:0}var Pp=[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],Dp=[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],Np=[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],$p=[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],Up=Xt,Lp=Ye;function Ei(h,n,u){if(!(this instanceof Ei))return new Ei(h,n,u);this.Hash=h,this.blockSize=h.blockSize/8,this.outSize=h.outSize/8,this.inner=null,this.outer=null,this._init(Up.toArray(n,u))}var Op=Ei;Ei.prototype._init=function(n){n.length>this.blockSize&&(n=new this.Hash().update(n).digest()),Lp(n.length<=this.blockSize);for(var u=n.length;u<this.blockSize;u++)n.push(0);for(u=0;u<n.length;u++)n[u]^=54;for(this.inner=new this.Hash().update(n),u=0;u<n.length;u++)n[u]^=106;this.outer=new this.Hash().update(n)},Ei.prototype.update=function(n,u){return this.inner.update(n,u),this},Ei.prototype.digest=function(n){return this.outer.update(this.inner.digest()),this.outer.digest(n)},function(h){var n=h;n.utils=Xt,n.common=xi,n.sha=_i,n.ripemd=Ks,n.hmac=Op,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160}(ef);var x0,Ys;function zp(){return Ys||(Ys=1,x0={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"]]}}),x0}(function(h){var n=h,u=ef,s=p0,m=We,f=m.assert;function g(B){B.type==="short"?this.curve=new s.short(B):B.type==="edwards"?this.curve=new s.edwards(B):this.curve=new s.mont(B),this.g=this.curve.g,this.n=this.curve.n,this.hash=B.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}n.PresetCurve=g;function y(B,M){Object.defineProperty(n,B,{configurable:!0,enumerable:!0,get:function(){var x=new g(M);return Object.defineProperty(n,B,{configurable:!0,enumerable:!0,value:x}),x}})}y("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:u.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),y("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:u.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),y("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:u.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),y("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:u.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"]}),y("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:u.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"]}),y("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["9"]}),y("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:u.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=zp()}catch(B){S=void 0}y("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:u.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(tf);var Kp=ef,fi=v0,Js=Ye;function zr(h){if(!(this instanceof zr))return new zr(h);this.hash=h.hash,this.predResist=!!h.predResist,this.outLen=this.hash.outSize,this.minEntropy=h.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=fi.toArray(h.entropy,h.entropyEnc||"hex"),u=fi.toArray(h.nonce,h.nonceEnc||"hex"),s=fi.toArray(h.pers,h.persEnc||"hex");Js(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,u,s)}var Hp=zr;zr.prototype._init=function(n,u,s){var m=n.concat(u).concat(s);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(m),this._reseed=1,this.reseedInterval=281474976710656},zr.prototype._hmac=function(){return new Kp.hmac(this.hash,this.K)},zr.prototype._update=function(n){var u=this._hmac().update(this.V).update([0]);n&&(u=u.update(n)),this.K=u.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())},zr.prototype.reseed=function(n,u,s,m){typeof u!="string"&&(m=s,s=u,u=null),n=fi.toArray(n,u),s=fi.toArray(s,m),Js(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(s||[])),this._reseed=1},zr.prototype.generate=function(n,u,s,m){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof u!="string"&&(m=s,s=u,u=null),s&&(s=fi.toArray(s,m||"hex"),this._update(s));for(var f=[];f.length<n;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,n);return this._update(s),this._reseed++,fi.encode(g,u)};var Zp=Ir,Wp=We,_0=Wp.assert;function Pe(h,n){this.ec=h,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}var Vp=Pe;Pe.fromPublic=function(n,u,s){return u instanceof Pe?u:new Pe(n,{pub:u,pubEnc:s})},Pe.fromPrivate=function(n,u,s){return u instanceof Pe?u:new Pe(n,{priv:u,privEnc:s})},Pe.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.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"}},Pe.prototype.getPublic=function(n,u){return typeof n=="string"&&(u=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),u?this.pub.encode(u,n):this.pub},Pe.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv},Pe.prototype._importPrivate=function(n,u){this.priv=new Zp(n,u||16),this.priv=this.priv.umod(this.ec.curve.n)},Pe.prototype._importPublic=function(n,u){if(n.x||n.y){this.ec.curve.type==="mont"?_0(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&_0(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,u)},Pe.prototype.derive=function(n){return n.validate()||_0(n.validate(),"public point not validated"),n.mul(this.priv).getX()},Pe.prototype.sign=function(n,u,s){return this.ec.sign(n,this,u,s)},Pe.prototype.verify=function(n,u,s){return this.ec.verify(n,u,this,void 0,s)},Pe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var ff=Ir,S0=We,Yp=S0.assert;function af(h,n){if(h instanceof af)return h;this._importDER(h,n)||(Yp(h.r&&h.s,"Signature without r or s"),this.r=new ff(h.r,16),this.s=new ff(h.s,16),h.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=h.recoveryParam)}var Jp=af;function Gp(){this.place=0}function A0(h,n){var u=h[n.place++];if(!(u&128))return u;var s=u&15;if(s===0||s>4||h[n.place]===0)return!1;for(var m=0,f=0,g=n.place;f<s;f++,g++)m<<=8,m|=h[g],m>>>=0;return m<=127?!1:(n.place=g,m)}function Gs(h){for(var n=0,u=h.length-1;!h[n]&&!(h[n+1]&128)&&n<u;)n++;return n===0?h:h.slice(n)}af.prototype._importDER=function(n,u){n=S0.toArray(n,u);var s=new Gp;if(n[s.place++]!==48)return!1;var m=A0(n,s);if(m===!1||m+s.place!==n.length||n[s.place++]!==2)return!1;var f=A0(n,s);if(f===!1||n[s.place]&128)return!1;var g=n.slice(s.place,f+s.place);if(s.place+=f,n[s.place++]!==2)return!1;var y=A0(n,s);if(y===!1||n.length!==y+s.place||n[s.place]&128)return!1;var S=n.slice(s.place,y+s.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(S[0]===0)if(S[1]&128)S=S.slice(1);else return!1;return this.r=new ff(g),this.s=new ff(S),this.recoveryParam=null,!0};function B0(h,n){if(n<128){h.push(n);return}var u=1+(Math.log(n)/Math.LN2>>>3);for(h.push(u|128);--u;)h.push(n>>>(u<<3)&255);h.push(n)}af.prototype.toDER=function(n){var u=this.r.toArray(),s=this.s.toArray();for(u[0]&128&&(u=[0].concat(u)),s[0]&128&&(s=[0].concat(s)),u=Gs(u),s=Gs(s);!s[0]&&!(s[1]&128);)s=s.slice(1);var m=[2];B0(m,u.length),m=m.concat(u),m.push(2),B0(m,s.length);var f=m.concat(s),g=[48];return B0(g,f.length),g=g.concat(f),S0.encode(g,n)};var E0,Xs;function Xp(){if(Xs)return E0;Xs=1;var h=Ir,n=Hp,u=We,s=tf,m=Gf(),f=u.assert,g=Vp,y=Jp;function S(B){if(!(this instanceof S))return new S(B);typeof B=="string"&&(f(Object.prototype.hasOwnProperty.call(s,B),"Unknown curve "+B),B=s[B]),B instanceof s.PresetCurve&&(B={curve:B}),this.curve=B.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=B.curve.g,this.g.precompute(B.curve.n.bitLength()+1),this.hash=B.hash||B.curve.hash}return E0=S,S.prototype.keyPair=function(M){return new g(this,M)},S.prototype.keyFromPrivate=function(M,x){return g.fromPrivate(this,M,x)},S.prototype.keyFromPublic=function(M,x){return g.fromPublic(this,M,x)},S.prototype.genKeyPair=function(M){M||(M={});for(var x=new n({hash:this.hash,pers:M.pers,persEnc:M.persEnc||"utf8",entropy:M.entropy||m(this.hash.hmacStrength),entropyEnc:M.entropy&&M.entropyEnc||"utf8",nonce:this.n.toArray()}),I=this.n.byteLength(),k=this.n.sub(new h(2));;){var D=new h(x.generate(I));if(!(D.cmp(k)>0))return D.iaddn(1),this.keyFromPrivate(D)}},S.prototype._truncateToN=function(M,x,I){var k;if(h.isBN(M)||typeof M=="number")M=new h(M,16),k=M.byteLength();else if(typeof M=="object")k=M.length,M=new h(M,16);else{var D=M.toString();k=D.length+1>>>1,M=new h(D,16)}typeof I!="number"&&(I=k*8);var L=I-this.n.bitLength();return L>0&&(M=M.ushrn(L)),!x&&M.cmp(this.n)>=0?M.sub(this.n):M},S.prototype.sign=function(M,x,I,k){if(typeof I=="object"&&(k=I,I=null),k||(k={}),typeof M!="string"&&typeof M!="number"&&!h.isBN(M)){f(typeof M=="object"&&M&&typeof M.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),f(M.length>>>0===M.length);for(var D=0;D<M.length;D++)f((M[D]&255)===M[D])}x=this.keyFromPrivate(x,I),M=this._truncateToN(M,!1,k.msgBitLength),f(!M.isNeg(),"Can not sign a negative message");var L=this.n.byteLength(),W=x.getPrivate().toArray("be",L),z=M.toArray("be",L);f(new h(z).eq(M),"Can not sign message");for(var $=new n({hash:this.hash,entropy:W,nonce:z,pers:k.pers,persEnc:k.persEnc||"utf8"}),lt=this.n.sub(new h(1)),H=0;;H++){var At=k.k?k.k(H):new h($.generate(this.n.byteLength()));if(At=this._truncateToN(At,!0),!(At.cmpn(1)<=0||At.cmp(lt)>=0)){var Bt=this.g.mul(At);if(!Bt.isInfinity()){var Ct=Bt.getX(),Et=Ct.umod(this.n);if(Et.cmpn(0)!==0){var Y=At.invm(this.n).mul(Et.mul(x.getPrivate()).iadd(M));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var It=(Bt.getY().isOdd()?1:0)|(Ct.cmp(Et)!==0?2:0);return k.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),It^=1),new y({r:Et,s:Y,recoveryParam:It})}}}}}},S.prototype.verify=function(M,x,I,k,D){D||(D={}),M=this._truncateToN(M,!1,D.msgBitLength),I=this.keyFromPublic(I,k),x=new y(x,"hex");var L=x.r,W=x.s;if(L.cmpn(1)<0||L.cmp(this.n)>=0||W.cmpn(1)<0||W.cmp(this.n)>=0)return!1;var z=W.invm(this.n),$=z.mul(M).umod(this.n),lt=z.mul(L).umod(this.n),H;return this.curve._maxwellTrick?(H=this.g.jmulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.eqXToP(L)):(H=this.g.mulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.getX().umod(this.n).cmp(L)===0)},S.prototype.recoverPubKey=function(B,M,x,I){f((3&x)===x,"The recovery param is more than two bits"),M=new y(M,I);var k=this.n,D=new h(B),L=M.r,W=M.s,z=x&1,$=x>>1;if(L.cmp(this.curve.p.umod(this.curve.n))>=0&&$)throw new Error("Unable to find sencond key candinate");$?L=this.curve.pointFromX(L.add(this.curve.n),z):L=this.curve.pointFromX(L,z);var lt=M.r.invm(k),H=k.sub(D).mul(lt).umod(k),At=W.mul(lt).umod(k);return this.g.mulAdd(H,L,At)},S.prototype.getKeyRecoveryParam=function(B,M,x,I){if(M=new y(M,I),M.recoveryParam!==null)return M.recoveryParam;for(var k=0;k<4;k++){var D;try{D=this.recoverPubKey(B,M,k)}catch(L){continue}if(D.eq(x))return k}throw new Error("Unable to find valid recovery factor")},E0}var an=We,js=an.assert,Qs=an.parseBytes,ki=an.cachedProperty;function Ee(h,n){this.eddsa=h,this._secret=Qs(n.secret),h.isPoint(n.pub)?this._pub=n.pub:this._pubBytes=Qs(n.pub)}Ee.fromPublic=function(n,u){return u instanceof Ee?u:new Ee(n,{pub:u})},Ee.fromSecret=function(n,u){return u instanceof Ee?u:new Ee(n,{secret:u})},Ee.prototype.secret=function(){return this._secret},ki(Ee,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),ki(Ee,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),ki(Ee,"privBytes",function(){var n=this.eddsa,u=this.hash(),s=n.encodingLength-1,m=u.slice(0,n.encodingLength);return m[0]&=248,m[s]&=127,m[s]|=64,m}),ki(Ee,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),ki(Ee,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),ki(Ee,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Ee.prototype.sign=function(n){return js(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)},Ee.prototype.verify=function(n,u){return this.eddsa.verify(n,u,this)},Ee.prototype.getSecret=function(n){return js(this._secret,"KeyPair is public only"),an.encode(this.secret(),n)},Ee.prototype.getPublic=function(n){return an.encode(this.pubBytes(),n)};var jp=Ee,Qp=Ir,hf=We,to=hf.assert,sf=hf.cachedProperty,t2=hf.parseBytes;function ai(h,n){this.eddsa=h,typeof n!="object"&&(n=t2(n)),Array.isArray(n)&&(to(n.length===h.encodingLength*2,"Signature has invalid size"),n={R:n.slice(0,h.encodingLength),S:n.slice(h.encodingLength)}),to(n.R&&n.S,"Signature without R or S"),h.isPoint(n.R)&&(this._R=n.R),n.S instanceof Qp&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}sf(ai,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),sf(ai,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),sf(ai,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),sf(ai,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),ai.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},ai.prototype.toHex=function(){return hf.encode(this.toBytes(),"hex").toUpperCase()};var e2=ai,r2=ef,i2=tf,Ii=We,n2=Ii.assert,eo=Ii.parseBytes,ro=jp,io=e2;function Oe(h){if(n2(h==="ed25519","only tested with ed25519 so far"),!(this instanceof Oe))return new Oe(h);h=i2[h].curve,this.curve=h,this.g=h.g,this.g.precompute(h.n.bitLength()+1),this.pointClass=h.point().constructor,this.encodingLength=Math.ceil(h.n.bitLength()/8),this.hash=r2.sha512}var f2=Oe;Oe.prototype.sign=function(n,u){n=eo(n);var s=this.keyFromSecret(u),m=this.hashInt(s.messagePrefix(),n),f=this.g.mul(m),g=this.encodePoint(f),y=this.hashInt(g,s.pubBytes(),n).mul(s.priv()),S=m.add(y).umod(this.curve.n);return this.makeSignature({R:f,S,Rencoded:g})},Oe.prototype.verify=function(n,u,s){if(n=eo(n),u=this.makeSignature(u),u.S().gte(u.eddsa.curve.n)||u.S().isNeg())return!1;var m=this.keyFromPublic(s),f=this.hashInt(u.Rencoded(),m.pubBytes(),n),g=this.g.mul(u.S()),y=u.R().add(m.pub().mul(f));return y.eq(g)},Oe.prototype.hashInt=function(){for(var n=this.hash(),u=0;u<arguments.length;u++)n.update(arguments[u]);return Ii.intFromLE(n.digest()).umod(this.curve.n)},Oe.prototype.keyFromPublic=function(n){return ro.fromPublic(this,n)},Oe.prototype.keyFromSecret=function(n){return ro.fromSecret(this,n)},Oe.prototype.makeSignature=function(n){return n instanceof io?n:new io(this,n)},Oe.prototype.encodePoint=function(n){var u=n.getY().toArray("le",this.encodingLength);return u[this.encodingLength-1]|=n.getX().isOdd()?128:0,u},Oe.prototype.decodePoint=function(n){n=Ii.parseBytes(n);var u=n.length-1,s=n.slice(0,u).concat(n[u]&-129),m=(n[u]&128)!==0,f=Ii.intFromLE(s);return this.curve.pointFromY(f,m)},Oe.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)},Oe.prototype.decodeInt=function(n){return Ii.intFromLE(n)},Oe.prototype.isPoint=function(n){return n instanceof this.pointClass};var no;function k0(){return no||(no=1,function(h){var n=h;n.version=av.version,n.utils=We,n.rand=Gf(),n.curve=p0,n.curves=tf,n.ec=Xp(),n.eddsa=f2}(d0)),d0}var fr={},I0={},R0={exports:{}};R0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(R0);var a2=R0.exports,T0={},fo;function h2(){return fo||(fo=1,function(h){var n=sn(),u=Kt,s=h;s.define=function(g,y){return new m(g,y)};function m(f,g){this.name=f,this.body=g,this.decoders={},this.encoders={}}m.prototype._createNamed=function(g){var y;try{y=Ne.runInThisContext("(function "+this.name+`(entity) {
|
|
13
13
|
this._initNamed(entity);
|
|
14
|
-
})`)}catch(S){y=function(B){this._initNamed(B)}}return u(y,g),y.prototype._initNamed=function(B){g.call(this,B)},new y(this)},m.prototype._getDecoder=function(g){return g=g||"der",this.decoders.hasOwnProperty(g)||(this.decoders[g]=this._createNamed(n.decoders[g])),this.decoders[g]},m.prototype.decode=function(g,y,S){return this._getDecoder(y).decode(g,S)},m.prototype._getEncoder=function(g){return g=g||"der",this.encoders.hasOwnProperty(g)||(this.encoders[g]=this._createNamed(n.encoders[g])),this.encoders[g]},m.prototype.encode=function(g,y,S){return this._getEncoder(y).encode(g,S)}}(T0)),T0}var C0={},ao={},sm=Kt;function tr(h){this._reporterState={obj:null,path:[],options:h||{},errors:[]}}ao.Reporter=tr,tr.prototype.isError=function(n){return n instanceof Ri},tr.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},tr.prototype.restore=function(n){var u=this._reporterState;u.obj=n.obj,u.path=u.path.slice(0,n.pathLen)},tr.prototype.enterKey=function(n){return this._reporterState.path.push(n)},tr.prototype.exitKey=function(n){var u=this._reporterState;u.path=u.path.slice(0,n-1)},tr.prototype.leaveKey=function(n,u,s){var m=this._reporterState;this.exitKey(n),m.obj!==null&&(m.obj[u]=s)},tr.prototype.path=function(){return this._reporterState.path.join("/")},tr.prototype.enterObject=function(){var n=this._reporterState,u=n.obj;return n.obj={},u},tr.prototype.leaveObject=function(n){var u=this._reporterState,s=u.obj;return u.obj=n,s},tr.prototype.error=function(n){var u,s=this._reporterState,m=n instanceof Ri;if(m?u=n:u=new Ri(s.path.map(function(f){return"["+JSON.stringify(f)+"]"}).join(""),n.message||n,n.stack),!s.options.partial)throw u;return m||s.errors.push(u),u},tr.prototype.wrapResult=function(n){var u=this._reporterState;return u.options.partial?{result:this.isError(n)?null:n,errors:u.errors}:n};function Ri(h,n){this.path=h,this.rethrow(n)}sm(Ri,Error),Ri.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ri),!this.stack)try{throw new Error(this.message)}catch(u){this.stack=u.stack}return this};var of={},ho;function so(){if(ho)return of;ho=1;var h=Kt,n=hn().Reporter,u=Ke.Buffer;function s(f,g){if(n.call(this,g),!u.isBuffer(f)){this.error("Input not Buffer");return}this.base=f,this.offset=0,this.length=f.length}h(s,n),of.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(g){var y=new s(this.base);return y.offset=g.offset,y.length=this.offset,this.offset=g.offset,n.prototype.restore.call(this,g.reporter),y},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(g){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(g||"DecoderBuffer overrun")},s.prototype.skip=function(g,y){if(!(this.offset+g<=this.length))return this.error(y||"DecoderBuffer overrun");var S=new s(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+g,this.offset+=g,S},s.prototype.raw=function(g){return this.base.slice(g?g.offset:this.offset,this.length)};function m(f,g){if(Array.isArray(f))this.length=0,this.value=f.map(function(y){return y instanceof m||(y=new m(y,g)),this.length+=y.length,y},this);else if(typeof f=="number"){if(!(0<=f&&f<=255))return g.error("non-byte EncoderBuffer value");this.value=f,this.length=1}else if(typeof f=="string")this.value=f,this.length=u.byteLength(f);else if(u.isBuffer(f))this.value=f,this.length=f.length;else return g.error("Unsupported type: "+typeof f)}return of.EncoderBuffer=m,m.prototype.join=function(g,y){return g||(g=new u(this.length)),y||(y=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(g,y),y+=S.length}):(typeof this.value=="number"?g[y]=this.value:typeof this.value=="string"?g.write(this.value,y):u.isBuffer(this.value)&&this.value.copy(g,y),y+=this.length)),g},of}var F0,oo;function om(){if(oo)return F0;oo=1;var h=hn().Reporter,n=hn().EncoderBuffer,u=hn().DecoderBuffer,s=Ye,m=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(m),g=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function y(B,M){var x={};this._baseState=x,x.enc=B,x.parent=M||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,x.parent||(x.children=[],this._wrap())}F0=y;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return y.prototype.clone=function(){var M=this._baseState,x={};S.forEach(function(k){x[k]=M[k]});var I=new this.constructor(x.parent);return I._baseState=x,I},y.prototype._wrap=function(){var M=this._baseState;f.forEach(function(x){this[x]=function(){var k=new this.constructor(this);return M.children.push(k),k[x].apply(k,arguments)}},this)},y.prototype._init=function(M){var x=this._baseState;s(x.parent===null),M.call(this),x.children=x.children.filter(function(I){return I._baseState.parent===this},this),s.equal(x.children.length,1,"Root node can have only one child")},y.prototype._useArgs=function(M){var x=this._baseState,I=M.filter(function(k){return k instanceof this.constructor},this);M=M.filter(function(k){return!(k instanceof this.constructor)},this),I.length!==0&&(s(x.children===null),x.children=I,I.forEach(function(k){k._baseState.parent=this},this)),M.length!==0&&(s(x.args===null),x.args=M,x.reverseArgs=M.map(function(k){if(typeof k!="object"||k.constructor!==Object)return k;var D={};return Object.keys(k).forEach(function(L){L==(L|0)&&(L|=0);var W=k[L];D[W]=L}),D}))},g.forEach(function(B){y.prototype[B]=function(){var x=this._baseState;throw new Error(B+" not implemented for encoding: "+x.enc)}}),m.forEach(function(B){y.prototype[B]=function(){var x=this._baseState,I=Array.prototype.slice.call(arguments);return s(x.tag===null),x.tag=B,this._useArgs(I),this}}),y.prototype.use=function(M){s(M);var x=this._baseState;return s(x.use===null),x.use=M,this},y.prototype.optional=function(){var M=this._baseState;return M.optional=!0,this},y.prototype.def=function(M){var x=this._baseState;return s(x.default===null),x.default=M,x.optional=!0,this},y.prototype.explicit=function(M){var x=this._baseState;return s(x.explicit===null&&x.implicit===null),x.explicit=M,this},y.prototype.implicit=function(M){var x=this._baseState;return s(x.explicit===null&&x.implicit===null),x.implicit=M,this},y.prototype.obj=function(){var M=this._baseState,x=Array.prototype.slice.call(arguments);return M.obj=!0,x.length!==0&&this._useArgs(x),this},y.prototype.key=function(M){var x=this._baseState;return s(x.key===null),x.key=M,this},y.prototype.any=function(){var M=this._baseState;return M.any=!0,this},y.prototype.choice=function(M){var x=this._baseState;return s(x.choice===null),x.choice=M,this._useArgs(Object.keys(M).map(function(I){return M[I]})),this},y.prototype.contains=function(M){var x=this._baseState;return s(x.use===null),x.contains=M,this},y.prototype._decode=function(M,x){var I=this._baseState;if(I.parent===null)return M.wrapResult(I.children[0]._decode(M,x));var k=I.default,D=!0,L=null;if(I.key!==null&&(L=M.enterKey(I.key)),I.optional){var W=null;if(I.explicit!==null?W=I.explicit:I.implicit!==null?W=I.implicit:I.tag!==null&&(W=I.tag),W===null&&!I.any){var z=M.save();try{I.choice===null?this._decodeGeneric(I.tag,M,x):this._decodeChoice(M,x),D=!0}catch(Ct){D=!1}M.restore(z)}else if(D=this._peekTag(M,W,I.any),M.isError(D))return D}var $;if(I.obj&&D&&($=M.enterObject()),D){if(I.explicit!==null){var lt=this._decodeTag(M,I.explicit);if(M.isError(lt))return lt;M=lt}var H=M.offset;if(I.use===null&&I.choice===null){if(I.any)var z=M.save();var At=this._decodeTag(M,I.implicit!==null?I.implicit:I.tag,I.any);if(M.isError(At))return At;I.any?k=M.raw(z):M=At}if(x&&x.track&&I.tag!==null&&x.track(M.path(),H,M.length,"tagged"),x&&x.track&&I.tag!==null&&x.track(M.path(),M.offset,M.length,"content"),I.any?k=k:I.choice===null?k=this._decodeGeneric(I.tag,M,x):k=this._decodeChoice(M,x),M.isError(k))return k;if(!I.any&&I.choice===null&&I.children!==null&&I.children.forEach(function(Et){Et._decode(M,x)}),I.contains&&(I.tag==="octstr"||I.tag==="bitstr")){var Bt=new u(k);k=this._getUse(I.contains,M._reporterState.obj)._decode(Bt,x)}}return I.obj&&D&&(k=M.leaveObject($)),I.key!==null&&(k!==null||D===!0)?M.leaveKey(L,I.key,k):L!==null&&M.exitKey(L),k},y.prototype._decodeGeneric=function(M,x,I){var k=this._baseState;return M==="seq"||M==="set"?null:M==="seqof"||M==="setof"?this._decodeList(x,M,k.args[0],I):/str$/.test(M)?this._decodeStr(x,M,I):M==="objid"&&k.args?this._decodeObjid(x,k.args[0],k.args[1],I):M==="objid"?this._decodeObjid(x,null,null,I):M==="gentime"||M==="utctime"?this._decodeTime(x,M,I):M==="null_"?this._decodeNull(x,I):M==="bool"?this._decodeBool(x,I):M==="objDesc"?this._decodeStr(x,M,I):M==="int"||M==="enum"?this._decodeInt(x,k.args&&k.args[0],I):k.use!==null?this._getUse(k.use,x._reporterState.obj)._decode(x,I):x.error("unknown tag: "+M)},y.prototype._getUse=function(M,x){var I=this._baseState;return I.useDecoder=this._use(M,x),s(I.useDecoder._baseState.parent===null),I.useDecoder=I.useDecoder._baseState.children[0],I.implicit!==I.useDecoder._baseState.implicit&&(I.useDecoder=I.useDecoder.clone(),I.useDecoder._baseState.implicit=I.implicit),I.useDecoder},y.prototype._decodeChoice=function(M,x){var I=this._baseState,k=null,D=!1;return Object.keys(I.choice).some(function(L){var W=M.save(),z=I.choice[L];try{var $=z._decode(M,x);if(M.isError($))return!1;k={type:L,value:$},D=!0}catch(lt){return M.restore(W),!1}return!0},this),D?k:M.error("Choice not matched")},y.prototype._createEncoderBuffer=function(M){return new n(M,this.reporter)},y.prototype._encode=function(M,x,I){var k=this._baseState;if(!(k.default!==null&&k.default===M)){var D=this._encodeValue(M,x,I);if(D!==void 0&&!this._skipDefault(D,x,I))return D}},y.prototype._encodeValue=function(M,x,I){var k=this._baseState;if(k.parent===null)return k.children[0]._encode(M,x||new h);var z=null;if(this.reporter=x,k.optional&&M===void 0)if(k.default!==null)M=k.default;else return;var D=null,L=!1;if(k.any)z=this._createEncoderBuffer(M);else if(k.choice)z=this._encodeChoice(M,x);else if(k.contains)D=this._getUse(k.contains,I)._encode(M,x),L=!0;else if(k.children)D=k.children.map(function(H){if(H._baseState.tag==="null_")return H._encode(null,x,M);if(H._baseState.key===null)return x.error("Child should have a key");var At=x.enterKey(H._baseState.key);if(typeof M!="object")return x.error("Child expected, but input is not object");var Bt=H._encode(M[H._baseState.key],x,M);return x.leaveKey(At),Bt},this).filter(function(H){return H}),D=this._createEncoderBuffer(D);else if(k.tag==="seqof"||k.tag==="setof"){if(!(k.args&&k.args.length===1))return x.error("Too many args for : "+k.tag);if(!Array.isArray(M))return x.error("seqof/setof, but data is not Array");var W=this.clone();W._baseState.implicit=null,D=this._createEncoderBuffer(M.map(function(H){var At=this._baseState;return this._getUse(At.args[0],M)._encode(H,x)},W))}else k.use!==null?z=this._getUse(k.use,I)._encode(M,x):(D=this._encodePrimitive(k.tag,M),L=!0);var z;if(!k.any&&k.choice===null){var $=k.implicit!==null?k.implicit:k.tag,lt=k.implicit===null?"universal":"context";$===null?k.use===null&&x.error("Tag could be omitted only for .use()"):k.use===null&&(z=this._encodeComposite($,L,lt,D))}return k.explicit!==null&&(z=this._encodeComposite(k.explicit,!1,"context",z)),z},y.prototype._encodeChoice=function(M,x){var I=this._baseState,k=I.choice[M.type];return k||s(!1,M.type+" not found in "+JSON.stringify(Object.keys(I.choice))),k._encode(M.value,x)},y.prototype._encodePrimitive=function(M,x){var I=this._baseState;if(/str$/.test(M))return this._encodeStr(x,M);if(M==="objid"&&I.args)return this._encodeObjid(x,I.reverseArgs[0],I.args[1]);if(M==="objid")return this._encodeObjid(x,null,null);if(M==="gentime"||M==="utctime")return this._encodeTime(x,M);if(M==="null_")return this._encodeNull();if(M==="int"||M==="enum")return this._encodeInt(x,I.args&&I.reverseArgs[0]);if(M==="bool")return this._encodeBool(x);if(M==="objDesc")return this._encodeStr(x,M);throw new Error("Unsupported tag: "+M)},y.prototype._isNumstr=function(M){return/^[0-9 ]*$/.test(M)},y.prototype._isPrintstr=function(M){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(M)},F0}var uo;function hn(){return uo||(uo=1,function(h){var n=h;n.Reporter=ao.Reporter,n.DecoderBuffer=so().DecoderBuffer,n.EncoderBuffer=so().EncoderBuffer,n.Node=om()}(C0)),C0}var q0={},P0={},lo;function um(){return lo||(lo=1,function(h){var n=vo();h.tagClass={0:"universal",1:"application",2:"context",3:"private"},h.tagClassByName=n._reverse(h.tagClass),h.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},h.tagByName=n._reverse(h.tag)}(P0)),P0}var co;function vo(){return co||(co=1,function(h){var n=h;n._reverse=function(s){var m={};return Object.keys(s).forEach(function(f){(f|0)==f&&(f=f|0);var g=s[f];m[g]=f}),m},n.der=um()}(q0)),q0}var D0={},N0,po;function mo(){if(po)return N0;po=1;var h=Kt,n=sn(),u=n.base,s=n.bignum,m=n.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}N0=f,f.prototype.decode=function(M,x){return M instanceof u.DecoderBuffer||(M=new u.DecoderBuffer(M,x)),this.tree._decode(M,x)};function g(B){u.Node.call(this,"der",B)}h(g,u.Node),g.prototype._peekTag=function(M,x,I){if(M.isEmpty())return!1;var k=M.save(),D=y(M,'Failed to peek tag: "'+x+'"');return M.isError(D)?D:(M.restore(k),D.tag===x||D.tagStr===x||D.tagStr+"of"===x||I)},g.prototype._decodeTag=function(M,x,I){var k=y(M,'Failed to decode tag of "'+x+'"');if(M.isError(k))return k;var D=S(M,k.primitive,'Failed to get length of "'+x+'"');if(M.isError(D))return D;if(!I&&k.tag!==x&&k.tagStr!==x&&k.tagStr+"of"!==x)return M.error('Failed to match tag: "'+x+'"');if(k.primitive||D!==null)return M.skip(D,'Failed to match body of: "'+x+'"');var L=M.save(),W=this._skipUntilEnd(M,'Failed to skip indefinite length body: "'+this.tag+'"');return M.isError(W)?W:(D=M.offset-L.offset,M.restore(L),M.skip(D,'Failed to match body of: "'+x+'"'))},g.prototype._skipUntilEnd=function(M,x){for(;;){var I=y(M,x);if(M.isError(I))return I;var k=S(M,I.primitive,x);if(M.isError(k))return k;var D;if(I.primitive||k!==null?D=M.skip(k):D=this._skipUntilEnd(M,x),M.isError(D))return D;if(I.tagStr==="end")break}},g.prototype._decodeList=function(M,x,I,k){for(var D=[];!M.isEmpty();){var L=this._peekTag(M,"end");if(M.isError(L))return L;var W=I.decode(M,"der",k);if(M.isError(W)&&L)break;D.push(W)}return D},g.prototype._decodeStr=function(M,x){if(x==="bitstr"){var I=M.readUInt8();return M.isError(I)?I:{unused:I,data:M.raw()}}else if(x==="bmpstr"){var k=M.raw();if(k.length%2===1)return M.error("Decoding of string type: bmpstr length mismatch");for(var D="",L=0;L<k.length/2;L++)D+=String.fromCharCode(k.readUInt16BE(L*2));return D}else if(x==="numstr"){var W=M.raw().toString("ascii");return this._isNumstr(W)?W:M.error("Decoding of string type: numstr unsupported characters")}else{if(x==="octstr")return M.raw();if(x==="objDesc")return M.raw();if(x==="printstr"){var z=M.raw().toString("ascii");return this._isPrintstr(z)?z:M.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(x)?M.raw().toString():M.error("Decoding of string type: "+x+" unsupported")}},g.prototype._decodeObjid=function(M,x,I){for(var k,D=[],L=0;!M.isEmpty();){var W=M.readUInt8();L<<=7,L|=W&127,W&128||(D.push(L),L=0)}W&128&&D.push(L);var z=D[0]/40|0,$=D[0]%40;if(I?k=D:k=[z,$].concat(D.slice(1)),x){var lt=x[k.join(" ")];lt===void 0&&(lt=x[k.join(".")]),lt!==void 0&&(k=lt)}return k},g.prototype._decodeTime=function(M,x){var I=M.raw().toString();if(x==="gentime")var k=I.slice(0,4)|0,D=I.slice(4,6)|0,L=I.slice(6,8)|0,W=I.slice(8,10)|0,z=I.slice(10,12)|0,$=I.slice(12,14)|0;else if(x==="utctime"){var k=I.slice(0,2)|0,D=I.slice(2,4)|0,L=I.slice(4,6)|0,W=I.slice(6,8)|0,z=I.slice(8,10)|0,$=I.slice(10,12)|0;k<70?k=2e3+k:k=1900+k}else return M.error("Decoding "+x+" time is not supported yet");return Date.UTC(k,D-1,L,W,z,$,0)},g.prototype._decodeNull=function(M){return null},g.prototype._decodeBool=function(M){var x=M.readUInt8();return M.isError(x)?x:x!==0},g.prototype._decodeInt=function(M,x){var I=M.raw(),k=new s(I);return x&&(k=x[k.toString(10)]||k),k},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getDecoder("der").tree};function y(B,M){var x=B.readUInt8(M);if(B.isError(x))return x;var I=m.tagClass[x>>6],k=(x&32)===0;if((x&31)===31){var D=x;for(x=0;(D&128)===128;){if(D=B.readUInt8(M),B.isError(D))return D;x<<=7,x|=D&127}}else x&=31;var L=m.tag[x];return{cls:I,primitive:k,tag:x,tagStr:L}}function S(B,M,x){var I=B.readUInt8(x);if(B.isError(I))return I;if(!M&&I===128)return null;if(!(I&128))return I;var k=I&127;if(k>4)return B.error("length octect is too long");I=0;for(var D=0;D<k;D++){I<<=8;var L=B.readUInt8(x);if(B.isError(L))return L;I|=L}return I}return N0}var $0,go;function lm(){if(go)return $0;go=1;var h=Kt,n=Ke.Buffer,u=mo();function s(m){u.call(this,m),this.enc="pem"}return h(s,u),$0=s,s.prototype.decode=function(f,g){for(var y=f.toString().split(/[\r\n]+/g),S=g.label.toUpperCase(),B=/^-----(BEGIN|END) ([^-]+)-----$/,M=-1,x=-1,I=0;I<y.length;I++){var k=y[I].match(B);if(k!==null&&k[2]===S)if(M===-1){if(k[1]!=="BEGIN")break;M=I}else{if(k[1]!=="END")break;x=I;break}}if(M===-1||x===-1)throw new Error("PEM section not found for: "+S);var D=y.slice(M+1,x).join("");D.replace(/[^a-z0-9\+\/=]+/gi,"");var L=new n(D,"base64");return u.prototype.decode.call(this,L,g)},$0}var bo;function dm(){return bo||(bo=1,function(h){var n=h;n.der=mo(),n.pem=lm()}(D0)),D0}var U0={},L0,yo;function wo(){if(yo)return L0;yo=1;var h=Kt,n=Ke.Buffer,u=sn(),s=u.base,m=u.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}L0=f,f.prototype.encode=function(M,x){return this.tree._encode(M,x).join()};function g(B){s.Node.call(this,"der",B)}h(g,s.Node),g.prototype._encodeComposite=function(M,x,I,k){var D=S(M,x,I,this.reporter);if(k.length<128){var z=new n(2);return z[0]=D,z[1]=k.length,this._createEncoderBuffer([z,k])}for(var L=1,W=k.length;W>=256;W>>=8)L++;var z=new n(1+1+L);z[0]=D,z[1]=128|L;for(var W=1+L,$=k.length;$>0;W--,$>>=8)z[W]=$&255;return this._createEncoderBuffer([z,k])},g.prototype._encodeStr=function(M,x){if(x==="bitstr")return this._createEncoderBuffer([M.unused|0,M.data]);if(x==="bmpstr"){for(var I=new n(M.length*2),k=0;k<M.length;k++)I.writeUInt16BE(M.charCodeAt(k),k*2);return this._createEncoderBuffer(I)}else return x==="numstr"?this._isNumstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: numstr supports only digits and space"):x==="printstr"?this._isPrintstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(x)?this._createEncoderBuffer(M):x==="objDesc"?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: "+x+" unsupported")},g.prototype._encodeObjid=function(M,x,I){if(typeof M=="string"){if(!x)return this.reporter.error("string objid given, but no values map found");if(!x.hasOwnProperty(M))return this.reporter.error("objid not found in values map");M=x[M].split(/[\s\.]+/g);for(var k=0;k<M.length;k++)M[k]|=0}else if(Array.isArray(M)){M=M.slice();for(var k=0;k<M.length;k++)M[k]|=0}if(!Array.isArray(M))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(M));if(!I){if(M[1]>=40)return this.reporter.error("Second objid identifier OOB");M.splice(0,2,M[0]*40+M[1])}for(var D=0,k=0;k<M.length;k++){var L=M[k];for(D++;L>=128;L>>=7)D++}for(var W=new n(D),z=W.length-1,k=M.length-1;k>=0;k--){var L=M[k];for(W[z--]=L&127;(L>>=7)>0;)W[z--]=128|L&127}return this._createEncoderBuffer(W)};function y(B){return B<10?"0"+B:B}g.prototype._encodeTime=function(M,x){var I,k=new Date(M);return x==="gentime"?I=[y(k.getFullYear()),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):x==="utctime"?I=[y(k.getFullYear()%100),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+x+" time is not supported yet"),this._encodeStr(I,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(M,x){if(typeof M=="string"){if(!x)return this.reporter.error("String int or enum given, but no values map");if(!x.hasOwnProperty(M))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(M));M=x[M]}if(typeof M!="number"&&!n.isBuffer(M)){var I=M.toArray();!M.sign&&I[0]&128&&I.unshift(0),M=new n(I)}if(n.isBuffer(M)){var k=M.length;M.length===0&&k++;var L=new n(k);return M.copy(L),M.length===0&&(L[0]=0),this._createEncoderBuffer(L)}if(M<128)return this._createEncoderBuffer(M);if(M<256)return this._createEncoderBuffer([0,M]);for(var k=1,D=M;D>=256;D>>=8)k++;for(var L=new Array(k),D=L.length-1;D>=0;D--)L[D]=M&255,M>>=8;return L[0]&128&&L.unshift(0),this._createEncoderBuffer(new n(L))},g.prototype._encodeBool=function(M){return this._createEncoderBuffer(M?255:0)},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getEncoder("der").tree},g.prototype._skipDefault=function(M,x,I){var k=this._baseState,D;if(k.default===null)return!1;var L=M.join();if(k.defaultBuffer===void 0&&(k.defaultBuffer=this._encodeValue(k.default,x,I).join()),L.length!==k.defaultBuffer.length)return!1;for(D=0;D<L.length;D++)if(L[D]!==k.defaultBuffer[D])return!1;return!0};function S(B,M,x,I){var k;if(B==="seqof"?B="seq":B==="setof"&&(B="set"),m.tagByName.hasOwnProperty(B))k=m.tagByName[B];else if(typeof B=="number"&&(B|0)===B)k=B;else return I.error("Unknown tag: "+B);return k>=31?I.error("Multi-octet tag encoding unsupported"):(M||(k|=32),k|=m.tagClassByName[x||"universal"]<<6,k)}return L0}var O0,Mo;function cm(){if(Mo)return O0;Mo=1;var h=Kt,n=wo();function u(s){n.call(this,s),this.enc="pem"}return h(u,n),O0=u,u.prototype.encode=function(m,f){for(var g=n.prototype.encode.call(this,m),y=g.toString("base64"),S=["-----BEGIN "+f.label+"-----"],B=0;B<y.length;B+=64)S.push(y.slice(B,B+64));return S.push("-----END "+f.label+"-----"),S.join(`
|
|
15
|
-
`)},O0}var xo;function vm(){return xo||(xo=1,function(h){var n=h;n.der=wo(),n.pem=cm()}(U0)),U0}var _o;function sn(){return _o||(_o=1,function(h){var n=h;n.bignum=am,n.define=hm().define,n.base=hn(),n.constants=vo(),n.decoders=dm(),n.encoders=vm()}(I0)),I0}var ar=sn(),So=ar.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),pm=ar.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),z0=ar.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),mm=ar.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(z0),this.key("subjectPublicKey").bitstr())}),gm=ar.define("RelativeDistinguishedName",function(){this.setof(pm)}),bm=ar.define("RDNSequence",function(){this.seqof(gm)}),Ao=ar.define("Name",function(){this.choice({rdnSequence:this.use(bm)})}),ym=ar.define("Validity",function(){this.seq().obj(this.key("notBefore").use(So),this.key("notAfter").use(So))}),wm=ar.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),Mm=ar.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(z0),this.key("issuer").use(Ao),this.key("validity").use(ym),this.key("subject").use(Ao),this.key("subjectPublicKeyInfo").use(mm),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(wm).optional())}),xm=ar.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(Mm),this.key("signatureAlgorithm").use(z0),this.key("signatureValue").bitstr())}),_m=xm,hr=sn();fr.certificate=_m;var Sm=hr.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});fr.RSAPrivateKey=Sm;var Am=hr.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});fr.RSAPublicKey=Am;var Bo=hr.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),Bm=hr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Bo),this.key("subjectPublicKey").bitstr())});fr.PublicKey=Bm;var Em=hr.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(Bo),this.key("subjectPrivateKey").octstr())});fr.PrivateKey=Em;var km=hr.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});fr.EncryptedPrivateKey=km;var Im=hr.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});fr.DSAPrivateKey=Im,fr.DSAparam=hr.define("DSAparam",function(){this.int()});var Rm=hr.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),Tm=hr.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(Rm),this.key("publicKey").optional().explicit(1).bitstr())});fr.ECPrivateKey=Tm,fr.signature=hr.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const Cm={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var Fm=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,qm=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,Pm=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,Dm=Ln,Nm=Ze,uf=zt.Buffer,$m=function(h,n){var u=h.toString(),s=u.match(Fm),m;if(s){var g="aes"+s[1],y=uf.from(s[2],"hex"),S=uf.from(s[3].replace(/[\r\n]/g,""),"base64"),B=Dm(n,y.slice(0,8),parseInt(s[1],10)).key,M=[],x=Nm.createDecipheriv(g,B,y);M.push(x.update(S)),M.push(x.final()),m=uf.concat(M)}else{var f=u.match(Pm);m=uf.from(f[2].replace(/[\r\n]/g,""),"base64")}var I=u.match(qm)[1];return{tag:I,data:m}},ze=fr,Um=Cm,Lm=$m,Om=Ze,zm=_n,K0=zt.Buffer;function Km(h,n){var u=h.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(),10),m=Um[h.algorithm.decrypt.cipher.algo.join(".")],f=h.algorithm.decrypt.cipher.iv,g=h.subjectPrivateKey,y=parseInt(m.split("-")[1],10)/8,S=zm.pbkdf2Sync(n,u,s,y,"sha1"),B=Om.createDecipheriv(m,S,f),M=[];return M.push(B.update(g)),M.push(B.final()),K0.concat(M)}function Eo(h){var n;typeof h=="object"&&!K0.isBuffer(h)&&(n=h.passphrase,h=h.key),typeof h=="string"&&(h=K0.from(h));var u=Lm(h,n),s=u.tag,m=u.data,f,g;switch(s){case"CERTIFICATE":g=ze.certificate.decode(m,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(g||(g=ze.PublicKey.decode(m,"der")),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return ze.RSAPublicKey.decode(g.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return g.subjectPrivateKey=g.subjectPublicKey,{type:"ec",data:g};case"1.2.840.10040.4.1":return g.algorithm.params.pub_key=ze.DSAparam.decode(g.subjectPublicKey.data,"der"),{type:"dsa",data:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"ENCRYPTED PRIVATE KEY":m=ze.EncryptedPrivateKey.decode(m,"der"),m=Km(m,n);case"PRIVATE KEY":switch(g=ze.PrivateKey.decode(m,"der"),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return ze.RSAPrivateKey.decode(g.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:g.algorithm.curve,privateKey:ze.ECPrivateKey.decode(g.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return g.algorithm.params.priv_key=ze.DSAparam.decode(g.subjectPrivateKey,"der"),{type:"dsa",params:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"RSA PUBLIC KEY":return ze.RSAPublicKey.decode(m,"der");case"RSA PRIVATE KEY":return ze.RSAPrivateKey.decode(m,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:ze.DSAPrivateKey.decode(m,"der")};case"EC PRIVATE KEY":return m=ze.ECPrivateKey.decode(m,"der"),{curve:m.parameters.value,privateKey:m.privateKey};default:throw new Error("unknown key type "+s)}}Eo.signature=ze.signature;var lf=Eo;const ko={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var Io;function Hm(){if(Io)return en.exports;Io=1;var h=zt.Buffer,n=La,u=l0,s=k0().ec,m=u0,f=lf,g=ko,y=1;function S(z,$,lt,H,At){var Bt=f($);if(Bt.curve){if(H!=="ecdsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");return B(z,Bt)}else if(Bt.type==="dsa"){if(H!=="dsa")throw new Error("wrong private key type");return M(z,Bt,lt)}if(H!=="rsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");if($.padding!==void 0&&$.padding!==y)throw new Error("illegal or unsupported padding mode");z=h.concat([At,z]);for(var Ct=Bt.modulus.byteLength(),Et=[0,1];z.length+Et.length+1<Ct;)Et.push(255);Et.push(0);for(var Y=-1;++Y<z.length;)Et.push(z[Y]);var It=u(Et,Bt);return It}function B(z,$){var lt=g[$.curve.join(".")];if(!lt)throw new Error("unknown curve "+$.curve.join("."));var H=new s(lt),At=H.keyFromPrivate($.privateKey),Bt=At.sign(z);return h.from(Bt.toDER())}function M(z,$,lt){for(var H=$.params.priv_key,At=$.params.p,Bt=$.params.q,Ct=$.params.g,Et=new m(0),Y,It=k(z,Bt).mod(Bt),p=!1,t=I(H,Bt,z,lt);p===!1;)Y=L(Bt,t,lt),Et=W(Ct,Y,At,Bt),p=Y.invm(Bt).imul(It.add(H.mul(Et))).mod(Bt),p.cmpn(0)===0&&(p=!1,Et=new m(0));return x(Et,p)}function x(z,$){z=z.toArray(),$=$.toArray(),z[0]&128&&(z=[0].concat(z)),$[0]&128&&($=[0].concat($));var lt=z.length+$.length+4,H=[48,lt,2,z.length];return H=H.concat(z,[2,$.length],$),h.from(H)}function I(z,$,lt,H){if(z=h.from(z.toArray()),z.length<$.byteLength()){var At=h.alloc($.byteLength()-z.length);z=h.concat([At,z])}var Bt=lt.length,Ct=D(lt,$),Et=h.alloc(Bt);Et.fill(1);var Y=h.alloc(Bt);return Y=n(H,Y).update(Et).update(h.from([0])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),Y=n(H,Y).update(Et).update(h.from([1])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),{k:Y,v:Et}}function k(z,$){var lt=new m(z),H=(z.length<<3)-$.bitLength();return H>0&<.ishrn(H),lt}function D(z,$){z=k(z,$),z=z.mod($);var lt=h.from(z.toArray());if(lt.length<$.byteLength()){var H=h.alloc($.byteLength()-lt.length);lt=h.concat([H,lt])}return lt}function L(z,$,lt){var H,At;do{for(H=h.alloc(0);H.length*8<z.bitLength();)$.v=n(lt,$.k).update($.v).digest(),H=h.concat([H,$.v]);At=k(H,z),$.k=n(lt,$.k).update($.v).update(h.from([0])).digest(),$.v=n(lt,$.k).update($.v).digest()}while(At.cmp(z)!==-1);return At}function W(z,$,lt,H){return z.toRed(m.mont(lt)).redPow($).fromRed().mod(H)}return en.exports=S,en.exports.getKey=I,en.exports.makeKey=L,en.exports}var H0,Ro;function Zm(){if(Ro)return H0;Ro=1;var h=zt.Buffer,n=u0,u=k0().ec,s=lf,m=ko;function f(B,M,x,I,k){var D=s(x);if(D.type==="ec"){if(I!=="ecdsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");return g(B,M,D)}else if(D.type==="dsa"){if(I!=="dsa")throw new Error("wrong public key type");return y(B,M,D)}if(I!=="rsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");M=h.concat([k,M]);for(var L=D.modulus.byteLength(),W=[1],z=0;M.length+W.length+2<L;)W.push(255),z+=1;W.push(0);for(var $=-1;++$<M.length;)W.push(M[$]);W=h.from(W);var lt=n.mont(D.modulus);B=new n(B).toRed(lt),B=B.redPow(new n(D.publicExponent)),B=h.from(B.fromRed().toArray());var H=z<8?1:0;for(L=Math.min(B.length,W.length),B.length!==W.length&&(H=1),$=-1;++$<L;)H|=B[$]^W[$];return H===0}function g(B,M,x){var I=m[x.data.algorithm.curve.join(".")];if(!I)throw new Error("unknown curve "+x.data.algorithm.curve.join("."));var k=new u(I),D=x.data.subjectPrivateKey.data;return k.verify(M,B,D)}function y(B,M,x){var I=x.data.p,k=x.data.q,D=x.data.g,L=x.data.pub_key,W=s.signature.decode(B,"der"),z=W.s,$=W.r;S(z,k),S($,k);var lt=n.mont(I),H=z.invm(k),At=D.toRed(lt).redPow(new n(M).mul(H).mod(k)).fromRed().mul(L.toRed(lt).redPow($.mul(H).mod(k)).fromRed()).mod(I).mod(k);return At.cmp($)===0}function S(B,M){if(B.cmpn(0)<=0)throw new Error("invalid sig");if(B.cmp(M)>=0)throw new Error("invalid sig")}return H0=f,H0}var Z0,To;function Wm(){if(To)return Z0;To=1;var h=zt.Buffer,n=Ki,u=rv,s=Kt,m=Hm(),f=Zm(),g=Oa;Object.keys(g).forEach(function(x){g[x].id=h.from(g[x].id,"hex"),g[x.toLowerCase()]=g[x]});function y(x){u.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hashType=I.hash,this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}s(y,u.Writable),y.prototype._write=function(I,k,D){this._hash.update(I),D()},y.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},y.prototype.sign=function(I,k){this.end();var D=this._hash.digest(),L=m(D,I,this._hashType,this._signType,this._tag);return k?L.toString(k):L};function S(x){u.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}s(S,u.Writable),S.prototype._write=function(I,k,D){this._hash.update(I),D()},S.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},S.prototype.verify=function(I,k,D){var L=typeof k=="string"?h.from(k,D):k;this.end();var W=this._hash.digest();return f(L,W,I,this._signType,this._tag)};function B(x){return new y(x)}function M(x){return new S(x)}return Z0={Sign:B,Verify:M,createSign:B,createVerify:M},Z0}var W0={exports:{}};W0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(W0);var Vm=W0.exports,V0,Co;function Ym(){if(Co)return V0;Co=1;var h=k0(),n=Vm;V0=function(g){return new s(g)};var u={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};u.p224=u.secp224r1,u.p256=u.secp256r1=u.prime256v1,u.p192=u.secp192r1=u.prime192v1,u.p384=u.secp384r1,u.p521=u.secp521r1;function s(f){this.curveType=u[f],this.curveType||(this.curveType={name:f}),this.curve=new h.ec(this.curveType.name),this.keys=void 0}s.prototype.generateKeys=function(f,g){return this.keys=this.curve.genKeyPair(),this.getPublicKey(f,g)},s.prototype.computeSecret=function(f,g,y){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var S=this.curve.keyFromPublic(f).getPublic(),B=S.mul(this.keys.getPrivate()).getX();return m(B,y,this.curveType.byteLength)},s.prototype.getPublicKey=function(f,g){var y=this.keys.getPublic(g==="compressed",!0);return g==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),m(y,f)},s.prototype.getPrivateKey=function(f){return m(this.keys.getPrivate(),f)},s.prototype.setPublicKey=function(f,g){return g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g)),this.keys._importPublic(f),this},s.prototype.setPrivateKey=function(f,g){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var y=new n(f);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function m(f,g,y){Array.isArray(f)||(f=f.toArray());var S=new mt(f);if(y&&S.length<y){var B=new mt(y-S.length);B.fill(0),S=mt.concat([B,S])}return g?S.toString(g):S}return V0}var Fo={},Jm=Ki,Y0=zt.Buffer,qo=function(h,n){for(var u=Y0.alloc(0),s=0,m;u.length<n;)m=Gm(s++),u=Y0.concat([u,Jm("sha1").update(h).update(m).digest()]);return u.slice(0,n)};function Gm(h){var n=Y0.allocUnsafe(4);return n.writeUInt32BE(h,0),n}var Po=function(n,u){for(var s=n.length,m=-1;++m<s;)n[m]^=u[m];return n},J0={exports:{}};J0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(J0);var G0=J0.exports,Do=G0,Xm=zt.Buffer;function jm(h,n){return Xm.from(h.toRed(Do.mont(n.modulus)).redPow(new Do(n.publicExponent)).fromRed().toArray())}var No=jm,Qm=lf,X0=li,t2=Ki,$o=qo,Uo=Po,j0=G0,e2=No,r2=l0,sr=zt.Buffer,i2=function(n,u,s){var m;n.padding?m=n.padding:s?m=1:m=4;var f=Qm(n),g;if(m===4)g=n2(f,u);else if(m===1)g=f2(f,u,s);else if(m===3){if(g=new j0(u),g.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return s?r2(g,f):e2(g,f)};function n2(h,n){var u=h.modulus.byteLength(),s=n.length,m=t2("sha1").update(sr.alloc(0)).digest(),f=m.length,g=2*f;if(s>u-g-2)throw new Error("message too long");var y=sr.alloc(u-s-g-2),S=u-f-1,B=X0(f),M=Uo(sr.concat([m,y,sr.alloc(1,1),n],S),$o(B,S)),x=Uo(B,$o(M,f));return new j0(sr.concat([sr.alloc(1),x,M],u))}function f2(h,n,u){var s=n.length,m=h.modulus.byteLength();if(s>m-11)throw new Error("message too long");var f;return u?f=sr.alloc(m-s-3,255):f=a2(m-s-3),new j0(sr.concat([sr.from([0,u?1:2]),f,sr.alloc(1),n],m))}function a2(h){for(var n=sr.allocUnsafe(h),u=0,s=X0(h*2),m=0,f;u<h;)m===s.length&&(s=X0(h*2),m=0),f=s[m++],f&&(n[u++]=f);return n}var h2=lf,Lo=qo,Oo=Po,zo=G0,s2=l0,o2=Ki,u2=No,on=zt.Buffer,l2=function(n,u,s){var m;n.padding?m=n.padding:s?m=1:m=4;var f=h2(n),g=f.modulus.byteLength();if(u.length>g||new zo(u).cmp(f.modulus)>=0)throw new Error("decryption error");var y;s?y=u2(new zo(u),f):y=s2(u,f);var S=on.alloc(g-y.length);if(y=on.concat([S,y],g),m===4)return d2(f,y);if(m===1)return c2(f,y,s);if(m===3)return y;throw new Error("unknown padding")};function d2(h,n){var u=h.modulus.byteLength(),s=o2("sha1").update(on.alloc(0)).digest(),m=s.length;if(n[0]!==0)throw new Error("decryption error");var f=n.slice(1,m+1),g=n.slice(m+1),y=Oo(f,Lo(g,m)),S=Oo(g,Lo(y,u-m-1));if(v2(s,S.slice(0,m)))throw new Error("decryption error");for(var B=m;S[B]===0;)B++;if(S[B++]!==1)throw new Error("decryption error");return S.slice(B)}function c2(h,n,u){for(var s=n.slice(0,2),m=2,f=0;n[m++]!==0;)if(m>=n.length){f++;break}var g=n.slice(2,m-1);if((s.toString("hex")!=="0002"&&!u||s.toString("hex")!=="0001"&&u)&&f++,g.length<8&&f++,f)throw new Error("decryption error");return n.slice(m)}function v2(h,n){h=on.from(h),n=on.from(n);var u=0,s=h.length;h.length!==n.length&&(u++,s=Math.min(h.length,n.length));for(var m=-1;++m<s;)u+=h[m]^n[m];return u}(function(h){h.publicEncrypt=i2,h.privateDecrypt=l2,h.privateEncrypt=function(u,s){return h.publicEncrypt(u,s,!0)},h.publicDecrypt=function(u,s){return h.privateDecrypt(u,s,!0)}})(Fo);var un={};function Ko(){throw new Error(`secure random number generation not supported by this browser
|
|
16
|
-
use chrome, FireFox or Internet Explorer 11`)}var Ho=zt,Zo=li,Wo=Ho.Buffer,Vo=Ho.kMaxLength,Q0=Ft.crypto||Ft.msCrypto,Yo=Math.pow(2,32)-1;function Jo(h,n){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>Yo||h<0)throw new TypeError("offset must be a uint32");if(h>Vo||h>n)throw new RangeError("offset out of range")}function Go(h,n,u){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>Yo||h<0)throw new TypeError("size must be a uint32");if(h+n>u||h>Vo)throw new RangeError("buffer too small")}Q0&&Q0.getRandomValues||!ye.browser?(un.randomFill=
|
|
14
|
+
})`)}catch(S){y=function(B){this._initNamed(B)}}return u(y,g),y.prototype._initNamed=function(B){g.call(this,B)},new y(this)},m.prototype._getDecoder=function(g){return g=g||"der",this.decoders.hasOwnProperty(g)||(this.decoders[g]=this._createNamed(n.decoders[g])),this.decoders[g]},m.prototype.decode=function(g,y,S){return this._getDecoder(y).decode(g,S)},m.prototype._getEncoder=function(g){return g=g||"der",this.encoders.hasOwnProperty(g)||(this.encoders[g]=this._createNamed(n.encoders[g])),this.encoders[g]},m.prototype.encode=function(g,y,S){return this._getEncoder(y).encode(g,S)}}(T0)),T0}var C0={},ao={},s2=Kt;function tr(h){this._reporterState={obj:null,path:[],options:h||{},errors:[]}}ao.Reporter=tr,tr.prototype.isError=function(n){return n instanceof Ri},tr.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},tr.prototype.restore=function(n){var u=this._reporterState;u.obj=n.obj,u.path=u.path.slice(0,n.pathLen)},tr.prototype.enterKey=function(n){return this._reporterState.path.push(n)},tr.prototype.exitKey=function(n){var u=this._reporterState;u.path=u.path.slice(0,n-1)},tr.prototype.leaveKey=function(n,u,s){var m=this._reporterState;this.exitKey(n),m.obj!==null&&(m.obj[u]=s)},tr.prototype.path=function(){return this._reporterState.path.join("/")},tr.prototype.enterObject=function(){var n=this._reporterState,u=n.obj;return n.obj={},u},tr.prototype.leaveObject=function(n){var u=this._reporterState,s=u.obj;return u.obj=n,s},tr.prototype.error=function(n){var u,s=this._reporterState,m=n instanceof Ri;if(m?u=n:u=new Ri(s.path.map(function(f){return"["+JSON.stringify(f)+"]"}).join(""),n.message||n,n.stack),!s.options.partial)throw u;return m||s.errors.push(u),u},tr.prototype.wrapResult=function(n){var u=this._reporterState;return u.options.partial?{result:this.isError(n)?null:n,errors:u.errors}:n};function Ri(h,n){this.path=h,this.rethrow(n)}s2(Ri,Error),Ri.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ri),!this.stack)try{throw new Error(this.message)}catch(u){this.stack=u.stack}return this};var of={},ho;function so(){if(ho)return of;ho=1;var h=Kt,n=hn().Reporter,u=Ke.Buffer;function s(f,g){if(n.call(this,g),!u.isBuffer(f)){this.error("Input not Buffer");return}this.base=f,this.offset=0,this.length=f.length}h(s,n),of.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(g){var y=new s(this.base);return y.offset=g.offset,y.length=this.offset,this.offset=g.offset,n.prototype.restore.call(this,g.reporter),y},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(g){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(g||"DecoderBuffer overrun")},s.prototype.skip=function(g,y){if(!(this.offset+g<=this.length))return this.error(y||"DecoderBuffer overrun");var S=new s(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+g,this.offset+=g,S},s.prototype.raw=function(g){return this.base.slice(g?g.offset:this.offset,this.length)};function m(f,g){if(Array.isArray(f))this.length=0,this.value=f.map(function(y){return y instanceof m||(y=new m(y,g)),this.length+=y.length,y},this);else if(typeof f=="number"){if(!(0<=f&&f<=255))return g.error("non-byte EncoderBuffer value");this.value=f,this.length=1}else if(typeof f=="string")this.value=f,this.length=u.byteLength(f);else if(u.isBuffer(f))this.value=f,this.length=f.length;else return g.error("Unsupported type: "+typeof f)}return of.EncoderBuffer=m,m.prototype.join=function(g,y){return g||(g=new u(this.length)),y||(y=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(g,y),y+=S.length}):(typeof this.value=="number"?g[y]=this.value:typeof this.value=="string"?g.write(this.value,y):u.isBuffer(this.value)&&this.value.copy(g,y),y+=this.length)),g},of}var F0,oo;function o2(){if(oo)return F0;oo=1;var h=hn().Reporter,n=hn().EncoderBuffer,u=hn().DecoderBuffer,s=Ye,m=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(m),g=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function y(B,M){var x={};this._baseState=x,x.enc=B,x.parent=M||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,x.parent||(x.children=[],this._wrap())}F0=y;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return y.prototype.clone=function(){var M=this._baseState,x={};S.forEach(function(k){x[k]=M[k]});var I=new this.constructor(x.parent);return I._baseState=x,I},y.prototype._wrap=function(){var M=this._baseState;f.forEach(function(x){this[x]=function(){var k=new this.constructor(this);return M.children.push(k),k[x].apply(k,arguments)}},this)},y.prototype._init=function(M){var x=this._baseState;s(x.parent===null),M.call(this),x.children=x.children.filter(function(I){return I._baseState.parent===this},this),s.equal(x.children.length,1,"Root node can have only one child")},y.prototype._useArgs=function(M){var x=this._baseState,I=M.filter(function(k){return k instanceof this.constructor},this);M=M.filter(function(k){return!(k instanceof this.constructor)},this),I.length!==0&&(s(x.children===null),x.children=I,I.forEach(function(k){k._baseState.parent=this},this)),M.length!==0&&(s(x.args===null),x.args=M,x.reverseArgs=M.map(function(k){if(typeof k!="object"||k.constructor!==Object)return k;var D={};return Object.keys(k).forEach(function(L){L==(L|0)&&(L|=0);var W=k[L];D[W]=L}),D}))},g.forEach(function(B){y.prototype[B]=function(){var x=this._baseState;throw new Error(B+" not implemented for encoding: "+x.enc)}}),m.forEach(function(B){y.prototype[B]=function(){var x=this._baseState,I=Array.prototype.slice.call(arguments);return s(x.tag===null),x.tag=B,this._useArgs(I),this}}),y.prototype.use=function(M){s(M);var x=this._baseState;return s(x.use===null),x.use=M,this},y.prototype.optional=function(){var M=this._baseState;return M.optional=!0,this},y.prototype.def=function(M){var x=this._baseState;return s(x.default===null),x.default=M,x.optional=!0,this},y.prototype.explicit=function(M){var x=this._baseState;return s(x.explicit===null&&x.implicit===null),x.explicit=M,this},y.prototype.implicit=function(M){var x=this._baseState;return s(x.explicit===null&&x.implicit===null),x.implicit=M,this},y.prototype.obj=function(){var M=this._baseState,x=Array.prototype.slice.call(arguments);return M.obj=!0,x.length!==0&&this._useArgs(x),this},y.prototype.key=function(M){var x=this._baseState;return s(x.key===null),x.key=M,this},y.prototype.any=function(){var M=this._baseState;return M.any=!0,this},y.prototype.choice=function(M){var x=this._baseState;return s(x.choice===null),x.choice=M,this._useArgs(Object.keys(M).map(function(I){return M[I]})),this},y.prototype.contains=function(M){var x=this._baseState;return s(x.use===null),x.contains=M,this},y.prototype._decode=function(M,x){var I=this._baseState;if(I.parent===null)return M.wrapResult(I.children[0]._decode(M,x));var k=I.default,D=!0,L=null;if(I.key!==null&&(L=M.enterKey(I.key)),I.optional){var W=null;if(I.explicit!==null?W=I.explicit:I.implicit!==null?W=I.implicit:I.tag!==null&&(W=I.tag),W===null&&!I.any){var z=M.save();try{I.choice===null?this._decodeGeneric(I.tag,M,x):this._decodeChoice(M,x),D=!0}catch(Ct){D=!1}M.restore(z)}else if(D=this._peekTag(M,W,I.any),M.isError(D))return D}var $;if(I.obj&&D&&($=M.enterObject()),D){if(I.explicit!==null){var lt=this._decodeTag(M,I.explicit);if(M.isError(lt))return lt;M=lt}var H=M.offset;if(I.use===null&&I.choice===null){if(I.any)var z=M.save();var At=this._decodeTag(M,I.implicit!==null?I.implicit:I.tag,I.any);if(M.isError(At))return At;I.any?k=M.raw(z):M=At}if(x&&x.track&&I.tag!==null&&x.track(M.path(),H,M.length,"tagged"),x&&x.track&&I.tag!==null&&x.track(M.path(),M.offset,M.length,"content"),I.any?k=k:I.choice===null?k=this._decodeGeneric(I.tag,M,x):k=this._decodeChoice(M,x),M.isError(k))return k;if(!I.any&&I.choice===null&&I.children!==null&&I.children.forEach(function(Et){Et._decode(M,x)}),I.contains&&(I.tag==="octstr"||I.tag==="bitstr")){var Bt=new u(k);k=this._getUse(I.contains,M._reporterState.obj)._decode(Bt,x)}}return I.obj&&D&&(k=M.leaveObject($)),I.key!==null&&(k!==null||D===!0)?M.leaveKey(L,I.key,k):L!==null&&M.exitKey(L),k},y.prototype._decodeGeneric=function(M,x,I){var k=this._baseState;return M==="seq"||M==="set"?null:M==="seqof"||M==="setof"?this._decodeList(x,M,k.args[0],I):/str$/.test(M)?this._decodeStr(x,M,I):M==="objid"&&k.args?this._decodeObjid(x,k.args[0],k.args[1],I):M==="objid"?this._decodeObjid(x,null,null,I):M==="gentime"||M==="utctime"?this._decodeTime(x,M,I):M==="null_"?this._decodeNull(x,I):M==="bool"?this._decodeBool(x,I):M==="objDesc"?this._decodeStr(x,M,I):M==="int"||M==="enum"?this._decodeInt(x,k.args&&k.args[0],I):k.use!==null?this._getUse(k.use,x._reporterState.obj)._decode(x,I):x.error("unknown tag: "+M)},y.prototype._getUse=function(M,x){var I=this._baseState;return I.useDecoder=this._use(M,x),s(I.useDecoder._baseState.parent===null),I.useDecoder=I.useDecoder._baseState.children[0],I.implicit!==I.useDecoder._baseState.implicit&&(I.useDecoder=I.useDecoder.clone(),I.useDecoder._baseState.implicit=I.implicit),I.useDecoder},y.prototype._decodeChoice=function(M,x){var I=this._baseState,k=null,D=!1;return Object.keys(I.choice).some(function(L){var W=M.save(),z=I.choice[L];try{var $=z._decode(M,x);if(M.isError($))return!1;k={type:L,value:$},D=!0}catch(lt){return M.restore(W),!1}return!0},this),D?k:M.error("Choice not matched")},y.prototype._createEncoderBuffer=function(M){return new n(M,this.reporter)},y.prototype._encode=function(M,x,I){var k=this._baseState;if(!(k.default!==null&&k.default===M)){var D=this._encodeValue(M,x,I);if(D!==void 0&&!this._skipDefault(D,x,I))return D}},y.prototype._encodeValue=function(M,x,I){var k=this._baseState;if(k.parent===null)return k.children[0]._encode(M,x||new h);var z=null;if(this.reporter=x,k.optional&&M===void 0)if(k.default!==null)M=k.default;else return;var D=null,L=!1;if(k.any)z=this._createEncoderBuffer(M);else if(k.choice)z=this._encodeChoice(M,x);else if(k.contains)D=this._getUse(k.contains,I)._encode(M,x),L=!0;else if(k.children)D=k.children.map(function(H){if(H._baseState.tag==="null_")return H._encode(null,x,M);if(H._baseState.key===null)return x.error("Child should have a key");var At=x.enterKey(H._baseState.key);if(typeof M!="object")return x.error("Child expected, but input is not object");var Bt=H._encode(M[H._baseState.key],x,M);return x.leaveKey(At),Bt},this).filter(function(H){return H}),D=this._createEncoderBuffer(D);else if(k.tag==="seqof"||k.tag==="setof"){if(!(k.args&&k.args.length===1))return x.error("Too many args for : "+k.tag);if(!Array.isArray(M))return x.error("seqof/setof, but data is not Array");var W=this.clone();W._baseState.implicit=null,D=this._createEncoderBuffer(M.map(function(H){var At=this._baseState;return this._getUse(At.args[0],M)._encode(H,x)},W))}else k.use!==null?z=this._getUse(k.use,I)._encode(M,x):(D=this._encodePrimitive(k.tag,M),L=!0);var z;if(!k.any&&k.choice===null){var $=k.implicit!==null?k.implicit:k.tag,lt=k.implicit===null?"universal":"context";$===null?k.use===null&&x.error("Tag could be omitted only for .use()"):k.use===null&&(z=this._encodeComposite($,L,lt,D))}return k.explicit!==null&&(z=this._encodeComposite(k.explicit,!1,"context",z)),z},y.prototype._encodeChoice=function(M,x){var I=this._baseState,k=I.choice[M.type];return k||s(!1,M.type+" not found in "+JSON.stringify(Object.keys(I.choice))),k._encode(M.value,x)},y.prototype._encodePrimitive=function(M,x){var I=this._baseState;if(/str$/.test(M))return this._encodeStr(x,M);if(M==="objid"&&I.args)return this._encodeObjid(x,I.reverseArgs[0],I.args[1]);if(M==="objid")return this._encodeObjid(x,null,null);if(M==="gentime"||M==="utctime")return this._encodeTime(x,M);if(M==="null_")return this._encodeNull();if(M==="int"||M==="enum")return this._encodeInt(x,I.args&&I.reverseArgs[0]);if(M==="bool")return this._encodeBool(x);if(M==="objDesc")return this._encodeStr(x,M);throw new Error("Unsupported tag: "+M)},y.prototype._isNumstr=function(M){return/^[0-9 ]*$/.test(M)},y.prototype._isPrintstr=function(M){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(M)},F0}var uo;function hn(){return uo||(uo=1,function(h){var n=h;n.Reporter=ao.Reporter,n.DecoderBuffer=so().DecoderBuffer,n.EncoderBuffer=so().EncoderBuffer,n.Node=o2()}(C0)),C0}var q0={},P0={},lo;function u2(){return lo||(lo=1,function(h){var n=vo();h.tagClass={0:"universal",1:"application",2:"context",3:"private"},h.tagClassByName=n._reverse(h.tagClass),h.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},h.tagByName=n._reverse(h.tag)}(P0)),P0}var co;function vo(){return co||(co=1,function(h){var n=h;n._reverse=function(s){var m={};return Object.keys(s).forEach(function(f){(f|0)==f&&(f=f|0);var g=s[f];m[g]=f}),m},n.der=u2()}(q0)),q0}var D0={},N0,po;function mo(){if(po)return N0;po=1;var h=Kt,n=sn(),u=n.base,s=n.bignum,m=n.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}N0=f,f.prototype.decode=function(M,x){return M instanceof u.DecoderBuffer||(M=new u.DecoderBuffer(M,x)),this.tree._decode(M,x)};function g(B){u.Node.call(this,"der",B)}h(g,u.Node),g.prototype._peekTag=function(M,x,I){if(M.isEmpty())return!1;var k=M.save(),D=y(M,'Failed to peek tag: "'+x+'"');return M.isError(D)?D:(M.restore(k),D.tag===x||D.tagStr===x||D.tagStr+"of"===x||I)},g.prototype._decodeTag=function(M,x,I){var k=y(M,'Failed to decode tag of "'+x+'"');if(M.isError(k))return k;var D=S(M,k.primitive,'Failed to get length of "'+x+'"');if(M.isError(D))return D;if(!I&&k.tag!==x&&k.tagStr!==x&&k.tagStr+"of"!==x)return M.error('Failed to match tag: "'+x+'"');if(k.primitive||D!==null)return M.skip(D,'Failed to match body of: "'+x+'"');var L=M.save(),W=this._skipUntilEnd(M,'Failed to skip indefinite length body: "'+this.tag+'"');return M.isError(W)?W:(D=M.offset-L.offset,M.restore(L),M.skip(D,'Failed to match body of: "'+x+'"'))},g.prototype._skipUntilEnd=function(M,x){for(;;){var I=y(M,x);if(M.isError(I))return I;var k=S(M,I.primitive,x);if(M.isError(k))return k;var D;if(I.primitive||k!==null?D=M.skip(k):D=this._skipUntilEnd(M,x),M.isError(D))return D;if(I.tagStr==="end")break}},g.prototype._decodeList=function(M,x,I,k){for(var D=[];!M.isEmpty();){var L=this._peekTag(M,"end");if(M.isError(L))return L;var W=I.decode(M,"der",k);if(M.isError(W)&&L)break;D.push(W)}return D},g.prototype._decodeStr=function(M,x){if(x==="bitstr"){var I=M.readUInt8();return M.isError(I)?I:{unused:I,data:M.raw()}}else if(x==="bmpstr"){var k=M.raw();if(k.length%2===1)return M.error("Decoding of string type: bmpstr length mismatch");for(var D="",L=0;L<k.length/2;L++)D+=String.fromCharCode(k.readUInt16BE(L*2));return D}else if(x==="numstr"){var W=M.raw().toString("ascii");return this._isNumstr(W)?W:M.error("Decoding of string type: numstr unsupported characters")}else{if(x==="octstr")return M.raw();if(x==="objDesc")return M.raw();if(x==="printstr"){var z=M.raw().toString("ascii");return this._isPrintstr(z)?z:M.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(x)?M.raw().toString():M.error("Decoding of string type: "+x+" unsupported")}},g.prototype._decodeObjid=function(M,x,I){for(var k,D=[],L=0;!M.isEmpty();){var W=M.readUInt8();L<<=7,L|=W&127,W&128||(D.push(L),L=0)}W&128&&D.push(L);var z=D[0]/40|0,$=D[0]%40;if(I?k=D:k=[z,$].concat(D.slice(1)),x){var lt=x[k.join(" ")];lt===void 0&&(lt=x[k.join(".")]),lt!==void 0&&(k=lt)}return k},g.prototype._decodeTime=function(M,x){var I=M.raw().toString();if(x==="gentime")var k=I.slice(0,4)|0,D=I.slice(4,6)|0,L=I.slice(6,8)|0,W=I.slice(8,10)|0,z=I.slice(10,12)|0,$=I.slice(12,14)|0;else if(x==="utctime"){var k=I.slice(0,2)|0,D=I.slice(2,4)|0,L=I.slice(4,6)|0,W=I.slice(6,8)|0,z=I.slice(8,10)|0,$=I.slice(10,12)|0;k<70?k=2e3+k:k=1900+k}else return M.error("Decoding "+x+" time is not supported yet");return Date.UTC(k,D-1,L,W,z,$,0)},g.prototype._decodeNull=function(M){return null},g.prototype._decodeBool=function(M){var x=M.readUInt8();return M.isError(x)?x:x!==0},g.prototype._decodeInt=function(M,x){var I=M.raw(),k=new s(I);return x&&(k=x[k.toString(10)]||k),k},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getDecoder("der").tree};function y(B,M){var x=B.readUInt8(M);if(B.isError(x))return x;var I=m.tagClass[x>>6],k=(x&32)===0;if((x&31)===31){var D=x;for(x=0;(D&128)===128;){if(D=B.readUInt8(M),B.isError(D))return D;x<<=7,x|=D&127}}else x&=31;var L=m.tag[x];return{cls:I,primitive:k,tag:x,tagStr:L}}function S(B,M,x){var I=B.readUInt8(x);if(B.isError(I))return I;if(!M&&I===128)return null;if(!(I&128))return I;var k=I&127;if(k>4)return B.error("length octect is too long");I=0;for(var D=0;D<k;D++){I<<=8;var L=B.readUInt8(x);if(B.isError(L))return L;I|=L}return I}return N0}var $0,go;function l2(){if(go)return $0;go=1;var h=Kt,n=Ke.Buffer,u=mo();function s(m){u.call(this,m),this.enc="pem"}return h(s,u),$0=s,s.prototype.decode=function(f,g){for(var y=f.toString().split(/[\r\n]+/g),S=g.label.toUpperCase(),B=/^-----(BEGIN|END) ([^-]+)-----$/,M=-1,x=-1,I=0;I<y.length;I++){var k=y[I].match(B);if(k!==null&&k[2]===S)if(M===-1){if(k[1]!=="BEGIN")break;M=I}else{if(k[1]!=="END")break;x=I;break}}if(M===-1||x===-1)throw new Error("PEM section not found for: "+S);var D=y.slice(M+1,x).join("");D.replace(/[^a-z0-9\+\/=]+/gi,"");var L=new n(D,"base64");return u.prototype.decode.call(this,L,g)},$0}var bo;function d2(){return bo||(bo=1,function(h){var n=h;n.der=mo(),n.pem=l2()}(D0)),D0}var U0={},L0,yo;function wo(){if(yo)return L0;yo=1;var h=Kt,n=Ke.Buffer,u=sn(),s=u.base,m=u.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}L0=f,f.prototype.encode=function(M,x){return this.tree._encode(M,x).join()};function g(B){s.Node.call(this,"der",B)}h(g,s.Node),g.prototype._encodeComposite=function(M,x,I,k){var D=S(M,x,I,this.reporter);if(k.length<128){var z=new n(2);return z[0]=D,z[1]=k.length,this._createEncoderBuffer([z,k])}for(var L=1,W=k.length;W>=256;W>>=8)L++;var z=new n(1+1+L);z[0]=D,z[1]=128|L;for(var W=1+L,$=k.length;$>0;W--,$>>=8)z[W]=$&255;return this._createEncoderBuffer([z,k])},g.prototype._encodeStr=function(M,x){if(x==="bitstr")return this._createEncoderBuffer([M.unused|0,M.data]);if(x==="bmpstr"){for(var I=new n(M.length*2),k=0;k<M.length;k++)I.writeUInt16BE(M.charCodeAt(k),k*2);return this._createEncoderBuffer(I)}else return x==="numstr"?this._isNumstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: numstr supports only digits and space"):x==="printstr"?this._isPrintstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(x)?this._createEncoderBuffer(M):x==="objDesc"?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: "+x+" unsupported")},g.prototype._encodeObjid=function(M,x,I){if(typeof M=="string"){if(!x)return this.reporter.error("string objid given, but no values map found");if(!x.hasOwnProperty(M))return this.reporter.error("objid not found in values map");M=x[M].split(/[\s\.]+/g);for(var k=0;k<M.length;k++)M[k]|=0}else if(Array.isArray(M)){M=M.slice();for(var k=0;k<M.length;k++)M[k]|=0}if(!Array.isArray(M))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(M));if(!I){if(M[1]>=40)return this.reporter.error("Second objid identifier OOB");M.splice(0,2,M[0]*40+M[1])}for(var D=0,k=0;k<M.length;k++){var L=M[k];for(D++;L>=128;L>>=7)D++}for(var W=new n(D),z=W.length-1,k=M.length-1;k>=0;k--){var L=M[k];for(W[z--]=L&127;(L>>=7)>0;)W[z--]=128|L&127}return this._createEncoderBuffer(W)};function y(B){return B<10?"0"+B:B}g.prototype._encodeTime=function(M,x){var I,k=new Date(M);return x==="gentime"?I=[y(k.getFullYear()),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):x==="utctime"?I=[y(k.getFullYear()%100),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+x+" time is not supported yet"),this._encodeStr(I,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(M,x){if(typeof M=="string"){if(!x)return this.reporter.error("String int or enum given, but no values map");if(!x.hasOwnProperty(M))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(M));M=x[M]}if(typeof M!="number"&&!n.isBuffer(M)){var I=M.toArray();!M.sign&&I[0]&128&&I.unshift(0),M=new n(I)}if(n.isBuffer(M)){var k=M.length;M.length===0&&k++;var L=new n(k);return M.copy(L),M.length===0&&(L[0]=0),this._createEncoderBuffer(L)}if(M<128)return this._createEncoderBuffer(M);if(M<256)return this._createEncoderBuffer([0,M]);for(var k=1,D=M;D>=256;D>>=8)k++;for(var L=new Array(k),D=L.length-1;D>=0;D--)L[D]=M&255,M>>=8;return L[0]&128&&L.unshift(0),this._createEncoderBuffer(new n(L))},g.prototype._encodeBool=function(M){return this._createEncoderBuffer(M?255:0)},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getEncoder("der").tree},g.prototype._skipDefault=function(M,x,I){var k=this._baseState,D;if(k.default===null)return!1;var L=M.join();if(k.defaultBuffer===void 0&&(k.defaultBuffer=this._encodeValue(k.default,x,I).join()),L.length!==k.defaultBuffer.length)return!1;for(D=0;D<L.length;D++)if(L[D]!==k.defaultBuffer[D])return!1;return!0};function S(B,M,x,I){var k;if(B==="seqof"?B="seq":B==="setof"&&(B="set"),m.tagByName.hasOwnProperty(B))k=m.tagByName[B];else if(typeof B=="number"&&(B|0)===B)k=B;else return I.error("Unknown tag: "+B);return k>=31?I.error("Multi-octet tag encoding unsupported"):(M||(k|=32),k|=m.tagClassByName[x||"universal"]<<6,k)}return L0}var O0,Mo;function c2(){if(Mo)return O0;Mo=1;var h=Kt,n=wo();function u(s){n.call(this,s),this.enc="pem"}return h(u,n),O0=u,u.prototype.encode=function(m,f){for(var g=n.prototype.encode.call(this,m),y=g.toString("base64"),S=["-----BEGIN "+f.label+"-----"],B=0;B<y.length;B+=64)S.push(y.slice(B,B+64));return S.push("-----END "+f.label+"-----"),S.join(`
|
|
15
|
+
`)},O0}var xo;function v2(){return xo||(xo=1,function(h){var n=h;n.der=wo(),n.pem=c2()}(U0)),U0}var _o;function sn(){return _o||(_o=1,function(h){var n=h;n.bignum=a2,n.define=h2().define,n.base=hn(),n.constants=vo(),n.decoders=d2(),n.encoders=v2()}(I0)),I0}var ar=sn(),So=ar.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),p2=ar.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),z0=ar.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),m2=ar.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(z0),this.key("subjectPublicKey").bitstr())}),g2=ar.define("RelativeDistinguishedName",function(){this.setof(p2)}),b2=ar.define("RDNSequence",function(){this.seqof(g2)}),Ao=ar.define("Name",function(){this.choice({rdnSequence:this.use(b2)})}),y2=ar.define("Validity",function(){this.seq().obj(this.key("notBefore").use(So),this.key("notAfter").use(So))}),w2=ar.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),M2=ar.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(z0),this.key("issuer").use(Ao),this.key("validity").use(y2),this.key("subject").use(Ao),this.key("subjectPublicKeyInfo").use(m2),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(w2).optional())}),x2=ar.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(M2),this.key("signatureAlgorithm").use(z0),this.key("signatureValue").bitstr())}),_2=x2,hr=sn();fr.certificate=_2;var S2=hr.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});fr.RSAPrivateKey=S2;var A2=hr.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});fr.RSAPublicKey=A2;var Bo=hr.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),B2=hr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Bo),this.key("subjectPublicKey").bitstr())});fr.PublicKey=B2;var E2=hr.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(Bo),this.key("subjectPrivateKey").octstr())});fr.PrivateKey=E2;var k2=hr.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});fr.EncryptedPrivateKey=k2;var I2=hr.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});fr.DSAPrivateKey=I2,fr.DSAparam=hr.define("DSAparam",function(){this.int()});var R2=hr.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),T2=hr.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(R2),this.key("publicKey").optional().explicit(1).bitstr())});fr.ECPrivateKey=T2,fr.signature=hr.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const C2={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var F2=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,q2=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,P2=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,D2=Ln,N2=Ze,uf=zt.Buffer,$2=function(h,n){var u=h.toString(),s=u.match(F2),m;if(s){var g="aes"+s[1],y=uf.from(s[2],"hex"),S=uf.from(s[3].replace(/[\r\n]/g,""),"base64"),B=D2(n,y.slice(0,8),parseInt(s[1],10)).key,M=[],x=N2.createDecipheriv(g,B,y);M.push(x.update(S)),M.push(x.final()),m=uf.concat(M)}else{var f=u.match(P2);m=uf.from(f[2].replace(/[\r\n]/g,""),"base64")}var I=u.match(q2)[1];return{tag:I,data:m}},ze=fr,U2=C2,L2=$2,O2=Ze,z2=_n,K0=zt.Buffer;function K2(h,n){var u=h.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(),10),m=U2[h.algorithm.decrypt.cipher.algo.join(".")],f=h.algorithm.decrypt.cipher.iv,g=h.subjectPrivateKey,y=parseInt(m.split("-")[1],10)/8,S=z2.pbkdf2Sync(n,u,s,y,"sha1"),B=O2.createDecipheriv(m,S,f),M=[];return M.push(B.update(g)),M.push(B.final()),K0.concat(M)}function Eo(h){var n;typeof h=="object"&&!K0.isBuffer(h)&&(n=h.passphrase,h=h.key),typeof h=="string"&&(h=K0.from(h));var u=L2(h,n),s=u.tag,m=u.data,f,g;switch(s){case"CERTIFICATE":g=ze.certificate.decode(m,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(g||(g=ze.PublicKey.decode(m,"der")),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return ze.RSAPublicKey.decode(g.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return g.subjectPrivateKey=g.subjectPublicKey,{type:"ec",data:g};case"1.2.840.10040.4.1":return g.algorithm.params.pub_key=ze.DSAparam.decode(g.subjectPublicKey.data,"der"),{type:"dsa",data:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"ENCRYPTED PRIVATE KEY":m=ze.EncryptedPrivateKey.decode(m,"der"),m=K2(m,n);case"PRIVATE KEY":switch(g=ze.PrivateKey.decode(m,"der"),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return ze.RSAPrivateKey.decode(g.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:g.algorithm.curve,privateKey:ze.ECPrivateKey.decode(g.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return g.algorithm.params.priv_key=ze.DSAparam.decode(g.subjectPrivateKey,"der"),{type:"dsa",params:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"RSA PUBLIC KEY":return ze.RSAPublicKey.decode(m,"der");case"RSA PRIVATE KEY":return ze.RSAPrivateKey.decode(m,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:ze.DSAPrivateKey.decode(m,"der")};case"EC PRIVATE KEY":return m=ze.ECPrivateKey.decode(m,"der"),{curve:m.parameters.value,privateKey:m.privateKey};default:throw new Error("unknown key type "+s)}}Eo.signature=ze.signature;var lf=Eo;const ko={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var Io;function H2(){if(Io)return en.exports;Io=1;var h=zt.Buffer,n=La,u=l0,s=k0().ec,m=u0,f=lf,g=ko,y=1;function S(z,$,lt,H,At){var Bt=f($);if(Bt.curve){if(H!=="ecdsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");return B(z,Bt)}else if(Bt.type==="dsa"){if(H!=="dsa")throw new Error("wrong private key type");return M(z,Bt,lt)}if(H!=="rsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");if($.padding!==void 0&&$.padding!==y)throw new Error("illegal or unsupported padding mode");z=h.concat([At,z]);for(var Ct=Bt.modulus.byteLength(),Et=[0,1];z.length+Et.length+1<Ct;)Et.push(255);Et.push(0);for(var Y=-1;++Y<z.length;)Et.push(z[Y]);var It=u(Et,Bt);return It}function B(z,$){var lt=g[$.curve.join(".")];if(!lt)throw new Error("unknown curve "+$.curve.join("."));var H=new s(lt),At=H.keyFromPrivate($.privateKey),Bt=At.sign(z);return h.from(Bt.toDER())}function M(z,$,lt){for(var H=$.params.priv_key,At=$.params.p,Bt=$.params.q,Ct=$.params.g,Et=new m(0),Y,It=k(z,Bt).mod(Bt),p=!1,t=I(H,Bt,z,lt);p===!1;)Y=L(Bt,t,lt),Et=W(Ct,Y,At,Bt),p=Y.invm(Bt).imul(It.add(H.mul(Et))).mod(Bt),p.cmpn(0)===0&&(p=!1,Et=new m(0));return x(Et,p)}function x(z,$){z=z.toArray(),$=$.toArray(),z[0]&128&&(z=[0].concat(z)),$[0]&128&&($=[0].concat($));var lt=z.length+$.length+4,H=[48,lt,2,z.length];return H=H.concat(z,[2,$.length],$),h.from(H)}function I(z,$,lt,H){if(z=h.from(z.toArray()),z.length<$.byteLength()){var At=h.alloc($.byteLength()-z.length);z=h.concat([At,z])}var Bt=lt.length,Ct=D(lt,$),Et=h.alloc(Bt);Et.fill(1);var Y=h.alloc(Bt);return Y=n(H,Y).update(Et).update(h.from([0])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),Y=n(H,Y).update(Et).update(h.from([1])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),{k:Y,v:Et}}function k(z,$){var lt=new m(z),H=(z.length<<3)-$.bitLength();return H>0&<.ishrn(H),lt}function D(z,$){z=k(z,$),z=z.mod($);var lt=h.from(z.toArray());if(lt.length<$.byteLength()){var H=h.alloc($.byteLength()-lt.length);lt=h.concat([H,lt])}return lt}function L(z,$,lt){var H,At;do{for(H=h.alloc(0);H.length*8<z.bitLength();)$.v=n(lt,$.k).update($.v).digest(),H=h.concat([H,$.v]);At=k(H,z),$.k=n(lt,$.k).update($.v).update(h.from([0])).digest(),$.v=n(lt,$.k).update($.v).digest()}while(At.cmp(z)!==-1);return At}function W(z,$,lt,H){return z.toRed(m.mont(lt)).redPow($).fromRed().mod(H)}return en.exports=S,en.exports.getKey=I,en.exports.makeKey=L,en.exports}var H0,Ro;function Z2(){if(Ro)return H0;Ro=1;var h=zt.Buffer,n=u0,u=k0().ec,s=lf,m=ko;function f(B,M,x,I,k){var D=s(x);if(D.type==="ec"){if(I!=="ecdsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");return g(B,M,D)}else if(D.type==="dsa"){if(I!=="dsa")throw new Error("wrong public key type");return y(B,M,D)}if(I!=="rsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");M=h.concat([k,M]);for(var L=D.modulus.byteLength(),W=[1],z=0;M.length+W.length+2<L;)W.push(255),z+=1;W.push(0);for(var $=-1;++$<M.length;)W.push(M[$]);W=h.from(W);var lt=n.mont(D.modulus);B=new n(B).toRed(lt),B=B.redPow(new n(D.publicExponent)),B=h.from(B.fromRed().toArray());var H=z<8?1:0;for(L=Math.min(B.length,W.length),B.length!==W.length&&(H=1),$=-1;++$<L;)H|=B[$]^W[$];return H===0}function g(B,M,x){var I=m[x.data.algorithm.curve.join(".")];if(!I)throw new Error("unknown curve "+x.data.algorithm.curve.join("."));var k=new u(I),D=x.data.subjectPrivateKey.data;return k.verify(M,B,D)}function y(B,M,x){var I=x.data.p,k=x.data.q,D=x.data.g,L=x.data.pub_key,W=s.signature.decode(B,"der"),z=W.s,$=W.r;S(z,k),S($,k);var lt=n.mont(I),H=z.invm(k),At=D.toRed(lt).redPow(new n(M).mul(H).mod(k)).fromRed().mul(L.toRed(lt).redPow($.mul(H).mod(k)).fromRed()).mod(I).mod(k);return At.cmp($)===0}function S(B,M){if(B.cmpn(0)<=0)throw new Error("invalid sig");if(B.cmp(M)>=0)throw new Error("invalid sig")}return H0=f,H0}var Z0,To;function W2(){if(To)return Z0;To=1;var h=zt.Buffer,n=Ki,u=rv,s=Kt,m=H2(),f=Z2(),g=Oa;Object.keys(g).forEach(function(x){g[x].id=h.from(g[x].id,"hex"),g[x.toLowerCase()]=g[x]});function y(x){u.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hashType=I.hash,this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}s(y,u.Writable),y.prototype._write=function(I,k,D){this._hash.update(I),D()},y.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},y.prototype.sign=function(I,k){this.end();var D=this._hash.digest(),L=m(D,I,this._hashType,this._signType,this._tag);return k?L.toString(k):L};function S(x){u.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}s(S,u.Writable),S.prototype._write=function(I,k,D){this._hash.update(I),D()},S.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},S.prototype.verify=function(I,k,D){var L=typeof k=="string"?h.from(k,D):k;this.end();var W=this._hash.digest();return f(L,W,I,this._signType,this._tag)};function B(x){return new y(x)}function M(x){return new S(x)}return Z0={Sign:B,Verify:M,createSign:B,createVerify:M},Z0}var W0={exports:{}};W0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(W0);var V2=W0.exports,V0,Co;function Y2(){if(Co)return V0;Co=1;var h=k0(),n=V2;V0=function(g){return new s(g)};var u={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};u.p224=u.secp224r1,u.p256=u.secp256r1=u.prime256v1,u.p192=u.secp192r1=u.prime192v1,u.p384=u.secp384r1,u.p521=u.secp521r1;function s(f){this.curveType=u[f],this.curveType||(this.curveType={name:f}),this.curve=new h.ec(this.curveType.name),this.keys=void 0}s.prototype.generateKeys=function(f,g){return this.keys=this.curve.genKeyPair(),this.getPublicKey(f,g)},s.prototype.computeSecret=function(f,g,y){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var S=this.curve.keyFromPublic(f).getPublic(),B=S.mul(this.keys.getPrivate()).getX();return m(B,y,this.curveType.byteLength)},s.prototype.getPublicKey=function(f,g){var y=this.keys.getPublic(g==="compressed",!0);return g==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),m(y,f)},s.prototype.getPrivateKey=function(f){return m(this.keys.getPrivate(),f)},s.prototype.setPublicKey=function(f,g){return g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g)),this.keys._importPublic(f),this},s.prototype.setPrivateKey=function(f,g){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var y=new n(f);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function m(f,g,y){Array.isArray(f)||(f=f.toArray());var S=new mt(f);if(y&&S.length<y){var B=new mt(y-S.length);B.fill(0),S=mt.concat([B,S])}return g?S.toString(g):S}return V0}var Fo={},J2=Ki,Y0=zt.Buffer,qo=function(h,n){for(var u=Y0.alloc(0),s=0,m;u.length<n;)m=G2(s++),u=Y0.concat([u,J2("sha1").update(h).update(m).digest()]);return u.slice(0,n)};function G2(h){var n=Y0.allocUnsafe(4);return n.writeUInt32BE(h,0),n}var Po=function(n,u){for(var s=n.length,m=-1;++m<s;)n[m]^=u[m];return n},J0={exports:{}};J0.exports,function(h){(function(n,u){function s(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:u.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=Ne.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),s(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(s(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(s(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var o=t.length-r;for(a=o%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,o=Math.min(c,c-v)+i,e=0,l=i;l<o;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","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"],x=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],o=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-o.length]+o+i:i=o+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}s(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return s(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);s(a<=d,"byte array longer than desired length"),s(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),o,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[e]=o;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)o=l.andln(255),l.iushrn(8),v[d-e-1]=o}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return s((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return s((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return s((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){s(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){s(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,o=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=o>>>26,b=o&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,o=l|0}return o!==0?r.words[e]=o|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,o,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,qt=a[4]|0,tt=qt&8191,vt=qt>>>13,Nt=a[5]|0,et=Nt&8191,pt=Nt>>>13,Dt=a[6]|0,j=Dt&8191,dt=Dt>>>13,Pt=a[7]|0,Q=Pt&8191,ct=Pt>>>13,Ot=a[8]|0,E=Ot&8191,w=Ot>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,Ht=d[3]|0,nt=Ht&8191,bt=Ht>>>13,Zt=d[4]|0,ft=Zt&8191,yt=Zt>>>13,Wt=d[5]|0,at=Wt&8191,wt=Wt>>>13,Vt=d[6]|0,ht=Vt&8191,Mt=Vt>>>13,Yt=d[7]|0,st=Yt&8191,xt=Yt>>>13,Jt=d[8]|0,ot=Jt&8191,_t=Jt>>>13,Gt=d[9]|0,ut=Gt&8191,St=Gt>>>13;i.negative=t.negative^r.negative,i.length=19,o=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var $t=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,o=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),o=o+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var Ut=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,o=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),o=o+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,o=o+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,o=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),o=o+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,o=o+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,o=o+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,o=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),o=o+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,o=o+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,o=o+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,o=o+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,o=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),o=o+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,o=o+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,o=o+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,o=o+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,o=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),o=o+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,o=o+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,o=o+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,o=o+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,o=o+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,o=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),o=o+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,o=o+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,o=o+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,o=o+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,o=o+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,o=o+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,o=o+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,o=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),o=o+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,o=o+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,o=o+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,o=o+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,o=o+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,o=o+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,o=o+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,o=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),o=o+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,o=o+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,o=o+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,o=o+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,o=o+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,o=o+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,o=o+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,o=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),o=o+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,o=o+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,o=o+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,o=o+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,o=o+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,o=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),o=o+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,o=o+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,o=o+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,o=o+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,o=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),o=o+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,o=o+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,o=o+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,o=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),o=o+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,o=o+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,o=o+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,o=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),o=o+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,o=o+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,o=o+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,o=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),o=o+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,o=o+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,o=o+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,o=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),o=o+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,o=o+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,o=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),o=o+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+o|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,o=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+o|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=$t,c[1]=Ut,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,o=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=o;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var o=v<<1,e=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),b=0;b<d;b+=o)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==o&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;s(d===0),s((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),o=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,o,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=o[q]*b[q]-e[q]*_[q];e[q]=o[q]*_[q]+e[q]*b[q],o[q]=O}return this.conjugate(o,e,a),this.transform(o,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){s(typeof t=="number"),s(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,o=(this.words[d]|0)-v<<r;this.words[d]=o|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return s(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){s(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,o=i;if(a-=c,a=Math.max(0,a),o){for(var e=0;e<c;e++)o.words[e]=this.words[e];o.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return o&&l!==0&&(o.words[o.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return s(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){s(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return s(typeof t=="number"),s(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(s(typeof t=="number"),s(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var o=(t.words[d]|0)*r;c-=o&67108863,v=(c>>26)-(o/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(s(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var o=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=o+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,o);b.negative===0&&(a=b,e&&(e.words[o]=1));for(var _=o-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(s(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){s(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){s(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(o)}},f.prototype._invmp=function(t){s(t.negative===0),s(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,o=1;!(r.words[0]&o)&&v<26;++v,o<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){s(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),s(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return s(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return s(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else s(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){s(t.negative===0,"red works only with positives"),s(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){s((t.negative|r.negative)===0,"red works only with positives"),s(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(s(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);s(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),o=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,o).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();s(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,o=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){o=0;continue}v<<=1,v|=_,o++,!(o!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),o=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Ft)}(J0);var G0=J0.exports,Do=G0,X2=zt.Buffer;function j2(h,n){return X2.from(h.toRed(Do.mont(n.modulus)).redPow(new Do(n.publicExponent)).fromRed().toArray())}var No=j2,Q2=lf,X0=li,tm=Ki,$o=qo,Uo=Po,j0=G0,em=No,rm=l0,sr=zt.Buffer,im=function(n,u,s){var m;n.padding?m=n.padding:s?m=1:m=4;var f=Q2(n),g;if(m===4)g=nm(f,u);else if(m===1)g=fm(f,u,s);else if(m===3){if(g=new j0(u),g.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return s?rm(g,f):em(g,f)};function nm(h,n){var u=h.modulus.byteLength(),s=n.length,m=tm("sha1").update(sr.alloc(0)).digest(),f=m.length,g=2*f;if(s>u-g-2)throw new Error("message too long");var y=sr.alloc(u-s-g-2),S=u-f-1,B=X0(f),M=Uo(sr.concat([m,y,sr.alloc(1,1),n],S),$o(B,S)),x=Uo(B,$o(M,f));return new j0(sr.concat([sr.alloc(1),x,M],u))}function fm(h,n,u){var s=n.length,m=h.modulus.byteLength();if(s>m-11)throw new Error("message too long");var f;return u?f=sr.alloc(m-s-3,255):f=am(m-s-3),new j0(sr.concat([sr.from([0,u?1:2]),f,sr.alloc(1),n],m))}function am(h){for(var n=sr.allocUnsafe(h),u=0,s=X0(h*2),m=0,f;u<h;)m===s.length&&(s=X0(h*2),m=0),f=s[m++],f&&(n[u++]=f);return n}var hm=lf,Lo=qo,Oo=Po,zo=G0,sm=l0,om=Ki,um=No,on=zt.Buffer,lm=function(n,u,s){var m;n.padding?m=n.padding:s?m=1:m=4;var f=hm(n),g=f.modulus.byteLength();if(u.length>g||new zo(u).cmp(f.modulus)>=0)throw new Error("decryption error");var y;s?y=um(new zo(u),f):y=sm(u,f);var S=on.alloc(g-y.length);if(y=on.concat([S,y],g),m===4)return dm(f,y);if(m===1)return cm(f,y,s);if(m===3)return y;throw new Error("unknown padding")};function dm(h,n){var u=h.modulus.byteLength(),s=om("sha1").update(on.alloc(0)).digest(),m=s.length;if(n[0]!==0)throw new Error("decryption error");var f=n.slice(1,m+1),g=n.slice(m+1),y=Oo(f,Lo(g,m)),S=Oo(g,Lo(y,u-m-1));if(vm(s,S.slice(0,m)))throw new Error("decryption error");for(var B=m;S[B]===0;)B++;if(S[B++]!==1)throw new Error("decryption error");return S.slice(B)}function cm(h,n,u){for(var s=n.slice(0,2),m=2,f=0;n[m++]!==0;)if(m>=n.length){f++;break}var g=n.slice(2,m-1);if((s.toString("hex")!=="0002"&&!u||s.toString("hex")!=="0001"&&u)&&f++,g.length<8&&f++,f)throw new Error("decryption error");return n.slice(m)}function vm(h,n){h=on.from(h),n=on.from(n);var u=0,s=h.length;h.length!==n.length&&(u++,s=Math.min(h.length,n.length));for(var m=-1;++m<s;)u+=h[m]^n[m];return u}(function(h){h.publicEncrypt=im,h.privateDecrypt=lm,h.privateEncrypt=function(u,s){return h.publicEncrypt(u,s,!0)},h.publicDecrypt=function(u,s){return h.privateDecrypt(u,s,!0)}})(Fo);var un={};function Ko(){throw new Error(`secure random number generation not supported by this browser
|
|
16
|
+
use chrome, FireFox or Internet Explorer 11`)}var Ho=zt,Zo=li,Wo=Ho.Buffer,Vo=Ho.kMaxLength,Q0=Ft.crypto||Ft.msCrypto,Yo=Math.pow(2,32)-1;function Jo(h,n){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>Yo||h<0)throw new TypeError("offset must be a uint32");if(h>Vo||h>n)throw new RangeError("offset out of range")}function Go(h,n,u){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>Yo||h<0)throw new TypeError("size must be a uint32");if(h+n>u||h>Vo)throw new RangeError("buffer too small")}Q0&&Q0.getRandomValues||!ye.browser?(un.randomFill=pm,un.randomFillSync=mm):(un.randomFill=Ko,un.randomFillSync=Ko);function pm(h,n,u,s){if(!Wo.isBuffer(h)&&!(h instanceof Ft.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof n=="function")s=n,n=0,u=h.length;else if(typeof u=="function")s=u,u=h.length-n;else if(typeof s!="function")throw new TypeError('"cb" argument must be a function');return Jo(n,h.length),Go(u,n,h.length),Xo(h,n,u,s)}function Xo(h,n,u,s){if(ye.browser){var m=h.buffer,f=new Uint8Array(m,n,u);if(Q0.getRandomValues(f),s){ye.nextTick(function(){s(null,h)});return}return h}if(s){Zo(u,function(y,S){if(y)return s(y);S.copy(h,n),s(null,h)});return}var g=Zo(u);return g.copy(h,n),h}function mm(h,n,u){if(typeof n=="undefined"&&(n=0),!Wo.isBuffer(h)&&!(h instanceof Ft.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return Jo(n,h.length),u===void 0&&(u=h.length-n),Go(u,n,h.length),Xo(h,n,u)}var jo;function Qo(){if(jo)return Lt;jo=1,Lt.randomBytes=Lt.rng=Lt.pseudoRandomBytes=Lt.prng=li,Lt.createHash=Lt.Hash=Ki,Lt.createHmac=Lt.Hmac=La;var h=Td,n=Object.keys(h),u=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);Lt.getHashes=function(){return u};var s=_n;Lt.pbkdf2=s.pbkdf2,Lt.pbkdf2Sync=s.pbkdf2Sync;var m=rr;Lt.Cipher=m.Cipher,Lt.createCipher=m.createCipher,Lt.Cipheriv=m.Cipheriv,Lt.createCipheriv=m.createCipheriv,Lt.Decipher=m.Decipher,Lt.createDecipher=m.createDecipher,Lt.Decipheriv=m.Decipheriv,Lt.createDecipheriv=m.createDecipheriv,Lt.getCiphers=m.getCiphers,Lt.listCiphers=m.listCiphers;var f=R1();Lt.DiffieHellmanGroup=f.DiffieHellmanGroup,Lt.createDiffieHellmanGroup=f.createDiffieHellmanGroup,Lt.getDiffieHellman=f.getDiffieHellman,Lt.createDiffieHellman=f.createDiffieHellman,Lt.DiffieHellman=f.DiffieHellman;var g=W2();Lt.createSign=g.createSign,Lt.Sign=g.Sign,Lt.createVerify=g.createVerify,Lt.Verify=g.Verify,Lt.createECDH=Y2();var y=Fo;Lt.publicEncrypt=y.publicEncrypt,Lt.privateEncrypt=y.privateEncrypt,Lt.publicDecrypt=y.publicDecrypt,Lt.privateDecrypt=y.privateDecrypt;var S=un;return Lt.randomFill=S.randomFill,Lt.randomFillSync=S.randomFillSync,Lt.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
|
|
17
17
|
we accept pull requests
|
|
18
|
-
https://github.com/browserify/crypto-browserify`)},Lt.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},Lt}var
|
|
18
|
+
https://github.com/browserify/crypto-browserify`)},Lt.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},Lt}var gm=Qo();const bm=ke(gm);function ta(h){const n=bm.createHash("sha256").update(h).digest("hex");return parseInt(n.slice(0,8),16)%1e4/100}function tu(h,n){const u=ta(h);let s=0;for(const m of n.variants)if(s+=m.weight,u<s)return m.value;return null}function eu(h,n){const u=n.user_id||n.id||n.email;if(!h||typeof h!="object"||!u)return null;switch(h.strategy){case"percentage":{if(!("percentage"in h)||!("salt"in h))return null;const{percentage:s,salt:m}=h;return ta(`${u}.${m}`)<s?!0:null}case"variant":{if(!("variants"in h))return null;const{salt:s,variants:m}=h;return tu(`${u}.${s}`,m)}default:return null}}function ru(h,n){var f;if(!(h.targeting_rules||[]).every(g=>{var y;if(g.type==="segment"){const S=(y=h.segmentsById)==null?void 0:y[g.segment_id];return S?Mu(S,n):!1}else return aa(g,n)}))return null;const m=h.rollout?eu(h.rollout,n):null;return(f=m!=null?m:h.value)!=null?f:null}let ln={getItem:h=>typeof localStorage!="undefined"?localStorage.getItem(h):null,setItem:(h,n)=>{typeof localStorage!="undefined"&&localStorage.setItem(h,n)}};function ym(h){ln=h}function iu(h){return`flagmint_${h}_flags`}function nu(h){return`flagmint_${h}_context`}function fu(h,n){try{const u=ln.getItem(iu(h));if(!u)return null;const s=JSON.parse(u);return Date.now()-s.ts>n?null:s.data}catch(u){return null}}function au(h,n){try{ln.setItem(iu(h),JSON.stringify({ts:Date.now(),data:n}))}catch(u){}}function hu(h){try{const n=ln.getItem(nu(h));return n?JSON.parse(n):null}catch(n){return null}}function su(h,n){try{ln.setItem(nu(h),JSON.stringify(n))}catch(u){}}const wm=Object.freeze(Object.defineProperty({__proto__:null,loadCachedContext:hu,loadCachedFlags:fu,saveCachedContext:su,saveCachedFlags:au,setCacheStorage:ym},Symbol.toStringTag,{value:"Module"})),Mm=24*60*60*1e3;function ou(){switch(typeof process!="undefined"?process.env.NEXT_PUBLIC_NODE_ENV||process.env.NODE_ENV:"development"){case"production":return{rest:"https://api.flagmint.com/evaluator/evaluate",ws:"wss://api.flagmint.com/ws/sdk"};case"staging":return{rest:"https://staging-api.flagmint.com/evaluator/evaluate",ws:"wss://staging-api.flagmint.com/ws/sdk"};case"development":default:return{rest:"http://localhost:3000/evaluator/evaluate",ws:"ws://localhost:3000/ws/sdk"}}}const xm=ou().rest,_m=ou().ws;class Sm{constructor(n){var u,s,m,f,g,y,S;if(this.flags={},this.refreshIntervalId=null,this.rawFlags={},this.isInitialized=!1,this.subscribers=new Set,this.apiKey=n.apiKey,this.enableOfflineCache=(u=n.enableOfflineCache)!=null?u:!0,this.persistContext=(s=n.persistContext)!=null?s:!1,this.cacheTTL=Mm,this.onError=n.onError,this.restEndpoint=(m=n.restEndpoint)!=null?m:xm,this.wsEndpoint=(f=n.wsEndpoint)!=null?f:_m,this.cacheAdapter=(g=n.cacheAdapter)!=null?g:{loadFlags:fu,saveFlags:au,loadContext:hu,saveContext:su},this.context=n.context||{},this.rawFlags=(y=n.rawFlags)!=null?y:{},this.previewMode=n.previewMode||!1,this.deferInitialization=(S=n.deferInitialization)!=null?S:!1,this.previewMode&&this.rawFlags&&Object.keys(this.rawFlags).length>0){this.flags=this.evaluateLocally(this.rawFlags,this.context),this.readyPromise=Promise.resolve(),this.resolveReady=()=>{},this.rejectReady=()=>{},this.isInitialized=!0;return}else this.previewMode&&!this.rawFlags&&console.error("[FlagClient] No raw flags provided for preview mode. Defaulting to remote fetch.");this.readyPromise=new Promise((B,M)=>{this.resolveReady=B,this.rejectReady=M}),this.deferInitialization?(console.log("[FlagClient] Initialization deferred. Call ready() to initialize."),this.initializationOptions=n):this.initialize(n)}initialize(n){return De(this,null,function*(){var u;this.deferInitialization?(console.log("[FlagClient] Initialization deferred. Call ready() to initialize."),this.initializationOptions=n):this.initialize(n);try{if(this.persistContext){const s=yield Promise.resolve(this.cacheAdapter.loadContext(this.apiKey));s&&(this.context=s)}if(this.enableOfflineCache){const s=yield Promise.resolve(this.cacheAdapter.loadFlags(this.apiKey,this.cacheTTL));s&&(this.flags=s,this.notifySubscribers())}yield this.setupTransport(n),this.isInitialized=!0,this.resolveReady()}catch(s){this.rejectReady(s),(u=this.onError)==null||u.call(this,s)}})}setupTransport(n){return De(this,null,function*(){var f;console.log("[FlagClient] setupTransport() started");const u=(f=n.transportMode)!=null?f:"auto",s=()=>De(this,null,function*(){console.log("[FlagClient] Initializing WebSocket transport...");const g=new fa(this.wsEndpoint,this.apiKey);return yield g.init(),console.log("[FlagClient] WebSocket transport initialized"),g}),m=()=>{const g=new na(this.restEndpoint,this.apiKey,this.context,{pollIntervalMs:12e5,maxBackoffMs:6e4,backoffMultiplier:2});return g.onFlagsUpdated(y=>{console.log("[FlagClient] Flags updated via long polling:",y),this.updateFlags(y)}),g.init(),g};try{if(u==="websocket")this.transport=yield s();else if(u==="long-polling")this.transport=m();else try{this.transport=yield s()}catch(y){console.warn("[FlagClient] WebSocket failed, falling back to long polling"),this.transport=m()}console.log("[FlagClient] Fetching flags...");const g=yield this.transport.fetchFlags(this.context);console.log("[FlagClient] Initial flags fetched:",g),this.updateFlags(g),typeof this.transport.onFlagsUpdated=="function"&&this.transport.onFlagsUpdated(y=>{console.log("[FlagClient] Flags updated via transport:",y),this.updateFlags(y)}),this.resolveReady()}catch(g){throw console.error("[FlagClient] setupTransport error:",g),this.rejectReady(g),this.onError&&this.onError(g instanceof Error?g:new Error(String(g))),g}})}updateFlags(n){this.flags=n,this.enableOfflineCache&&Promise.resolve(this.cacheAdapter.saveFlags(this.apiKey,n)),this.notifySubscribers()}notifySubscribers(){this.subscribers.forEach(n=>{try{n(this.flags)}catch(u){console.error("[FlagClient] Error in subscriber callback:",u)}})}subscribe(n){return this.subscribers.add(n),n(this.flags),()=>{this.subscribers.delete(n)}}getFlags(){return df({},this.flags)}getFlag(n,u){var s;return(s=this.flags[n])!=null?s:u}updateContext(n){return De(this,null,function*(){var u;if(this.context=df(df({},this.context),n),this.persistContext&&(yield Promise.resolve(this.cacheAdapter.saveContext(this.apiKey,this.context))),this.transport&&typeof this.transport.fetchFlags=="function")try{const s=yield this.transport.fetchFlags(this.context);this.updateFlags(s)}catch(s){console.error("[FlagClient] Error updating flags after context change:",s),(u=this.onError)==null||u.call(this,s)}})}destroy(){this.refreshIntervalId&&clearInterval(this.refreshIntervalId),this.subscribers.clear(),this.transport&&this.transport.destroy()}ready(){return De(this,null,function*(){return console.log("[FlagClient] Waiting for client to be ready..."),this.deferInitialization&&!this.isInitialized&&this.initializationOptions&&(console.log("[FlagClient] Deferred initialization triggered by ready() call"),yield this.initialize(this.initializationOptions)),this.readyPromise})}evaluateLocally(n,u){const s={};for(const m in n){const f=ru(n[m],u);f!==null&&(s[m]=f)}return s}}function uu(h){return`flagmint_${h}_flags`}function lu(h){return`flagmint_${h}_context`}let Fr=null;function Am(h){Fr=h}function Bm(h,n){return De(this,null,function*(){if(!Fr)throw new Error("Async storage not set");try{const u=yield Fr.getItem(uu(h));if(!u)return null;const s=JSON.parse(u);return Date.now()-s.ts>n?null:s.data}catch(u){return null}})}function Em(h,n){return De(this,null,function*(){if(!Fr)throw new Error("Async storage not set");try{yield Fr.setItem(uu(h),JSON.stringify({ts:Date.now(),data:n}))}catch(u){}})}function km(h){return De(this,null,function*(){if(!Fr)throw new Error("Async storage not set");try{const n=yield Fr.getItem(lu(h));return n?JSON.parse(n):null}catch(n){return null}})}function Im(h,n){return De(this,null,function*(){if(!Fr)throw new Error("Async storage not set");try{yield Fr.setItem(lu(h),JSON.stringify(n))}catch(u){}})}const Rm=Object.freeze(Object.defineProperty({__proto__:null,loadCachedContext:km,loadCachedFlags:Bm,saveCachedContext:Im,saveCachedFlags:Em,setAsyncCacheStorage:Am},Symbol.toStringTag,{value:"Module"}));typeof globalThis.Buffer=="undefined"&&(globalThis.Buffer=Ke.Buffer),ge.FlagClient=Sm,ge.LongPollingTransport=na,ge.WebSocketTransport=fa,ge.asyncCache=Rm,ge.evaluateFlagValue=ru,ge.evaluateRollout=eu,ge.hashToPercentage=ta,ge.pickVariant=tu,ge.syncCache=wm,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|