@gala-chain/gswap-sdk 0.0.9 → 1.0.0-rc.3

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.
@@ -1,25 +1,3 @@
1
- var Vg=Object.create;var fo=Object.defineProperty;var jg=Object.getOwnPropertyDescriptor;var Jg=Object.getOwnPropertyNames;var Xg=Object.getPrototypeOf,Yg=Object.prototype.hasOwnProperty;var Qg=(i,t,r)=>t in i?fo(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r;var ty=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var I=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var ey=(i,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Jg(t))!Yg.call(i,a)&&a!==r&&fo(i,a,{get:()=>t[a],enumerable:!(s=jg(t,a))||s.enumerable});return i};var su=(i,t,r)=>(r=i!=null?Vg(Xg(i)):{},ey(t||!i||!i.__esModule?fo(r,"default",{value:i,enumerable:!0}):r,i));var Dt=(i,t,r)=>Qg(i,typeof t!="symbol"?t+"":t,r);var du=I(of=>{"use strict";of.byteLength=iy;of.toByteArray=ay;of.fromByteArray=sy;var Ur=[],vr=[],ry=typeof Uint8Array<"u"?Uint8Array:Array,so="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Li=0,uu=so.length;Li<uu;++Li)Ur[Li]=so[Li],vr[so.charCodeAt(Li)]=Li;var Li,uu;vr[45]=62;vr[95]=63;function lu(i){var t=i.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=i.indexOf("=");r===-1&&(r=t);var s=r===t?0:4-r%4;return[r,s]}function iy(i){var t=lu(i),r=t[0],s=t[1];return(r+s)*3/4-s}function ny(i,t,r){return(t+r)*3/4-r}function ay(i){var t,r=lu(i),s=r[0],a=r[1],c=new ry(ny(i,s,a)),g=0,b=a>0?s-4:s,w;for(w=0;w<b;w+=4)t=vr[i.charCodeAt(w)]<<18|vr[i.charCodeAt(w+1)]<<12|vr[i.charCodeAt(w+2)]<<6|vr[i.charCodeAt(w+3)],c[g++]=t>>16&255,c[g++]=t>>8&255,c[g++]=t&255;return a===2&&(t=vr[i.charCodeAt(w)]<<2|vr[i.charCodeAt(w+1)]>>4,c[g++]=t&255),a===1&&(t=vr[i.charCodeAt(w)]<<10|vr[i.charCodeAt(w+1)]<<4|vr[i.charCodeAt(w+2)]>>2,c[g++]=t>>8&255,c[g++]=t&255),c}function fy(i){return Ur[i>>18&63]+Ur[i>>12&63]+Ur[i>>6&63]+Ur[i&63]}function oy(i,t,r){for(var s,a=[],c=t;c<r;c+=3)s=(i[c]<<16&16711680)+(i[c+1]<<8&65280)+(i[c+2]&255),a.push(fy(s));return a.join("")}function sy(i){for(var t,r=i.length,s=r%3,a=[],c=16383,g=0,b=r-s;g<b;g+=c)a.push(oy(i,g,g+c>b?b:g+c));return s===1?(t=i[r-1],a.push(Ur[t>>2]+Ur[t<<4&63]+"==")):s===2&&(t=(i[r-2]<<8)+i[r-1],a.push(Ur[t>>10]+Ur[t>>4&63]+Ur[t<<2&63]+"=")),a.join("")}});var cu=I(ho=>{"use strict";ho.read=function(i,t,r,s,a){var c,g,b=a*8-s-1,w=(1<<b)-1,_=w>>1,S=-7,A=r?a-1:0,q=r?-1:1,R=i[t+A];for(A+=q,c=R&(1<<-S)-1,R>>=-S,S+=b;S>0;c=c*256+i[t+A],A+=q,S-=8);for(g=c&(1<<-S)-1,c>>=-S,S+=s;S>0;g=g*256+i[t+A],A+=q,S-=8);if(c===0)c=1-_;else{if(c===w)return g?NaN:(R?-1:1)*(1/0);g=g+Math.pow(2,s),c=c-_}return(R?-1:1)*g*Math.pow(2,c-s)};ho.write=function(i,t,r,s,a,c){var g,b,w,_=c*8-a-1,S=(1<<_)-1,A=S>>1,q=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=s?0:c-1,N=s?1:-1,bt=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(b=isNaN(t)?1:0,g=S):(g=Math.floor(Math.log(t)/Math.LN2),t*(w=Math.pow(2,-g))<1&&(g--,w*=2),g+A>=1?t+=q/w:t+=q*Math.pow(2,1-A),t*w>=2&&(g++,w/=2),g+A>=S?(b=0,g=S):g+A>=1?(b=(t*w-1)*Math.pow(2,a),g=g+A):(b=t*Math.pow(2,A-1)*Math.pow(2,a),g=0));a>=8;i[r+R]=b&255,R+=N,b/=256,a-=8);for(g=g<<a|b,_+=a;_>0;i[r+R]=g&255,R+=N,g/=256,_-=8);i[r+R-N]|=bt*128}});var ai=I(gn=>{"use strict";var uo=du(),vn=cu(),pu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;gn.Buffer=yt;gn.SlowBuffer=py;gn.INSPECT_MAX_BYTES=50;var sf=2147483647;gn.kMaxLength=sf;yt.TYPED_ARRAY_SUPPORT=hy();!yt.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function hy(){try{let i=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(i,t),i.foo()===42}catch{return!1}}Object.defineProperty(yt.prototype,"parent",{enumerable:!0,get:function(){if(yt.isBuffer(this))return this.buffer}});Object.defineProperty(yt.prototype,"offset",{enumerable:!0,get:function(){if(yt.isBuffer(this))return this.byteOffset}});function ni(i){if(i>sf)throw new RangeError('The value "'+i+'" is invalid for option "size"');let t=new Uint8Array(i);return Object.setPrototypeOf(t,yt.prototype),t}function yt(i,t,r){if(typeof i=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vo(i)}return yu(i,t,r)}yt.poolSize=8192;function yu(i,t,r){if(typeof i=="string")return ly(i,t);if(ArrayBuffer.isView(i))return dy(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(Kr(i,ArrayBuffer)||i&&Kr(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kr(i,SharedArrayBuffer)||i&&Kr(i.buffer,SharedArrayBuffer)))return co(i,t,r);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let s=i.valueOf&&i.valueOf();if(s!=null&&s!==i)return yt.from(s,t,r);let a=cy(i);if(a)return a;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return yt.from(i[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}yt.from=function(i,t,r){return yu(i,t,r)};Object.setPrototypeOf(yt.prototype,Uint8Array.prototype);Object.setPrototypeOf(yt,Uint8Array);function bu(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function uy(i,t,r){return bu(i),i<=0?ni(i):t!==void 0?typeof r=="string"?ni(i).fill(t,r):ni(i).fill(t):ni(i)}yt.alloc=function(i,t,r){return uy(i,t,r)};function vo(i){return bu(i),ni(i<0?0:mo(i)|0)}yt.allocUnsafe=function(i){return vo(i)};yt.allocUnsafeSlow=function(i){return vo(i)};function ly(i,t){if((typeof t!="string"||t==="")&&(t="utf8"),!yt.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=wu(i,t)|0,s=ni(r),a=s.write(i,t);return a!==r&&(s=s.slice(0,a)),s}function lo(i){let t=i.length<0?0:mo(i.length)|0,r=ni(t);for(let s=0;s<t;s+=1)r[s]=i[s]&255;return r}function dy(i){if(Kr(i,Uint8Array)){let t=new Uint8Array(i);return co(t.buffer,t.byteOffset,t.byteLength)}return lo(i)}function co(i,t,r){if(t<0||i.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let s;return t===void 0&&r===void 0?s=new Uint8Array(i):r===void 0?s=new Uint8Array(i,t):s=new Uint8Array(i,t,r),Object.setPrototypeOf(s,yt.prototype),s}function cy(i){if(yt.isBuffer(i)){let t=mo(i.length)|0,r=ni(t);return r.length===0||i.copy(r,0,0,t),r}if(i.length!==void 0)return typeof i.length!="number"||yo(i.length)?ni(0):lo(i);if(i.type==="Buffer"&&Array.isArray(i.data))return lo(i.data)}function mo(i){if(i>=sf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sf.toString(16)+" bytes");return i|0}function py(i){return+i!=i&&(i=0),yt.alloc(+i)}yt.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==yt.prototype};yt.compare=function(t,r){if(Kr(t,Uint8Array)&&(t=yt.from(t,t.offset,t.byteLength)),Kr(r,Uint8Array)&&(r=yt.from(r,r.offset,r.byteLength)),!yt.isBuffer(t)||!yt.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let s=t.length,a=r.length;for(let c=0,g=Math.min(s,a);c<g;++c)if(t[c]!==r[c]){s=t[c],a=r[c];break}return s<a?-1:a<s?1:0};yt.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};yt.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return yt.alloc(0);let s;if(r===void 0)for(r=0,s=0;s<t.length;++s)r+=t[s].length;let a=yt.allocUnsafe(r),c=0;for(s=0;s<t.length;++s){let g=t[s];if(Kr(g,Uint8Array))c+g.length>a.length?(yt.isBuffer(g)||(g=yt.from(g)),g.copy(a,c)):Uint8Array.prototype.set.call(a,g,c);else if(yt.isBuffer(g))g.copy(a,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=g.length}return a};function wu(i,t){if(yt.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||Kr(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);let r=i.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&r===0)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return po(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return qu(i).length;default:if(a)return s?-1:po(i).length;t=(""+t).toLowerCase(),a=!0}}yt.byteLength=wu;function vy(i,t,r){let s=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ay(this,t,r);case"utf8":case"utf-8":return xu(this,t,r);case"ascii":return _y(this,t,r);case"latin1":case"binary":return Sy(this,t,r);case"base64":return My(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return By(this,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),s=!0}}yt.prototype._isBuffer=!0;function Oi(i,t,r){let s=i[t];i[t]=i[r],i[r]=s}yt.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)Oi(this,r,r+1);return this};yt.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)Oi(this,r,r+3),Oi(this,r+1,r+2);return this};yt.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)Oi(this,r,r+7),Oi(this,r+1,r+6),Oi(this,r+2,r+5),Oi(this,r+3,r+4);return this};yt.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?xu(this,0,t):vy.apply(this,arguments)};yt.prototype.toLocaleString=yt.prototype.toString;yt.prototype.equals=function(t){if(!yt.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:yt.compare(this,t)===0};yt.prototype.inspect=function(){let t="",r=gn.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};pu&&(yt.prototype[pu]=yt.prototype.inspect);yt.prototype.compare=function(t,r,s,a,c){if(Kr(t,Uint8Array)&&(t=yt.from(t,t.offset,t.byteLength)),!yt.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),s===void 0&&(s=t?t.length:0),a===void 0&&(a=0),c===void 0&&(c=this.length),r<0||s>t.length||a<0||c>this.length)throw new RangeError("out of range index");if(a>=c&&r>=s)return 0;if(a>=c)return-1;if(r>=s)return 1;if(r>>>=0,s>>>=0,a>>>=0,c>>>=0,this===t)return 0;let g=c-a,b=s-r,w=Math.min(g,b),_=this.slice(a,c),S=t.slice(r,s);for(let A=0;A<w;++A)if(_[A]!==S[A]){g=_[A],b=S[A];break}return g<b?-1:b<g?1:0};function Mu(i,t,r,s,a){if(i.length===0)return-1;if(typeof r=="string"?(s=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,yo(r)&&(r=a?0:i.length-1),r<0&&(r=i.length+r),r>=i.length){if(a)return-1;r=i.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof t=="string"&&(t=yt.from(t,s)),yt.isBuffer(t))return t.length===0?-1:vu(i,t,r,s,a);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(i,t,r):Uint8Array.prototype.lastIndexOf.call(i,t,r):vu(i,[t],r,s,a);throw new TypeError("val must be string, number or Buffer")}function vu(i,t,r,s,a){let c=1,g=i.length,b=t.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(i.length<2||t.length<2)return-1;c=2,g/=2,b/=2,r/=2}function w(S,A){return c===1?S[A]:S.readUInt16BE(A*c)}let _;if(a){let S=-1;for(_=r;_<g;_++)if(w(i,_)===w(t,S===-1?0:_-S)){if(S===-1&&(S=_),_-S+1===b)return S*c}else S!==-1&&(_-=_-S),S=-1}else for(r+b>g&&(r=g-b),_=r;_>=0;_--){let S=!0;for(let A=0;A<b;A++)if(w(i,_+A)!==w(t,A)){S=!1;break}if(S)return _}return-1}yt.prototype.includes=function(t,r,s){return this.indexOf(t,r,s)!==-1};yt.prototype.indexOf=function(t,r,s){return Mu(this,t,r,s,!0)};yt.prototype.lastIndexOf=function(t,r,s){return Mu(this,t,r,s,!1)};function my(i,t,r,s){r=Number(r)||0;let a=i.length-r;s?(s=Number(s),s>a&&(s=a)):s=a;let c=t.length;s>c/2&&(s=c/2);let g;for(g=0;g<s;++g){let b=parseInt(t.substr(g*2,2),16);if(yo(b))return g;i[r+g]=b}return g}function gy(i,t,r,s){return hf(po(t,i.length-r),i,r,s)}function yy(i,t,r,s){return hf(Iy(t),i,r,s)}function by(i,t,r,s){return hf(qu(t),i,r,s)}function wy(i,t,r,s){return hf(Ry(t,i.length-r),i,r,s)}yt.prototype.write=function(t,r,s,a){if(r===void 0)a="utf8",s=this.length,r=0;else if(s===void 0&&typeof r=="string")a=r,s=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(s)?(s=s>>>0,a===void 0&&(a="utf8")):(a=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let c=this.length-r;if((s===void 0||s>c)&&(s=c),t.length>0&&(s<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");let g=!1;for(;;)switch(a){case"hex":return my(this,t,r,s);case"utf8":case"utf-8":return gy(this,t,r,s);case"ascii":case"latin1":case"binary":return yy(this,t,r,s);case"base64":return by(this,t,r,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wy(this,t,r,s);default:if(g)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),g=!0}};yt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function My(i,t,r){return t===0&&r===i.length?uo.fromByteArray(i):uo.fromByteArray(i.slice(t,r))}function xu(i,t,r){r=Math.min(i.length,r);let s=[],a=t;for(;a<r;){let c=i[a],g=null,b=c>239?4:c>223?3:c>191?2:1;if(a+b<=r){let w,_,S,A;switch(b){case 1:c<128&&(g=c);break;case 2:w=i[a+1],(w&192)===128&&(A=(c&31)<<6|w&63,A>127&&(g=A));break;case 3:w=i[a+1],_=i[a+2],(w&192)===128&&(_&192)===128&&(A=(c&15)<<12|(w&63)<<6|_&63,A>2047&&(A<55296||A>57343)&&(g=A));break;case 4:w=i[a+1],_=i[a+2],S=i[a+3],(w&192)===128&&(_&192)===128&&(S&192)===128&&(A=(c&15)<<18|(w&63)<<12|(_&63)<<6|S&63,A>65535&&A<1114112&&(g=A))}}g===null?(g=65533,b=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),a+=b}return xy(s)}var mu=4096;function xy(i){let t=i.length;if(t<=mu)return String.fromCharCode.apply(String,i);let r="",s=0;for(;s<t;)r+=String.fromCharCode.apply(String,i.slice(s,s+=mu));return r}function _y(i,t,r){let s="";r=Math.min(i.length,r);for(let a=t;a<r;++a)s+=String.fromCharCode(i[a]&127);return s}function Sy(i,t,r){let s="";r=Math.min(i.length,r);for(let a=t;a<r;++a)s+=String.fromCharCode(i[a]);return s}function Ay(i,t,r){let s=i.length;(!t||t<0)&&(t=0),(!r||r<0||r>s)&&(r=s);let a="";for(let c=t;c<r;++c)a+=Ty[i[c]];return a}function By(i,t,r){let s=i.slice(t,r),a="";for(let c=0;c<s.length-1;c+=2)a+=String.fromCharCode(s[c]+s[c+1]*256);return a}yt.prototype.slice=function(t,r){let s=this.length;t=~~t,r=r===void 0?s:~~r,t<0?(t+=s,t<0&&(t=0)):t>s&&(t=s),r<0?(r+=s,r<0&&(r=0)):r>s&&(r=s),r<t&&(r=t);let a=this.subarray(t,r);return Object.setPrototypeOf(a,yt.prototype),a};function De(i,t,r){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+t>r)throw new RangeError("Trying to access beyond buffer length")}yt.prototype.readUintLE=yt.prototype.readUIntLE=function(t,r,s){t=t>>>0,r=r>>>0,s||De(t,r,this.length);let a=this[t],c=1,g=0;for(;++g<r&&(c*=256);)a+=this[t+g]*c;return a};yt.prototype.readUintBE=yt.prototype.readUIntBE=function(t,r,s){t=t>>>0,r=r>>>0,s||De(t,r,this.length);let a=this[t+--r],c=1;for(;r>0&&(c*=256);)a+=this[t+--r]*c;return a};yt.prototype.readUint8=yt.prototype.readUInt8=function(t,r){return t=t>>>0,r||De(t,1,this.length),this[t]};yt.prototype.readUint16LE=yt.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||De(t,2,this.length),this[t]|this[t+1]<<8};yt.prototype.readUint16BE=yt.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||De(t,2,this.length),this[t]<<8|this[t+1]};yt.prototype.readUint32LE=yt.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||De(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};yt.prototype.readUint32BE=yt.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||De(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};yt.prototype.readBigUInt64LE=_i(function(t){t=t>>>0,mn(t,"offset");let r=this[t],s=this[t+7];(r===void 0||s===void 0)&&ha(t,this.length-8);let a=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,c=this[++t]+this[++t]*2**8+this[++t]*2**16+s*2**24;return BigInt(a)+(BigInt(c)<<BigInt(32))});yt.prototype.readBigUInt64BE=_i(function(t){t=t>>>0,mn(t,"offset");let r=this[t],s=this[t+7];(r===void 0||s===void 0)&&ha(t,this.length-8);let a=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],c=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+s;return(BigInt(a)<<BigInt(32))+BigInt(c)});yt.prototype.readIntLE=function(t,r,s){t=t>>>0,r=r>>>0,s||De(t,r,this.length);let a=this[t],c=1,g=0;for(;++g<r&&(c*=256);)a+=this[t+g]*c;return c*=128,a>=c&&(a-=Math.pow(2,8*r)),a};yt.prototype.readIntBE=function(t,r,s){t=t>>>0,r=r>>>0,s||De(t,r,this.length);let a=r,c=1,g=this[t+--a];for(;a>0&&(c*=256);)g+=this[t+--a]*c;return c*=128,g>=c&&(g-=Math.pow(2,8*r)),g};yt.prototype.readInt8=function(t,r){return t=t>>>0,r||De(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};yt.prototype.readInt16LE=function(t,r){t=t>>>0,r||De(t,2,this.length);let s=this[t]|this[t+1]<<8;return s&32768?s|4294901760:s};yt.prototype.readInt16BE=function(t,r){t=t>>>0,r||De(t,2,this.length);let s=this[t+1]|this[t]<<8;return s&32768?s|4294901760:s};yt.prototype.readInt32LE=function(t,r){return t=t>>>0,r||De(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};yt.prototype.readInt32BE=function(t,r){return t=t>>>0,r||De(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};yt.prototype.readBigInt64LE=_i(function(t){t=t>>>0,mn(t,"offset");let r=this[t],s=this[t+7];(r===void 0||s===void 0)&&ha(t,this.length-8);let a=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(s<<24);return(BigInt(a)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});yt.prototype.readBigInt64BE=_i(function(t){t=t>>>0,mn(t,"offset");let r=this[t],s=this[t+7];(r===void 0||s===void 0)&&ha(t,this.length-8);let a=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(a)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+s)});yt.prototype.readFloatLE=function(t,r){return t=t>>>0,r||De(t,4,this.length),vn.read(this,t,!0,23,4)};yt.prototype.readFloatBE=function(t,r){return t=t>>>0,r||De(t,4,this.length),vn.read(this,t,!1,23,4)};yt.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||De(t,8,this.length),vn.read(this,t,!0,52,8)};yt.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||De(t,8,this.length),vn.read(this,t,!1,52,8)};function nr(i,t,r,s,a,c){if(!yt.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<c)throw new RangeError('"value" argument is out of bounds');if(r+s>i.length)throw new RangeError("Index out of range")}yt.prototype.writeUintLE=yt.prototype.writeUIntLE=function(t,r,s,a){if(t=+t,r=r>>>0,s=s>>>0,!a){let b=Math.pow(2,8*s)-1;nr(this,t,r,s,b,0)}let c=1,g=0;for(this[r]=t&255;++g<s&&(c*=256);)this[r+g]=t/c&255;return r+s};yt.prototype.writeUintBE=yt.prototype.writeUIntBE=function(t,r,s,a){if(t=+t,r=r>>>0,s=s>>>0,!a){let b=Math.pow(2,8*s)-1;nr(this,t,r,s,b,0)}let c=s-1,g=1;for(this[r+c]=t&255;--c>=0&&(g*=256);)this[r+c]=t/g&255;return r+s};yt.prototype.writeUint8=yt.prototype.writeUInt8=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,1,255,0),this[r]=t&255,r+1};yt.prototype.writeUint16LE=yt.prototype.writeUInt16LE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};yt.prototype.writeUint16BE=yt.prototype.writeUInt16BE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};yt.prototype.writeUint32LE=yt.prototype.writeUInt32LE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};yt.prototype.writeUint32BE=yt.prototype.writeUInt32BE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function _u(i,t,r,s,a){ku(t,s,a,i,r,7);let c=Number(t&BigInt(4294967295));i[r++]=c,c=c>>8,i[r++]=c,c=c>>8,i[r++]=c,c=c>>8,i[r++]=c;let g=Number(t>>BigInt(32)&BigInt(4294967295));return i[r++]=g,g=g>>8,i[r++]=g,g=g>>8,i[r++]=g,g=g>>8,i[r++]=g,r}function Su(i,t,r,s,a){ku(t,s,a,i,r,7);let c=Number(t&BigInt(4294967295));i[r+7]=c,c=c>>8,i[r+6]=c,c=c>>8,i[r+5]=c,c=c>>8,i[r+4]=c;let g=Number(t>>BigInt(32)&BigInt(4294967295));return i[r+3]=g,g=g>>8,i[r+2]=g,g=g>>8,i[r+1]=g,g=g>>8,i[r]=g,r+8}yt.prototype.writeBigUInt64LE=_i(function(t,r=0){return _u(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});yt.prototype.writeBigUInt64BE=_i(function(t,r=0){return Su(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});yt.prototype.writeIntLE=function(t,r,s,a){if(t=+t,r=r>>>0,!a){let w=Math.pow(2,8*s-1);nr(this,t,r,s,w-1,-w)}let c=0,g=1,b=0;for(this[r]=t&255;++c<s&&(g*=256);)t<0&&b===0&&this[r+c-1]!==0&&(b=1),this[r+c]=(t/g>>0)-b&255;return r+s};yt.prototype.writeIntBE=function(t,r,s,a){if(t=+t,r=r>>>0,!a){let w=Math.pow(2,8*s-1);nr(this,t,r,s,w-1,-w)}let c=s-1,g=1,b=0;for(this[r+c]=t&255;--c>=0&&(g*=256);)t<0&&b===0&&this[r+c+1]!==0&&(b=1),this[r+c]=(t/g>>0)-b&255;return r+s};yt.prototype.writeInt8=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};yt.prototype.writeInt16LE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};yt.prototype.writeInt16BE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};yt.prototype.writeInt32LE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};yt.prototype.writeInt32BE=function(t,r,s){return t=+t,r=r>>>0,s||nr(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};yt.prototype.writeBigInt64LE=_i(function(t,r=0){return _u(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});yt.prototype.writeBigInt64BE=_i(function(t,r=0){return Su(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Au(i,t,r,s,a,c){if(r+s>i.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bu(i,t,r,s,a){return t=+t,r=r>>>0,a||Au(i,t,r,4,34028234663852886e22,-34028234663852886e22),vn.write(i,t,r,s,23,4),r+4}yt.prototype.writeFloatLE=function(t,r,s){return Bu(this,t,r,!0,s)};yt.prototype.writeFloatBE=function(t,r,s){return Bu(this,t,r,!1,s)};function Eu(i,t,r,s,a){return t=+t,r=r>>>0,a||Au(i,t,r,8,17976931348623157e292,-17976931348623157e292),vn.write(i,t,r,s,52,8),r+8}yt.prototype.writeDoubleLE=function(t,r,s){return Eu(this,t,r,!0,s)};yt.prototype.writeDoubleBE=function(t,r,s){return Eu(this,t,r,!1,s)};yt.prototype.copy=function(t,r,s,a){if(!yt.isBuffer(t))throw new TypeError("argument should be a Buffer");if(s||(s=0),!a&&a!==0&&(a=this.length),r>=t.length&&(r=t.length),r||(r=0),a>0&&a<s&&(a=s),a===s||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-r<a-s&&(a=t.length-r+s);let c=a-s;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,s,a):Uint8Array.prototype.set.call(t,this.subarray(s,a),r),c};yt.prototype.fill=function(t,r,s,a){if(typeof t=="string"){if(typeof r=="string"?(a=r,r=0,s=this.length):typeof s=="string"&&(a=s,s=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!yt.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(t.length===1){let g=t.charCodeAt(0);(a==="utf8"&&g<128||a==="latin1")&&(t=g)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<s)throw new RangeError("Out of range index");if(s<=r)return this;r=r>>>0,s=s===void 0?this.length:s>>>0,t||(t=0);let c;if(typeof t=="number")for(c=r;c<s;++c)this[c]=t;else{let g=yt.isBuffer(t)?t:yt.from(t,a),b=g.length;if(b===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(c=0;c<s-r;++c)this[c+r]=g[c%b]}return this};var pn={};function go(i,t,r){pn[i]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(a){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:a,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}go("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);go("ERR_INVALID_ARG_TYPE",function(i,t){return`The "${i}" argument must be of type number. Received type ${typeof t}`},TypeError);go("ERR_OUT_OF_RANGE",function(i,t,r){let s=`The value of "${i}" is out of range.`,a=r;return Number.isInteger(r)&&Math.abs(r)>2**32?a=gu(String(r)):typeof r=="bigint"&&(a=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(a=gu(a)),a+="n"),s+=` It must be ${t}. Received ${a}`,s},RangeError);function gu(i){let t="",r=i.length,s=i[0]==="-"?1:0;for(;r>=s+4;r-=3)t=`_${i.slice(r-3,r)}${t}`;return`${i.slice(0,r)}${t}`}function Ey(i,t,r){mn(t,"offset"),(i[t]===void 0||i[t+r]===void 0)&&ha(t,i.length-(r+1))}function ku(i,t,r,s,a,c){if(i>r||i<t){let g=typeof t=="bigint"?"n":"",b;throw c>3?t===0||t===BigInt(0)?b=`>= 0${g} and < 2${g} ** ${(c+1)*8}${g}`:b=`>= -(2${g} ** ${(c+1)*8-1}${g}) and < 2 ** ${(c+1)*8-1}${g}`:b=`>= ${t}${g} and <= ${r}${g}`,new pn.ERR_OUT_OF_RANGE("value",b,i)}Ey(s,a,c)}function mn(i,t){if(typeof i!="number")throw new pn.ERR_INVALID_ARG_TYPE(t,"number",i)}function ha(i,t,r){throw Math.floor(i)!==i?(mn(i,r),new pn.ERR_OUT_OF_RANGE(r||"offset","an integer",i)):t<0?new pn.ERR_BUFFER_OUT_OF_BOUNDS:new pn.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,i)}var ky=/[^+/0-9A-Za-z-_]/g;function qy(i){if(i=i.split("=")[0],i=i.trim().replace(ky,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function po(i,t){t=t||1/0;let r,s=i.length,a=null,c=[];for(let g=0;g<s;++g){if(r=i.charCodeAt(g),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&c.push(239,191,189);continue}else if(g+1===s){(t-=3)>-1&&c.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&c.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&c.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;c.push(r)}else if(r<2048){if((t-=2)<0)break;c.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;c.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;c.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return c}function Iy(i){let t=[];for(let r=0;r<i.length;++r)t.push(i.charCodeAt(r)&255);return t}function Ry(i,t){let r,s,a,c=[];for(let g=0;g<i.length&&!((t-=2)<0);++g)r=i.charCodeAt(g),s=r>>8,a=r%256,c.push(a),c.push(s);return c}function qu(i){return uo.toByteArray(qy(i))}function hf(i,t,r,s){let a;for(a=0;a<s&&!(a+r>=t.length||a>=i.length);++a)t[a+r]=i[a];return a}function Kr(i,t){return i instanceof t||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===t.name}function yo(i){return i!==i}var Ty=function(){let i="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let s=r*16;for(let a=0;a<16;++a)t[s+a]=i[r]+i[a]}return t}();function _i(i){return typeof BigInt>"u"?Py:i}function Py(){throw new Error("BigInt not supported")}});var It=I((bo,Ru)=>{"use strict";var uf=ai(),zr=uf.Buffer;function Iu(i,t){for(var r in i)t[r]=i[r]}zr.from&&zr.alloc&&zr.allocUnsafe&&zr.allocUnsafeSlow?Ru.exports=uf:(Iu(uf,bo),bo.Buffer=Fi);function Fi(i,t,r){return zr(i,t,r)}Fi.prototype=Object.create(zr.prototype);Iu(zr,Fi);Fi.from=function(i,t,r){if(typeof i=="number")throw new TypeError("Argument must not be a number");return zr(i,t,r)};Fi.alloc=function(i,t,r){if(typeof i!="number")throw new TypeError("Argument must be a number");var s=zr(i);return t!==void 0?typeof r=="string"?s.fill(t,r):s.fill(t):s.fill(0),s};Fi.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return zr(i)};Fi.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return uf.SlowBuffer(i)}});var Ui=I((n9,Mo)=>{"use strict";var wo=65536,Cy=4294967295;function Dy(){throw new Error(`Secure random number generation is not supported by this browser.
2
- Use Chrome, Firefox or Internet Explorer 11`)}var Ny=It().Buffer,lf=global.crypto||global.msCrypto;lf&&lf.getRandomValues?Mo.exports=Ly:Mo.exports=Dy;function Ly(i,t){if(i>Cy)throw new RangeError("requested too many random bytes");var r=Ny.allocUnsafe(i);if(i>0)if(i>wo)for(var s=0;s<i;s+=wo)lf.getRandomValues(r.slice(s,s+wo));else lf.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var Rt=I((a9,xo)=>{"use strict";typeof Object.create=="function"?xo.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xo.exports=function(t,r){if(r){t.super_=r;var s=function(){};s.prototype=r.prototype,t.prototype=new s,t.prototype.constructor=t}}});var Tu=I((f9,_o)=>{"use strict";function Ke(i){if(i)return Oy(i);this._callbacks=new Map}function Oy(i){return Object.assign(i,Ke.prototype),i._callbacks=new Map,i}Ke.prototype.on=function(i,t){let r=this._callbacks.get(i)??[];return r.push(t),this._callbacks.set(i,r),this};Ke.prototype.once=function(i,t){let r=(...s)=>{this.off(i,r),t.apply(this,s)};return r.fn=t,this.on(i,r),this};Ke.prototype.off=function(i,t){if(i===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(i),this;let r=this._callbacks.get(i);if(r){for(let[s,a]of r.entries())if(a===t||a.fn===t){r.splice(s,1);break}r.length===0?this._callbacks.delete(i):this._callbacks.set(i,r)}return this};Ke.prototype.emit=function(i,...t){let r=this._callbacks.get(i);if(r){let s=[...r];for(let a of s)a.apply(this,t)}return this};Ke.prototype.listeners=function(i){return this._callbacks.get(i)??[]};Ke.prototype.listenerCount=function(i){if(i)return this.listeners(i).length;let t=0;for(let r of this._callbacks.values())t+=r.length;return t};Ke.prototype.hasListeners=function(i){return this.listenerCount(i)>0};Ke.prototype.addEventListener=Ke.prototype.on;Ke.prototype.removeListener=Ke.prototype.off;Ke.prototype.removeEventListener=Ke.prototype.off;Ke.prototype.removeAllListeners=Ke.prototype.off;typeof _o<"u"&&(_o.exports=Ke)});var df=I((o9,Cu)=>{"use strict";var Pu=Tu();function ua(){Pu.call(this)}ua.prototype=new Pu;Cu.exports=ua;ua.Stream=ua;ua.prototype.pipe=function(i,t){var r=this;function s(S){i.writable&&i.write(S)===!1&&r.pause&&r.pause()}r.on("data",s);function a(){r.readable&&r.resume&&r.resume()}i.on("drain",a),!i._isStdio&&(!t||t.end!==!1)&&(r.on("end",g),r.on("close",b));var c=!1;function g(){c||(c=!0,i.end())}function b(){c||(c=!0,typeof i.destroy=="function"&&i.destroy())}function w(S){if(_(),!this.hasListeners("error"))throw S}r.on("error",w),i.on("error",w);function _(){r.off("data",s),i.off("drain",a),r.off("end",g),r.off("close",b),r.off("error",w),i.off("error",w),r.off("end",_),r.off("close",_),i.off("end",_),i.off("close",_)}return r.on("end",_),r.on("close",_),i.on("end",_),i.on("close",_),i.emit("pipe",r),i}});var So=I((s9,Nu)=>{"use strict";var $r=It().Buffer,Du=df().Transform,Fy=Rt();function Si(i){Du.call(this),this._block=$r.allocUnsafe(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Fy(Si,Du);Si.prototype._transform=function(i,t,r){var s=null;try{this.update(i,t)}catch(a){s=a}r(s)};Si.prototype._flush=function(i){var t=null;try{this.push(this.digest())}catch(r){t=r}i(t)};var Uy=typeof Uint8Array<"u",Ky=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&($r.prototype instanceof Uint8Array||$r.TYPED_ARRAY_SUPPORT);function zy(i,t){if(i instanceof $r)return i;if(typeof i=="string")return $r.from(i,t);if(Ky&&ArrayBuffer.isView(i)){if(i.byteLength===0)return $r.alloc(0);var r=$r.from(i.buffer,i.byteOffset,i.byteLength);if(r.byteLength===i.byteLength)return r}if(Uy&&i instanceof Uint8Array||$r.isBuffer(i)&&i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i))return $r.from(i);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Si.prototype.update=function(i,t){if(this._finalized)throw new Error("Digest already called");i=zy(i,t);for(var r=this._block,s=0;this._blockOffset+i.length-s>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=i[s++];this._update(),this._blockOffset=0}for(;s<i.length;)r[this._blockOffset++]=i[s++];for(var c=0,g=i.length*8;g>0;++c)this._length[c]+=g,g=this._length[c]/4294967296|0,g>0&&(this._length[c]-=4294967296*g);return this};Si.prototype._update=function(){throw new Error("_update is not implemented")};Si.prototype.digest=function(i){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();i!==void 0&&(t=t.toString(i)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Si.prototype._digest=function(){throw new Error("_digest is not implemented")};Nu.exports=Si});var vf=I((h9,Ou)=>{"use strict";var $y=Rt(),Lu=So(),Hy=It().Buffer,Gy=new Array(16);function cf(){Lu.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}$y(cf,Lu);cf.prototype._update=function(){for(var i=Gy,t=0;t<16;++t)i[t]=this._block.readInt32LE(t*4);var r=this._a,s=this._b,a=this._c,c=this._d;r=Ge(r,s,a,c,i[0],3614090360,7),c=Ge(c,r,s,a,i[1],3905402710,12),a=Ge(a,c,r,s,i[2],606105819,17),s=Ge(s,a,c,r,i[3],3250441966,22),r=Ge(r,s,a,c,i[4],4118548399,7),c=Ge(c,r,s,a,i[5],1200080426,12),a=Ge(a,c,r,s,i[6],2821735955,17),s=Ge(s,a,c,r,i[7],4249261313,22),r=Ge(r,s,a,c,i[8],1770035416,7),c=Ge(c,r,s,a,i[9],2336552879,12),a=Ge(a,c,r,s,i[10],4294925233,17),s=Ge(s,a,c,r,i[11],2304563134,22),r=Ge(r,s,a,c,i[12],1804603682,7),c=Ge(c,r,s,a,i[13],4254626195,12),a=Ge(a,c,r,s,i[14],2792965006,17),s=Ge(s,a,c,r,i[15],1236535329,22),r=Ze(r,s,a,c,i[1],4129170786,5),c=Ze(c,r,s,a,i[6],3225465664,9),a=Ze(a,c,r,s,i[11],643717713,14),s=Ze(s,a,c,r,i[0],3921069994,20),r=Ze(r,s,a,c,i[5],3593408605,5),c=Ze(c,r,s,a,i[10],38016083,9),a=Ze(a,c,r,s,i[15],3634488961,14),s=Ze(s,a,c,r,i[4],3889429448,20),r=Ze(r,s,a,c,i[9],568446438,5),c=Ze(c,r,s,a,i[14],3275163606,9),a=Ze(a,c,r,s,i[3],4107603335,14),s=Ze(s,a,c,r,i[8],1163531501,20),r=Ze(r,s,a,c,i[13],2850285829,5),c=Ze(c,r,s,a,i[2],4243563512,9),a=Ze(a,c,r,s,i[7],1735328473,14),s=Ze(s,a,c,r,i[12],2368359562,20),r=We(r,s,a,c,i[5],4294588738,4),c=We(c,r,s,a,i[8],2272392833,11),a=We(a,c,r,s,i[11],1839030562,16),s=We(s,a,c,r,i[14],4259657740,23),r=We(r,s,a,c,i[1],2763975236,4),c=We(c,r,s,a,i[4],1272893353,11),a=We(a,c,r,s,i[7],4139469664,16),s=We(s,a,c,r,i[10],3200236656,23),r=We(r,s,a,c,i[13],681279174,4),c=We(c,r,s,a,i[0],3936430074,11),a=We(a,c,r,s,i[3],3572445317,16),s=We(s,a,c,r,i[6],76029189,23),r=We(r,s,a,c,i[9],3654602809,4),c=We(c,r,s,a,i[12],3873151461,11),a=We(a,c,r,s,i[15],530742520,16),s=We(s,a,c,r,i[2],3299628645,23),r=Ve(r,s,a,c,i[0],4096336452,6),c=Ve(c,r,s,a,i[7],1126891415,10),a=Ve(a,c,r,s,i[14],2878612391,15),s=Ve(s,a,c,r,i[5],4237533241,21),r=Ve(r,s,a,c,i[12],1700485571,6),c=Ve(c,r,s,a,i[3],2399980690,10),a=Ve(a,c,r,s,i[10],4293915773,15),s=Ve(s,a,c,r,i[1],2240044497,21),r=Ve(r,s,a,c,i[8],1873313359,6),c=Ve(c,r,s,a,i[15],4264355552,10),a=Ve(a,c,r,s,i[6],2734768916,15),s=Ve(s,a,c,r,i[13],1309151649,21),r=Ve(r,s,a,c,i[4],4149444226,6),c=Ve(c,r,s,a,i[11],3174756917,10),a=Ve(a,c,r,s,i[2],718787259,15),s=Ve(s,a,c,r,i[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+s|0,this._c=this._c+a|0,this._d=this._d+c|0};cf.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var i=Hy.allocUnsafe(16);return i.writeInt32LE(this._a,0),i.writeInt32LE(this._b,4),i.writeInt32LE(this._c,8),i.writeInt32LE(this._d,12),i};function pf(i,t){return i<<t|i>>>32-t}function Ge(i,t,r,s,a,c,g){return pf(i+(t&r|~t&s)+a+c|0,g)+t|0}function Ze(i,t,r,s,a,c,g){return pf(i+(t&s|r&~s)+a+c|0,g)+t|0}function We(i,t,r,s,a,c,g){return pf(i+(t^r^s)+a+c|0,g)+t|0}function Ve(i,t,r,s,a,c,g){return pf(i+(r^(t|~s))+a+c|0,g)+t|0}Ou.exports=cf});var Bo=I((u9,Gu)=>{"use strict";var Ao=ai().Buffer,Zy=Rt(),Hu=So(),Wy=new Array(16),la=[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],da=[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],ca=[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],pa=[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],va=[0,1518500249,1859775393,2400959708,2840853838],ma=[1352829926,1548603684,1836072691,2053994217,0];function mf(){Hu.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}Zy(mf,Hu);mf.prototype._update=function(){for(var i=Wy,t=0;t<16;++t)i[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,s=this._b|0,a=this._c|0,c=this._d|0,g=this._e|0,b=this._a|0,w=this._b|0,_=this._c|0,S=this._d|0,A=this._e|0,q=0;q<80;q+=1){var R,N;q<16?(R=Fu(r,s,a,c,g,i[la[q]],va[0],ca[q]),N=$u(b,w,_,S,A,i[da[q]],ma[0],pa[q])):q<32?(R=Uu(r,s,a,c,g,i[la[q]],va[1],ca[q]),N=zu(b,w,_,S,A,i[da[q]],ma[1],pa[q])):q<48?(R=Ku(r,s,a,c,g,i[la[q]],va[2],ca[q]),N=Ku(b,w,_,S,A,i[da[q]],ma[2],pa[q])):q<64?(R=zu(r,s,a,c,g,i[la[q]],va[3],ca[q]),N=Uu(b,w,_,S,A,i[da[q]],ma[3],pa[q])):(R=$u(r,s,a,c,g,i[la[q]],va[4],ca[q]),N=Fu(b,w,_,S,A,i[da[q]],ma[4],pa[q])),r=g,g=c,c=Ki(a,10),a=s,s=R,b=A,A=S,S=Ki(_,10),_=w,w=N}var bt=this._b+a+S|0;this._b=this._c+c+A|0,this._c=this._d+g+b|0,this._d=this._e+r+w|0,this._e=this._a+s+_|0,this._a=bt};mf.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var i=Ao.alloc?Ao.alloc(20):new Ao(20);return i.writeInt32LE(this._a,0),i.writeInt32LE(this._b,4),i.writeInt32LE(this._c,8),i.writeInt32LE(this._d,12),i.writeInt32LE(this._e,16),i};function Ki(i,t){return i<<t|i>>>32-t}function Fu(i,t,r,s,a,c,g,b){return Ki(i+(t^r^s)+c+g|0,b)+a|0}function Uu(i,t,r,s,a,c,g,b){return Ki(i+(t&r|~t&s)+c+g|0,b)+a|0}function Ku(i,t,r,s,a,c,g,b){return Ki(i+((t|~r)^s)+c+g|0,b)+a|0}function zu(i,t,r,s,a,c,g,b){return Ki(i+(t&s|r&~s)+c+g|0,b)+a|0}function $u(i,t,r,s,a,c,g,b){return Ki(i+(t^(r|~s))+c+g|0,b)+a|0}Gu.exports=mf});var zi=I((l9,Wu)=>{"use strict";var Zu=It().Buffer;function gf(i,t){this._block=Zu.alloc(i),this._finalSize=t,this._blockSize=i,this._len=0}gf.prototype.update=function(i,t){typeof i=="string"&&(t=t||"utf8",i=Zu.from(i,t));for(var r=this._block,s=this._blockSize,a=i.length,c=this._len,g=0;g<a;){for(var b=c%s,w=Math.min(a-g,s-b),_=0;_<w;_++)r[b+_]=i[g+_];c+=w,g+=w,c%s===0&&this._update(r)}return this._len+=a,this};gf.prototype.digest=function(i){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var s=(r&4294967295)>>>0,a=(r-s)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);var c=this._hash();return i?c.toString(i):c};gf.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Wu.exports=gf});var Ju=I((d9,ju)=>{"use strict";var Vy=Rt(),Vu=zi(),jy=It().Buffer,Jy=[1518500249,1859775393,-1894007588,-899497514],Xy=new Array(80);function ga(){this.init(),this._w=Xy,Vu.call(this,64,56)}Vy(ga,Vu);ga.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Yy(i){return i<<5|i>>>27}function Qy(i){return i<<30|i>>>2}function tb(i,t,r,s){return i===0?t&r|~t&s:i===2?t&r|t&s|r&s:t^r^s}ga.prototype._update=function(i){for(var t=this._w,r=this._a|0,s=this._b|0,a=this._c|0,c=this._d|0,g=this._e|0,b=0;b<16;++b)t[b]=i.readInt32BE(b*4);for(;b<80;++b)t[b]=t[b-3]^t[b-8]^t[b-14]^t[b-16];for(var w=0;w<80;++w){var _=~~(w/20),S=Yy(r)+tb(_,s,a,c)+g+t[w]+Jy[_]|0;g=c,c=a,a=Qy(s),s=r,r=S}this._a=r+this._a|0,this._b=s+this._b|0,this._c=a+this._c|0,this._d=c+this._d|0,this._e=g+this._e|0};ga.prototype._hash=function(){var i=jy.allocUnsafe(20);return i.writeInt32BE(this._a|0,0),i.writeInt32BE(this._b|0,4),i.writeInt32BE(this._c|0,8),i.writeInt32BE(this._d|0,12),i.writeInt32BE(this._e|0,16),i};ju.exports=ga});var Qu=I((c9,Yu)=>{"use strict";var eb=Rt(),Xu=zi(),rb=It().Buffer,ib=[1518500249,1859775393,-1894007588,-899497514],nb=new Array(80);function ya(){this.init(),this._w=nb,Xu.call(this,64,56)}eb(ya,Xu);ya.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ab(i){return i<<1|i>>>31}function fb(i){return i<<5|i>>>27}function ob(i){return i<<30|i>>>2}function sb(i,t,r,s){return i===0?t&r|~t&s:i===2?t&r|t&s|r&s:t^r^s}ya.prototype._update=function(i){for(var t=this._w,r=this._a|0,s=this._b|0,a=this._c|0,c=this._d|0,g=this._e|0,b=0;b<16;++b)t[b]=i.readInt32BE(b*4);for(;b<80;++b)t[b]=ab(t[b-3]^t[b-8]^t[b-14]^t[b-16]);for(var w=0;w<80;++w){var _=~~(w/20),S=fb(r)+sb(_,s,a,c)+g+t[w]+ib[_]|0;g=c,c=a,a=ob(s),s=r,r=S}this._a=r+this._a|0,this._b=s+this._b|0,this._c=a+this._c|0,this._d=c+this._d|0,this._e=g+this._e|0};ya.prototype._hash=function(){var i=rb.allocUnsafe(20);return i.writeInt32BE(this._a|0,0),i.writeInt32BE(this._b|0,4),i.writeInt32BE(this._c|0,8),i.writeInt32BE(this._d|0,12),i.writeInt32BE(this._e|0,16),i};Yu.exports=ya});var Eo=I((p9,el)=>{"use strict";var hb=Rt(),tl=zi(),ub=It().Buffer,lb=[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],db=new Array(64);function ba(){this.init(),this._w=db,tl.call(this,64,56)}hb(ba,tl);ba.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function cb(i,t,r){return r^i&(t^r)}function pb(i,t,r){return i&t|r&(i|t)}function vb(i){return(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10)}function mb(i){return(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7)}function gb(i){return(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3}function yb(i){return(i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10}ba.prototype._update=function(i){for(var t=this._w,r=this._a|0,s=this._b|0,a=this._c|0,c=this._d|0,g=this._e|0,b=this._f|0,w=this._g|0,_=this._h|0,S=0;S<16;++S)t[S]=i.readInt32BE(S*4);for(;S<64;++S)t[S]=yb(t[S-2])+t[S-7]+gb(t[S-15])+t[S-16]|0;for(var A=0;A<64;++A){var q=_+mb(g)+cb(g,b,w)+lb[A]+t[A]|0,R=vb(r)+pb(r,s,a)|0;_=w,w=b,b=g,g=c+q|0,c=a,a=s,s=r,r=q+R|0}this._a=r+this._a|0,this._b=s+this._b|0,this._c=a+this._c|0,this._d=c+this._d|0,this._e=g+this._e|0,this._f=b+this._f|0,this._g=w+this._g|0,this._h=_+this._h|0};ba.prototype._hash=function(){var i=ub.allocUnsafe(32);return i.writeInt32BE(this._a,0),i.writeInt32BE(this._b,4),i.writeInt32BE(this._c,8),i.writeInt32BE(this._d,12),i.writeInt32BE(this._e,16),i.writeInt32BE(this._f,20),i.writeInt32BE(this._g,24),i.writeInt32BE(this._h,28),i};el.exports=ba});var il=I((v9,rl)=>{"use strict";var bb=Rt(),wb=Eo(),Mb=zi(),xb=It().Buffer,_b=new Array(64);function yf(){this.init(),this._w=_b,Mb.call(this,64,56)}bb(yf,wb);yf.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};yf.prototype._hash=function(){var i=xb.allocUnsafe(28);return i.writeInt32BE(this._a,0),i.writeInt32BE(this._b,4),i.writeInt32BE(this._c,8),i.writeInt32BE(this._d,12),i.writeInt32BE(this._e,16),i.writeInt32BE(this._f,20),i.writeInt32BE(this._g,24),i};rl.exports=yf});var ko=I((m9,ul)=>{"use strict";var Sb=Rt(),hl=zi(),Ab=It().Buffer,nl=[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],Bb=new Array(160);function wa(){this.init(),this._w=Bb,hl.call(this,128,112)}Sb(wa,hl);wa.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function al(i,t,r){return r^i&(t^r)}function fl(i,t,r){return i&t|r&(i|t)}function ol(i,t){return(i>>>28|t<<4)^(t>>>2|i<<30)^(t>>>7|i<<25)}function sl(i,t){return(i>>>14|t<<18)^(i>>>18|t<<14)^(t>>>9|i<<23)}function Eb(i,t){return(i>>>1|t<<31)^(i>>>8|t<<24)^i>>>7}function kb(i,t){return(i>>>1|t<<31)^(i>>>8|t<<24)^(i>>>7|t<<25)}function qb(i,t){return(i>>>19|t<<13)^(t>>>29|i<<3)^i>>>6}function Ib(i,t){return(i>>>19|t<<13)^(t>>>29|i<<3)^(i>>>6|t<<26)}function Ne(i,t){return i>>>0<t>>>0?1:0}wa.prototype._update=function(i){for(var t=this._w,r=this._ah|0,s=this._bh|0,a=this._ch|0,c=this._dh|0,g=this._eh|0,b=this._fh|0,w=this._gh|0,_=this._hh|0,S=this._al|0,A=this._bl|0,q=this._cl|0,R=this._dl|0,N=this._el|0,bt=this._fl|0,_t=this._gl|0,gt=this._hl|0,xt=0;xt<32;xt+=2)t[xt]=i.readInt32BE(xt*4),t[xt+1]=i.readInt32BE(xt*4+4);for(;xt<160;xt+=2){var Mt=t[xt-30],At=t[xt-15*2+1],Tt=Eb(Mt,At),Bt=kb(At,Mt);Mt=t[xt-2*2],At=t[xt-2*2+1];var Pt=qb(Mt,At),O=Ib(At,Mt),St=t[xt-7*2],v=t[xt-7*2+1],e=t[xt-16*2],f=t[xt-16*2+1],h=Bt+v|0,o=Tt+St+Ne(h,Bt)|0;h=h+O|0,o=o+Pt+Ne(h,O)|0,h=h+f|0,o=o+e+Ne(h,f)|0,t[xt]=o,t[xt+1]=h}for(var u=0;u<160;u+=2){o=t[u],h=t[u+1];var p=fl(r,s,a),m=fl(S,A,q),l=ol(r,S),n=ol(S,r),d=sl(g,N),M=sl(N,g),y=nl[u],x=nl[u+1],B=al(g,b,w),E=al(N,bt,_t),k=gt+M|0,wt=_+d+Ne(k,gt)|0;k=k+E|0,wt=wt+B+Ne(k,E)|0,k=k+x|0,wt=wt+y+Ne(k,x)|0,k=k+h|0,wt=wt+o+Ne(k,h)|0;var T=n+m|0,P=l+p+Ne(T,n)|0;_=w,gt=_t,w=b,_t=bt,b=g,bt=N,N=R+k|0,g=c+wt+Ne(N,R)|0,c=a,R=q,a=s,q=A,s=r,A=S,S=k+T|0,r=wt+P+Ne(S,k)|0}this._al=this._al+S|0,this._bl=this._bl+A|0,this._cl=this._cl+q|0,this._dl=this._dl+R|0,this._el=this._el+N|0,this._fl=this._fl+bt|0,this._gl=this._gl+_t|0,this._hl=this._hl+gt|0,this._ah=this._ah+r+Ne(this._al,S)|0,this._bh=this._bh+s+Ne(this._bl,A)|0,this._ch=this._ch+a+Ne(this._cl,q)|0,this._dh=this._dh+c+Ne(this._dl,R)|0,this._eh=this._eh+g+Ne(this._el,N)|0,this._fh=this._fh+b+Ne(this._fl,bt)|0,this._gh=this._gh+w+Ne(this._gl,_t)|0,this._hh=this._hh+_+Ne(this._hl,gt)|0};wa.prototype._hash=function(){var i=Ab.allocUnsafe(64);function t(r,s,a){i.writeInt32BE(r,a),i.writeInt32BE(s,a+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),i};ul.exports=wa});var dl=I((g9,ll)=>{"use strict";var Rb=Rt(),Tb=ko(),Pb=zi(),Cb=It().Buffer,Db=new Array(160);function bf(){this.init(),this._w=Db,Pb.call(this,128,112)}Rb(bf,Tb);bf.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};bf.prototype._hash=function(){var i=Cb.allocUnsafe(48);function t(r,s,a){i.writeInt32BE(r,a),i.writeInt32BE(s,a+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),i};ll.exports=bf});var wf=I((fi,cl)=>{"use strict";var fi=cl.exports=function(t){t=t.toLowerCase();var r=fi[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};fi.sha=Ju();fi.sha1=Qu();fi.sha224=il();fi.sha256=Eo();fi.sha384=dl();fi.sha512=ko()});var ml=I((qo,vl)=>{"use strict";var Mf=ai(),oi=Mf.Buffer;function pl(i,t){for(var r in i)t[r]=i[r]}oi.from&&oi.alloc&&oi.allocUnsafe&&oi.allocUnsafeSlow?vl.exports=Mf:(pl(Mf,qo),qo.Buffer=yn);function yn(i,t,r){return oi(i,t,r)}pl(oi,yn);yn.from=function(i,t,r){if(typeof i=="number")throw new TypeError("Argument must not be a number");return oi(i,t,r)};yn.alloc=function(i,t,r){if(typeof i!="number")throw new TypeError("Argument must be a number");var s=oi(i);return t!==void 0?typeof r=="string"?s.fill(t,r):s.fill(t):s.fill(0),s};yn.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return oi(i)};yn.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Mf.SlowBuffer(i)}});var xf=I(yl=>{"use strict";var Ro=ml().Buffer,gl=Ro.isEncoding||function(i){switch(i=""+i,i&&i.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Nb(i){if(!i)return"utf8";for(var t;;)switch(i){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return i;default:if(t)return;i=(""+i).toLowerCase(),t=!0}}function Lb(i){var t=Nb(i);if(typeof t!="string"&&(Ro.isEncoding===gl||!gl(i)))throw new Error("Unknown encoding: "+i);return t||i}yl.StringDecoder=Ma;function Ma(i){this.encoding=Lb(i);var t;switch(this.encoding){case"utf16le":this.text=$b,this.end=Hb,t=4;break;case"utf8":this.fillLast=Ub,t=4;break;case"base64":this.text=Gb,this.end=Zb,t=3;break;default:this.write=Wb,this.end=Vb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(t)}Ma.prototype.write=function(i){if(i.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(i),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<i.length?t?t+this.text(i,r):this.text(i,r):t||""};Ma.prototype.end=zb;Ma.prototype.text=Kb;Ma.prototype.fillLast=function(i){if(this.lastNeed<=i.length)return i.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);i.copy(this.lastChar,this.lastTotal-this.lastNeed,0,i.length),this.lastNeed-=i.length};function Io(i){return i<=127?0:i>>5===6?2:i>>4===14?3:i>>3===30?4:i>>6===2?-1:-2}function Ob(i,t,r){var s=t.length-1;if(s<r)return 0;var a=Io(t[s]);return a>=0?(a>0&&(i.lastNeed=a-1),a):--s<r||a===-2?0:(a=Io(t[s]),a>=0?(a>0&&(i.lastNeed=a-2),a):--s<r||a===-2?0:(a=Io(t[s]),a>=0?(a>0&&(a===2?a=0:i.lastNeed=a-3),a):0))}function Fb(i,t,r){if((t[0]&192)!==128)return i.lastNeed=0,"\uFFFD";if(i.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return i.lastNeed=1,"\uFFFD";if(i.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return i.lastNeed=2,"\uFFFD"}}function Ub(i){var t=this.lastTotal-this.lastNeed,r=Fb(this,i,t);if(r!==void 0)return r;if(this.lastNeed<=i.length)return i.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);i.copy(this.lastChar,t,0,i.length),this.lastNeed-=i.length}function Kb(i,t){var r=Ob(this,i,t);if(!this.lastNeed)return i.toString("utf8",t);this.lastTotal=r;var s=i.length-(r-this.lastNeed);return i.copy(this.lastChar,0,s),i.toString("utf8",t,s)}function zb(i){var t=i&&i.length?this.write(i):"";return this.lastNeed?t+"\uFFFD":t}function $b(i,t){if((i.length-t)%2===0){var r=i.toString("utf16le",t);if(r){var s=r.charCodeAt(r.length-1);if(s>=55296&&s<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=i[i.length-2],this.lastChar[1]=i[i.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=i[i.length-1],i.toString("utf16le",t,i.length-1)}function Hb(i){var t=i&&i.length?this.write(i):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Gb(i,t){var r=(i.length-t)%3;return r===0?i.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=i[i.length-1]:(this.lastChar[0]=i[i.length-2],this.lastChar[1]=i[i.length-1]),i.toString("base64",t,i.length-r))}function Zb(i){var t=i&&i.length?this.write(i):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Wb(i){return i.toString(this.encoding)}function Vb(i){return i&&i.length?this.write(i):""}});var si=I((b9,wl)=>{"use strict";var Hr=It().Buffer,bl=df().Transform,jb=xf().StringDecoder,Jb=Rt();function Ar(i){bl.call(this),this.hashMode=typeof i=="string",this.hashMode?this[i]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}Jb(Ar,bl);var Xb=typeof Uint8Array<"u",Yb=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(Hr.prototype instanceof Uint8Array||Hr.TYPED_ARRAY_SUPPORT);function Qb(i,t){if(i instanceof Hr)return i;if(typeof i=="string")return Hr.from(i,t);if(Yb&&ArrayBuffer.isView(i)){if(i.byteLength===0)return Hr.alloc(0);var r=Hr.from(i.buffer,i.byteOffset,i.byteLength);if(r.byteLength===i.byteLength)return r}if(Xb&&i instanceof Uint8Array||Hr.isBuffer(i)&&i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i))return Hr.from(i);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Ar.prototype.update=function(i,t,r){var s=Qb(i,t),a=this._update(s);return this.hashMode?this:(r&&(a=this._toString(a,r)),a)};Ar.prototype.setAutoPadding=function(){};Ar.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Ar.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Ar.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Ar.prototype._transform=function(i,t,r){var s;try{this.hashMode?this._update(i):this.push(this._update(i))}catch(a){s=a}finally{r(s)}};Ar.prototype._flush=function(i){var t;try{this.push(this.__final())}catch(r){t=r}i(t)};Ar.prototype._finalOrDigest=function(i){var t=this.__final()||Hr.alloc(0);return i&&(t=this._toString(t,i,!0)),t};Ar.prototype._toString=function(i,t,r){if(this._decoder||(this._decoder=new jb(t),this._encoding=t),this._encoding!==t)throw new Error("can\u2019t switch encodings");var s=this._decoder.write(i);return r&&(s+=this._decoder.end()),s};wl.exports=Ar});var bn=I((w9,xl)=>{"use strict";var t3=Rt(),e3=vf(),r3=Bo(),i3=wf(),Ml=si();function _f(i){Ml.call(this,"digest"),this._hash=i}t3(_f,Ml);_f.prototype._update=function(i){this._hash.update(i)};_f.prototype._final=function(){return this._hash.digest()};xl.exports=function(t){return t=t.toLowerCase(),t==="md5"?new e3:t==="rmd160"||t==="ripemd160"?new r3:new _f(i3(t))}});var Al=I((M9,Sl)=>{"use strict";var n3=Rt(),$i=It().Buffer,_l=si(),a3=$i.alloc(128),wn=64;function Sf(i,t){_l.call(this,"digest"),typeof t=="string"&&(t=$i.from(t)),this._alg=i,this._key=t,t.length>wn?t=i(t):t.length<wn&&(t=$i.concat([t,a3],wn));for(var r=this._ipad=$i.allocUnsafe(wn),s=this._opad=$i.allocUnsafe(wn),a=0;a<wn;a++)r[a]=t[a]^54,s[a]=t[a]^92;this._hash=[r]}n3(Sf,_l);Sf.prototype._update=function(i){this._hash.push(i)};Sf.prototype._final=function(){var i=this._alg($i.concat(this._hash));return this._alg($i.concat([this._opad,i]))};Sl.exports=Sf});var El=I((x9,Bl)=>{"use strict";var f3=vf();Bl.exports=function(i){return new f3().update(i).digest()}});var Co=I((_9,ql)=>{"use strict";var o3=Rt(),s3=Al(),kl=si(),xa=It().Buffer,h3=El(),To=Bo(),Po=wf(),u3=xa.alloc(128);function _a(i,t){kl.call(this,"digest"),typeof t=="string"&&(t=xa.from(t));var r=i==="sha512"||i==="sha384"?128:64;if(this._alg=i,this._key=t,t.length>r){var s=i==="rmd160"?new To:Po(i);t=s.update(t).digest()}else t.length<r&&(t=xa.concat([t,u3],r));for(var a=this._ipad=xa.allocUnsafe(r),c=this._opad=xa.allocUnsafe(r),g=0;g<r;g++)a[g]=t[g]^54,c[g]=t[g]^92;this._hash=i==="rmd160"?new To:Po(i),this._hash.update(a)}o3(_a,kl);_a.prototype._update=function(i){this._hash.update(i)};_a.prototype._final=function(){var i=this._hash.digest(),t=this._alg==="rmd160"?new To:Po(this._alg);return t.update(this._opad).update(i).digest()};ql.exports=function(t,r){return t=t.toLowerCase(),t==="rmd160"||t==="ripemd160"?new _a("rmd160",r):t==="md5"?new s3(h3,r):new _a(t,r)}});var Do=I((S9,l3)=>{l3.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}});var Rl=I((A9,Il)=>{"use strict";Il.exports=Do()});var No=I((B9,Tl)=>{"use strict";var d3=Math.pow(2,30)-1;Tl.exports=function(i,t){if(typeof i!="number")throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if(typeof t!="number")throw new TypeError("Key length not a number");if(t<0||t>d3||t!==t)throw new TypeError("Bad key length")}});var Lo=I((E9,Cl)=>{"use strict";var Af;global.process&&global.process.browser?Af="utf-8":global.process&&global.process.version?(Pl=parseInt(process.version.split(".")[0].slice(1),10),Af=Pl>=6?"utf-8":"binary"):Af="utf-8";var Pl;Cl.exports=Af});var Ll=I((k9,Nl)=>{"use strict";var Sa=4,Dl=new Buffer(Sa);Dl.fill(0);var c3=8,p3=16;function v3(i){if(i.length%Sa!==0){var t=i.length+(Sa-i.length%Sa);i=Buffer.concat([i,Dl],t)}for(var r=new Array(i.length>>>2),s=0,a=0;s<i.length;s+=Sa,a++)r[a]=i.readInt32LE(s);return r}Nl.exports=function(t,r){var s=r(v3(t),t.length*c3);t=new Buffer(p3);for(var a=0;a<s.length;a++)t.writeInt32LE(s[a],a<<2,!0);return t}});var Fl=I((q9,Ol)=>{"use strict";var m3=Ll();function g3(i,t){i[t>>5]|=128<<t%32,i[(t+64>>>9<<4)+14]=t;for(var r=1732584193,s=-271733879,a=-1732584194,c=271733878,g=0;g<i.length;g+=16){var b=r,w=s,_=a,S=c;r=je(r,s,a,c,i[g+0],7,-680876936),c=je(c,r,s,a,i[g+1],12,-389564586),a=je(a,c,r,s,i[g+2],17,606105819),s=je(s,a,c,r,i[g+3],22,-1044525330),r=je(r,s,a,c,i[g+4],7,-176418897),c=je(c,r,s,a,i[g+5],12,1200080426),a=je(a,c,r,s,i[g+6],17,-1473231341),s=je(s,a,c,r,i[g+7],22,-45705983),r=je(r,s,a,c,i[g+8],7,1770035416),c=je(c,r,s,a,i[g+9],12,-1958414417),a=je(a,c,r,s,i[g+10],17,-42063),s=je(s,a,c,r,i[g+11],22,-1990404162),r=je(r,s,a,c,i[g+12],7,1804603682),c=je(c,r,s,a,i[g+13],12,-40341101),a=je(a,c,r,s,i[g+14],17,-1502002290),s=je(s,a,c,r,i[g+15],22,1236535329),r=Je(r,s,a,c,i[g+1],5,-165796510),c=Je(c,r,s,a,i[g+6],9,-1069501632),a=Je(a,c,r,s,i[g+11],14,643717713),s=Je(s,a,c,r,i[g+0],20,-373897302),r=Je(r,s,a,c,i[g+5],5,-701558691),c=Je(c,r,s,a,i[g+10],9,38016083),a=Je(a,c,r,s,i[g+15],14,-660478335),s=Je(s,a,c,r,i[g+4],20,-405537848),r=Je(r,s,a,c,i[g+9],5,568446438),c=Je(c,r,s,a,i[g+14],9,-1019803690),a=Je(a,c,r,s,i[g+3],14,-187363961),s=Je(s,a,c,r,i[g+8],20,1163531501),r=Je(r,s,a,c,i[g+13],5,-1444681467),c=Je(c,r,s,a,i[g+2],9,-51403784),a=Je(a,c,r,s,i[g+7],14,1735328473),s=Je(s,a,c,r,i[g+12],20,-1926607734),r=Xe(r,s,a,c,i[g+5],4,-378558),c=Xe(c,r,s,a,i[g+8],11,-2022574463),a=Xe(a,c,r,s,i[g+11],16,1839030562),s=Xe(s,a,c,r,i[g+14],23,-35309556),r=Xe(r,s,a,c,i[g+1],4,-1530992060),c=Xe(c,r,s,a,i[g+4],11,1272893353),a=Xe(a,c,r,s,i[g+7],16,-155497632),s=Xe(s,a,c,r,i[g+10],23,-1094730640),r=Xe(r,s,a,c,i[g+13],4,681279174),c=Xe(c,r,s,a,i[g+0],11,-358537222),a=Xe(a,c,r,s,i[g+3],16,-722521979),s=Xe(s,a,c,r,i[g+6],23,76029189),r=Xe(r,s,a,c,i[g+9],4,-640364487),c=Xe(c,r,s,a,i[g+12],11,-421815835),a=Xe(a,c,r,s,i[g+15],16,530742520),s=Xe(s,a,c,r,i[g+2],23,-995338651),r=Ye(r,s,a,c,i[g+0],6,-198630844),c=Ye(c,r,s,a,i[g+7],10,1126891415),a=Ye(a,c,r,s,i[g+14],15,-1416354905),s=Ye(s,a,c,r,i[g+5],21,-57434055),r=Ye(r,s,a,c,i[g+12],6,1700485571),c=Ye(c,r,s,a,i[g+3],10,-1894986606),a=Ye(a,c,r,s,i[g+10],15,-1051523),s=Ye(s,a,c,r,i[g+1],21,-2054922799),r=Ye(r,s,a,c,i[g+8],6,1873313359),c=Ye(c,r,s,a,i[g+15],10,-30611744),a=Ye(a,c,r,s,i[g+6],15,-1560198380),s=Ye(s,a,c,r,i[g+13],21,1309151649),r=Ye(r,s,a,c,i[g+4],6,-145523070),c=Ye(c,r,s,a,i[g+11],10,-1120210379),a=Ye(a,c,r,s,i[g+2],15,718787259),s=Ye(s,a,c,r,i[g+9],21,-343485551),r=Ai(r,b),s=Ai(s,w),a=Ai(a,_),c=Ai(c,S)}return[r,s,a,c]}function Bf(i,t,r,s,a,c){return Ai(y3(Ai(Ai(t,i),Ai(s,c)),a),r)}function je(i,t,r,s,a,c,g){return Bf(t&r|~t&s,i,t,a,c,g)}function Je(i,t,r,s,a,c,g){return Bf(t&s|r&~s,i,t,a,c,g)}function Xe(i,t,r,s,a,c,g){return Bf(t^r^s,i,t,a,c,g)}function Ye(i,t,r,s,a,c,g){return Bf(r^(t|~s),i,t,a,c,g)}function Ai(i,t){var r=(i&65535)+(t&65535),s=(i>>16)+(t>>16)+(r>>16);return s<<16|r&65535}function y3(i,t){return i<<t|i>>>32-t}Ol.exports=function(t){return m3(t,g3)}});var zl=I((I9,Kl)=>{"use strict";var Ul=df().Transform,b3=Rt();function Bi(i){Ul.call(this),this._block=new Buffer(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}b3(Bi,Ul);Bi.prototype._transform=function(i,t,r){var s=null;try{t!=="buffer"&&(i=new Buffer(i,t)),this.update(i)}catch(a){s=a}r(s)};Bi.prototype._flush=function(i){var t=null;try{this.push(this._digest())}catch(r){t=r}i(t)};Bi.prototype.update=function(i,t){if(!Buffer.isBuffer(i)&&typeof i!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(i)||(i=new Buffer(i,t||"binary"));for(var r=this._block,s=0;this._blockOffset+i.length-s>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=i[s++];this._update(),this._blockOffset=0}for(;s<i.length;)r[this._blockOffset++]=i[s++];for(var c=0,g=i.length*8;g>0;++c)this._length[c]+=g,g=this._length[c]/4294967296|0,g>0&&(this._length[c]-=4294967296*g);return this};Bi.prototype._update=function(i){throw new Error("_update is not implemented")};Bi.prototype.digest=function(i){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return i!==void 0&&(t=t.toString(i)),t};Bi.prototype._digest=function(){throw new Error("_digest is not implemented")};Kl.exports=Bi});var Gl=I((R9,Hl)=>{"use strict";var w3=Rt(),$l=zl();function Ef(){$l.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}w3(Ef,$l);Ef.prototype._update=function(){for(var i=new Array(16),t=0;t<16;++t)i[t]=this._block.readInt32LE(t*4);var r=this._a,s=this._b,a=this._c,c=this._d,g=this._e;r=Lt(r,s,a,c,g,i[0],0,11),a=C(a,10),g=Lt(g,r,s,a,c,i[1],0,14),s=C(s,10),c=Lt(c,g,r,s,a,i[2],0,15),r=C(r,10),a=Lt(a,c,g,r,s,i[3],0,12),g=C(g,10),s=Lt(s,a,c,g,r,i[4],0,5),c=C(c,10),r=Lt(r,s,a,c,g,i[5],0,8),a=C(a,10),g=Lt(g,r,s,a,c,i[6],0,7),s=C(s,10),c=Lt(c,g,r,s,a,i[7],0,9),r=C(r,10),a=Lt(a,c,g,r,s,i[8],0,11),g=C(g,10),s=Lt(s,a,c,g,r,i[9],0,13),c=C(c,10),r=Lt(r,s,a,c,g,i[10],0,14),a=C(a,10),g=Lt(g,r,s,a,c,i[11],0,15),s=C(s,10),c=Lt(c,g,r,s,a,i[12],0,6),r=C(r,10),a=Lt(a,c,g,r,s,i[13],0,7),g=C(g,10),s=Lt(s,a,c,g,r,i[14],0,9),c=C(c,10),r=Lt(r,s,a,c,g,i[15],0,8),a=C(a,10),g=Ot(g,r,s,a,c,i[7],1518500249,7),s=C(s,10),c=Ot(c,g,r,s,a,i[4],1518500249,6),r=C(r,10),a=Ot(a,c,g,r,s,i[13],1518500249,8),g=C(g,10),s=Ot(s,a,c,g,r,i[1],1518500249,13),c=C(c,10),r=Ot(r,s,a,c,g,i[10],1518500249,11),a=C(a,10),g=Ot(g,r,s,a,c,i[6],1518500249,9),s=C(s,10),c=Ot(c,g,r,s,a,i[15],1518500249,7),r=C(r,10),a=Ot(a,c,g,r,s,i[3],1518500249,15),g=C(g,10),s=Ot(s,a,c,g,r,i[12],1518500249,7),c=C(c,10),r=Ot(r,s,a,c,g,i[0],1518500249,12),a=C(a,10),g=Ot(g,r,s,a,c,i[9],1518500249,15),s=C(s,10),c=Ot(c,g,r,s,a,i[5],1518500249,9),r=C(r,10),a=Ot(a,c,g,r,s,i[2],1518500249,11),g=C(g,10),s=Ot(s,a,c,g,r,i[14],1518500249,7),c=C(c,10),r=Ot(r,s,a,c,g,i[11],1518500249,13),a=C(a,10),g=Ot(g,r,s,a,c,i[8],1518500249,12),s=C(s,10),c=Ft(c,g,r,s,a,i[3],1859775393,11),r=C(r,10),a=Ft(a,c,g,r,s,i[10],1859775393,13),g=C(g,10),s=Ft(s,a,c,g,r,i[14],1859775393,6),c=C(c,10),r=Ft(r,s,a,c,g,i[4],1859775393,7),a=C(a,10),g=Ft(g,r,s,a,c,i[9],1859775393,14),s=C(s,10),c=Ft(c,g,r,s,a,i[15],1859775393,9),r=C(r,10),a=Ft(a,c,g,r,s,i[8],1859775393,13),g=C(g,10),s=Ft(s,a,c,g,r,i[1],1859775393,15),c=C(c,10),r=Ft(r,s,a,c,g,i[2],1859775393,14),a=C(a,10),g=Ft(g,r,s,a,c,i[7],1859775393,8),s=C(s,10),c=Ft(c,g,r,s,a,i[0],1859775393,13),r=C(r,10),a=Ft(a,c,g,r,s,i[6],1859775393,6),g=C(g,10),s=Ft(s,a,c,g,r,i[13],1859775393,5),c=C(c,10),r=Ft(r,s,a,c,g,i[11],1859775393,12),a=C(a,10),g=Ft(g,r,s,a,c,i[5],1859775393,7),s=C(s,10),c=Ft(c,g,r,s,a,i[12],1859775393,5),r=C(r,10),a=Ut(a,c,g,r,s,i[1],2400959708,11),g=C(g,10),s=Ut(s,a,c,g,r,i[9],2400959708,12),c=C(c,10),r=Ut(r,s,a,c,g,i[11],2400959708,14),a=C(a,10),g=Ut(g,r,s,a,c,i[10],2400959708,15),s=C(s,10),c=Ut(c,g,r,s,a,i[0],2400959708,14),r=C(r,10),a=Ut(a,c,g,r,s,i[8],2400959708,15),g=C(g,10),s=Ut(s,a,c,g,r,i[12],2400959708,9),c=C(c,10),r=Ut(r,s,a,c,g,i[4],2400959708,8),a=C(a,10),g=Ut(g,r,s,a,c,i[13],2400959708,9),s=C(s,10),c=Ut(c,g,r,s,a,i[3],2400959708,14),r=C(r,10),a=Ut(a,c,g,r,s,i[7],2400959708,5),g=C(g,10),s=Ut(s,a,c,g,r,i[15],2400959708,6),c=C(c,10),r=Ut(r,s,a,c,g,i[14],2400959708,8),a=C(a,10),g=Ut(g,r,s,a,c,i[5],2400959708,6),s=C(s,10),c=Ut(c,g,r,s,a,i[6],2400959708,5),r=C(r,10),a=Ut(a,c,g,r,s,i[2],2400959708,12),g=C(g,10),s=Kt(s,a,c,g,r,i[4],2840853838,9),c=C(c,10),r=Kt(r,s,a,c,g,i[0],2840853838,15),a=C(a,10),g=Kt(g,r,s,a,c,i[5],2840853838,5),s=C(s,10),c=Kt(c,g,r,s,a,i[9],2840853838,11),r=C(r,10),a=Kt(a,c,g,r,s,i[7],2840853838,6),g=C(g,10),s=Kt(s,a,c,g,r,i[12],2840853838,8),c=C(c,10),r=Kt(r,s,a,c,g,i[2],2840853838,13),a=C(a,10),g=Kt(g,r,s,a,c,i[10],2840853838,12),s=C(s,10),c=Kt(c,g,r,s,a,i[14],2840853838,5),r=C(r,10),a=Kt(a,c,g,r,s,i[1],2840853838,12),g=C(g,10),s=Kt(s,a,c,g,r,i[3],2840853838,13),c=C(c,10),r=Kt(r,s,a,c,g,i[8],2840853838,14),a=C(a,10),g=Kt(g,r,s,a,c,i[11],2840853838,11),s=C(s,10),c=Kt(c,g,r,s,a,i[6],2840853838,8),r=C(r,10),a=Kt(a,c,g,r,s,i[15],2840853838,5),g=C(g,10),s=Kt(s,a,c,g,r,i[13],2840853838,6),c=C(c,10);var b=this._a,w=this._b,_=this._c,S=this._d,A=this._e;b=Kt(b,w,_,S,A,i[5],1352829926,8),_=C(_,10),A=Kt(A,b,w,_,S,i[14],1352829926,9),w=C(w,10),S=Kt(S,A,b,w,_,i[7],1352829926,9),b=C(b,10),_=Kt(_,S,A,b,w,i[0],1352829926,11),A=C(A,10),w=Kt(w,_,S,A,b,i[9],1352829926,13),S=C(S,10),b=Kt(b,w,_,S,A,i[2],1352829926,15),_=C(_,10),A=Kt(A,b,w,_,S,i[11],1352829926,15),w=C(w,10),S=Kt(S,A,b,w,_,i[4],1352829926,5),b=C(b,10),_=Kt(_,S,A,b,w,i[13],1352829926,7),A=C(A,10),w=Kt(w,_,S,A,b,i[6],1352829926,7),S=C(S,10),b=Kt(b,w,_,S,A,i[15],1352829926,8),_=C(_,10),A=Kt(A,b,w,_,S,i[8],1352829926,11),w=C(w,10),S=Kt(S,A,b,w,_,i[1],1352829926,14),b=C(b,10),_=Kt(_,S,A,b,w,i[10],1352829926,14),A=C(A,10),w=Kt(w,_,S,A,b,i[3],1352829926,12),S=C(S,10),b=Kt(b,w,_,S,A,i[12],1352829926,6),_=C(_,10),A=Ut(A,b,w,_,S,i[6],1548603684,9),w=C(w,10),S=Ut(S,A,b,w,_,i[11],1548603684,13),b=C(b,10),_=Ut(_,S,A,b,w,i[3],1548603684,15),A=C(A,10),w=Ut(w,_,S,A,b,i[7],1548603684,7),S=C(S,10),b=Ut(b,w,_,S,A,i[0],1548603684,12),_=C(_,10),A=Ut(A,b,w,_,S,i[13],1548603684,8),w=C(w,10),S=Ut(S,A,b,w,_,i[5],1548603684,9),b=C(b,10),_=Ut(_,S,A,b,w,i[10],1548603684,11),A=C(A,10),w=Ut(w,_,S,A,b,i[14],1548603684,7),S=C(S,10),b=Ut(b,w,_,S,A,i[15],1548603684,7),_=C(_,10),A=Ut(A,b,w,_,S,i[8],1548603684,12),w=C(w,10),S=Ut(S,A,b,w,_,i[12],1548603684,7),b=C(b,10),_=Ut(_,S,A,b,w,i[4],1548603684,6),A=C(A,10),w=Ut(w,_,S,A,b,i[9],1548603684,15),S=C(S,10),b=Ut(b,w,_,S,A,i[1],1548603684,13),_=C(_,10),A=Ut(A,b,w,_,S,i[2],1548603684,11),w=C(w,10),S=Ft(S,A,b,w,_,i[15],1836072691,9),b=C(b,10),_=Ft(_,S,A,b,w,i[5],1836072691,7),A=C(A,10),w=Ft(w,_,S,A,b,i[1],1836072691,15),S=C(S,10),b=Ft(b,w,_,S,A,i[3],1836072691,11),_=C(_,10),A=Ft(A,b,w,_,S,i[7],1836072691,8),w=C(w,10),S=Ft(S,A,b,w,_,i[14],1836072691,6),b=C(b,10),_=Ft(_,S,A,b,w,i[6],1836072691,6),A=C(A,10),w=Ft(w,_,S,A,b,i[9],1836072691,14),S=C(S,10),b=Ft(b,w,_,S,A,i[11],1836072691,12),_=C(_,10),A=Ft(A,b,w,_,S,i[8],1836072691,13),w=C(w,10),S=Ft(S,A,b,w,_,i[12],1836072691,5),b=C(b,10),_=Ft(_,S,A,b,w,i[2],1836072691,14),A=C(A,10),w=Ft(w,_,S,A,b,i[10],1836072691,13),S=C(S,10),b=Ft(b,w,_,S,A,i[0],1836072691,13),_=C(_,10),A=Ft(A,b,w,_,S,i[4],1836072691,7),w=C(w,10),S=Ft(S,A,b,w,_,i[13],1836072691,5),b=C(b,10),_=Ot(_,S,A,b,w,i[8],2053994217,15),A=C(A,10),w=Ot(w,_,S,A,b,i[6],2053994217,5),S=C(S,10),b=Ot(b,w,_,S,A,i[4],2053994217,8),_=C(_,10),A=Ot(A,b,w,_,S,i[1],2053994217,11),w=C(w,10),S=Ot(S,A,b,w,_,i[3],2053994217,14),b=C(b,10),_=Ot(_,S,A,b,w,i[11],2053994217,14),A=C(A,10),w=Ot(w,_,S,A,b,i[15],2053994217,6),S=C(S,10),b=Ot(b,w,_,S,A,i[0],2053994217,14),_=C(_,10),A=Ot(A,b,w,_,S,i[5],2053994217,6),w=C(w,10),S=Ot(S,A,b,w,_,i[12],2053994217,9),b=C(b,10),_=Ot(_,S,A,b,w,i[2],2053994217,12),A=C(A,10),w=Ot(w,_,S,A,b,i[13],2053994217,9),S=C(S,10),b=Ot(b,w,_,S,A,i[9],2053994217,12),_=C(_,10),A=Ot(A,b,w,_,S,i[7],2053994217,5),w=C(w,10),S=Ot(S,A,b,w,_,i[10],2053994217,15),b=C(b,10),_=Ot(_,S,A,b,w,i[14],2053994217,8),A=C(A,10),w=Lt(w,_,S,A,b,i[12],0,8),S=C(S,10),b=Lt(b,w,_,S,A,i[15],0,5),_=C(_,10),A=Lt(A,b,w,_,S,i[10],0,12),w=C(w,10),S=Lt(S,A,b,w,_,i[4],0,9),b=C(b,10),_=Lt(_,S,A,b,w,i[1],0,12),A=C(A,10),w=Lt(w,_,S,A,b,i[5],0,5),S=C(S,10),b=Lt(b,w,_,S,A,i[8],0,14),_=C(_,10),A=Lt(A,b,w,_,S,i[7],0,6),w=C(w,10),S=Lt(S,A,b,w,_,i[6],0,8),b=C(b,10),_=Lt(_,S,A,b,w,i[2],0,13),A=C(A,10),w=Lt(w,_,S,A,b,i[13],0,6),S=C(S,10),b=Lt(b,w,_,S,A,i[14],0,5),_=C(_,10),A=Lt(A,b,w,_,S,i[0],0,15),w=C(w,10),S=Lt(S,A,b,w,_,i[3],0,13),b=C(b,10),_=Lt(_,S,A,b,w,i[9],0,11),A=C(A,10),w=Lt(w,_,S,A,b,i[11],0,11),S=C(S,10);var q=this._b+a+S|0;this._b=this._c+c+A|0,this._c=this._d+g+b|0,this._d=this._e+r+w|0,this._e=this._a+s+_|0,this._a=q};Ef.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var i=new Buffer(20);return i.writeInt32LE(this._a,0),i.writeInt32LE(this._b,4),i.writeInt32LE(this._c,8),i.writeInt32LE(this._d,12),i.writeInt32LE(this._e,16),i};function C(i,t){return i<<t|i>>>32-t}function Lt(i,t,r,s,a,c,g,b){return C(i+(t^r^s)+c+g|0,b)+a|0}function Ot(i,t,r,s,a,c,g,b){return C(i+(t&r|~t&s)+c+g|0,b)+a|0}function Ft(i,t,r,s,a,c,g,b){return C(i+((t|~r)^s)+c+g|0,b)+a|0}function Ut(i,t,r,s,a,c,g,b){return C(i+(t&s|r&~s)+c+g|0,b)+a|0}function Kt(i,t,r,s,a,c,g,b){return C(i+(t^(r|~s))+c+g|0,b)+a|0}Hl.exports=Ef});var Wl=I((T9,Zl)=>{"use strict";var M3={}.toString;Zl.exports=Array.isArray||function(i){return M3.call(i)=="[object Array]"}});var Mn=I((P9,Vl)=>{"use strict";Vl.exports=TypeError});var Oo=I((C9,jl)=>{"use strict";jl.exports=Object});var Xl=I((D9,Jl)=>{"use strict";Jl.exports=Error});var Ql=I((N9,Yl)=>{"use strict";Yl.exports=EvalError});var ed=I((L9,td)=>{"use strict";td.exports=RangeError});var id=I((O9,rd)=>{"use strict";rd.exports=ReferenceError});var Fo=I((F9,nd)=>{"use strict";nd.exports=SyntaxError});var fd=I((U9,ad)=>{"use strict";ad.exports=URIError});var sd=I((K9,od)=>{"use strict";od.exports=Math.abs});var ud=I((z9,hd)=>{"use strict";hd.exports=Math.floor});var dd=I(($9,ld)=>{"use strict";ld.exports=Math.max});var pd=I((H9,cd)=>{"use strict";cd.exports=Math.min});var md=I((G9,vd)=>{"use strict";vd.exports=Math.pow});var yd=I((Z9,gd)=>{"use strict";gd.exports=Math.round});var wd=I((W9,bd)=>{"use strict";bd.exports=Number.isNaN||function(t){return t!==t}});var xd=I((V9,Md)=>{"use strict";var x3=wd();Md.exports=function(t){return x3(t)||t===0?t:t<0?-1:1}});var Sd=I((j9,_d)=>{"use strict";_d.exports=Object.getOwnPropertyDescriptor});var xn=I((J9,Ad)=>{"use strict";var kf=Sd();if(kf)try{kf([],"length")}catch{kf=null}Ad.exports=kf});var Aa=I((X9,Bd)=>{"use strict";var qf=Object.defineProperty||!1;if(qf)try{qf({},"a",{value:1})}catch{qf=!1}Bd.exports=qf});var Uo=I((Y9,Ed)=>{"use strict";Ed.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),s=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var a=42;t[r]=a;for(var c in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var g=Object.getOwnPropertySymbols(t);if(g.length!==1||g[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var b=Object.getOwnPropertyDescriptor(t,r);if(b.value!==a||b.enumerable!==!0)return!1}return!0}});var Id=I((Q9,qd)=>{"use strict";var kd=typeof Symbol<"u"&&Symbol,_3=Uo();qd.exports=function(){return typeof kd!="function"||typeof Symbol!="function"||typeof kd("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_3()}});var Ko=I((t_,Rd)=>{"use strict";Rd.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var zo=I((e_,Td)=>{"use strict";var S3=Oo();Td.exports=S3.getPrototypeOf||null});var Dd=I((r_,Cd)=>{"use strict";var A3="Function.prototype.bind called on incompatible ",B3=Object.prototype.toString,E3=Math.max,k3="[object Function]",Pd=function(t,r){for(var s=[],a=0;a<t.length;a+=1)s[a]=t[a];for(var c=0;c<r.length;c+=1)s[c+t.length]=r[c];return s},q3=function(t,r){for(var s=[],a=r||0,c=0;a<t.length;a+=1,c+=1)s[c]=t[a];return s},I3=function(i,t){for(var r="",s=0;s<i.length;s+=1)r+=i[s],s+1<i.length&&(r+=t);return r};Cd.exports=function(t){var r=this;if(typeof r!="function"||B3.apply(r)!==k3)throw new TypeError(A3+r);for(var s=q3(arguments,1),a,c=function(){if(this instanceof a){var S=r.apply(this,Pd(s,arguments));return Object(S)===S?S:this}return r.apply(t,Pd(s,arguments))},g=E3(0,r.length-s.length),b=[],w=0;w<g;w++)b[w]="$"+w;if(a=Function("binder","return function ("+I3(b,",")+"){ return binder.apply(this,arguments); }")(c),r.prototype){var _=function(){};_.prototype=r.prototype,a.prototype=new _,_.prototype=null}return a}});var _n=I((i_,Nd)=>{"use strict";var R3=Dd();Nd.exports=Function.prototype.bind||R3});var If=I((n_,Ld)=>{"use strict";Ld.exports=Function.prototype.call});var Rf=I((a_,Od)=>{"use strict";Od.exports=Function.prototype.apply});var Ud=I((f_,Fd)=>{"use strict";Fd.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var $o=I((o_,Kd)=>{"use strict";var T3=_n(),P3=Rf(),C3=If(),D3=Ud();Kd.exports=D3||T3.call(C3,P3)});var Tf=I((s_,zd)=>{"use strict";var N3=_n(),L3=Mn(),O3=If(),F3=$o();zd.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new L3("a function is required");return F3(N3,O3,t)}});var Vd=I((h_,Wd)=>{"use strict";var U3=Tf(),$d=xn(),Gd;try{Gd=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var Ho=!!Gd&&$d&&$d(Object.prototype,"__proto__"),Zd=Object,Hd=Zd.getPrototypeOf;Wd.exports=Ho&&typeof Ho.get=="function"?U3([Ho.get]):typeof Hd=="function"?function(t){return Hd(t==null?t:Zd(t))}:!1});var Go=I((u_,Yd)=>{"use strict";var jd=Ko(),Jd=zo(),Xd=Vd();Yd.exports=jd?function(t){return jd(t)}:Jd?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Jd(t)}:Xd?function(t){return Xd(t)}:null});var tc=I((l_,Qd)=>{"use strict";var K3=Function.prototype.call,z3=Object.prototype.hasOwnProperty,$3=_n();Qd.exports=$3.call(K3,z3)});var Vo=I((d_,fc)=>{"use strict";var Nt,H3=Oo(),G3=Xl(),Z3=Ql(),W3=ed(),V3=id(),En=Fo(),Bn=Mn(),j3=fd(),J3=sd(),X3=ud(),Y3=dd(),Q3=pd(),t6=md(),e6=yd(),r6=xd(),nc=Function,Zo=function(i){try{return nc('"use strict"; return ('+i+").constructor;")()}catch{}},Ba=xn(),i6=Aa(),Wo=function(){throw new Bn},n6=Ba?function(){try{return arguments.callee,Wo}catch{try{return Ba(arguments,"callee").get}catch{return Wo}}}():Wo,Sn=Id()(),Le=Go(),a6=zo(),f6=Ko(),ac=Rf(),Ea=If(),An={},o6=typeof Uint8Array>"u"||!Le?Nt:Le(Uint8Array),Hi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Nt:ArrayBuffer,"%ArrayIteratorPrototype%":Sn&&Le?Le([][Symbol.iterator]()):Nt,"%AsyncFromSyncIteratorPrototype%":Nt,"%AsyncFunction%":An,"%AsyncGenerator%":An,"%AsyncGeneratorFunction%":An,"%AsyncIteratorPrototype%":An,"%Atomics%":typeof Atomics>"u"?Nt:Atomics,"%BigInt%":typeof BigInt>"u"?Nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":G3,"%eval%":eval,"%EvalError%":Z3,"%Float16Array%":typeof Float16Array>"u"?Nt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Nt:FinalizationRegistry,"%Function%":nc,"%GeneratorFunction%":An,"%Int8Array%":typeof Int8Array>"u"?Nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Sn&&Le?Le(Le([][Symbol.iterator]())):Nt,"%JSON%":typeof JSON=="object"?JSON:Nt,"%Map%":typeof Map>"u"?Nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Sn||!Le?Nt:Le(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":H3,"%Object.getOwnPropertyDescriptor%":Ba,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Nt:Promise,"%Proxy%":typeof Proxy>"u"?Nt:Proxy,"%RangeError%":W3,"%ReferenceError%":V3,"%Reflect%":typeof Reflect>"u"?Nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Sn||!Le?Nt:Le(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Sn&&Le?Le(""[Symbol.iterator]()):Nt,"%Symbol%":Sn?Symbol:Nt,"%SyntaxError%":En,"%ThrowTypeError%":n6,"%TypedArray%":o6,"%TypeError%":Bn,"%Uint8Array%":typeof Uint8Array>"u"?Nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Nt:Uint32Array,"%URIError%":j3,"%WeakMap%":typeof WeakMap>"u"?Nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Nt:WeakSet,"%Function.prototype.call%":Ea,"%Function.prototype.apply%":ac,"%Object.defineProperty%":i6,"%Object.getPrototypeOf%":a6,"%Math.abs%":J3,"%Math.floor%":X3,"%Math.max%":Y3,"%Math.min%":Q3,"%Math.pow%":t6,"%Math.round%":e6,"%Math.sign%":r6,"%Reflect.getPrototypeOf%":f6};if(Le)try{null.error}catch(i){ec=Le(Le(i)),Hi["%Error.prototype%"]=ec}var ec,s6=function i(t){var r;if(t==="%AsyncFunction%")r=Zo("async function () {}");else if(t==="%GeneratorFunction%")r=Zo("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Zo("async function* () {}");else if(t==="%AsyncGenerator%"){var s=i("%AsyncGeneratorFunction%");s&&(r=s.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=i("%AsyncGenerator%");a&&Le&&(r=Le(a.prototype))}return Hi[t]=r,r},rc={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ka=_n(),Pf=tc(),h6=ka.call(Ea,Array.prototype.concat),u6=ka.call(ac,Array.prototype.splice),ic=ka.call(Ea,String.prototype.replace),Cf=ka.call(Ea,String.prototype.slice),l6=ka.call(Ea,RegExp.prototype.exec),d6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,c6=/\\(\\)?/g,p6=function(t){var r=Cf(t,0,1),s=Cf(t,-1);if(r==="%"&&s!=="%")throw new En("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&r!=="%")throw new En("invalid intrinsic syntax, expected opening `%`");var a=[];return ic(t,d6,function(c,g,b,w){a[a.length]=b?ic(w,c6,"$1"):g||c}),a},v6=function(t,r){var s=t,a;if(Pf(rc,s)&&(a=rc[s],s="%"+a[0]+"%"),Pf(Hi,s)){var c=Hi[s];if(c===An&&(c=s6(s)),typeof c>"u"&&!r)throw new Bn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:s,value:c}}throw new En("intrinsic "+t+" does not exist!")};fc.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Bn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Bn('"allowMissing" argument must be a boolean');if(l6(/^%?[^%]*%?$/,t)===null)throw new En("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=p6(t),a=s.length>0?s[0]:"",c=v6("%"+a+"%",r),g=c.name,b=c.value,w=!1,_=c.alias;_&&(a=_[0],u6(s,h6([0,1],_)));for(var S=1,A=!0;S<s.length;S+=1){var q=s[S],R=Cf(q,0,1),N=Cf(q,-1);if((R==='"'||R==="'"||R==="`"||N==='"'||N==="'"||N==="`")&&R!==N)throw new En("property names with quotes must have matching quotes");if((q==="constructor"||!A)&&(w=!0),a+="."+q,g="%"+a+"%",Pf(Hi,g))b=Hi[g];else if(b!=null){if(!(q in b)){if(!r)throw new Bn("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ba&&S+1>=s.length){var bt=Ba(b,q);A=!!bt,A&&"get"in bt&&!("originalValue"in bt.get)?b=bt.get:b=b[q]}else A=Pf(b,q),b=b[q];A&&!w&&(Hi[g]=b)}}return b}});var jo=I((c_,hc)=>{"use strict";var oc=Vo(),sc=Tf(),m6=sc([oc("%String.prototype.indexOf%")]);hc.exports=function(t,r){var s=oc(t,!!r);return typeof s=="function"&&m6(t,".prototype.")>-1?sc([s]):s}});var cc=I((p_,dc)=>{"use strict";var lc=Function.prototype.toString,kn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Xo,Df;if(typeof kn=="function"&&typeof Object.defineProperty=="function")try{Xo=Object.defineProperty({},"length",{get:function(){throw Df}}),Df={},kn(function(){throw 42},null,Xo)}catch(i){i!==Df&&(kn=null)}else kn=null;var g6=/^\s*class\b/,Yo=function(t){try{var r=lc.call(t);return g6.test(r)}catch{return!1}},Jo=function(t){try{return Yo(t)?!1:(lc.call(t),!0)}catch{return!1}},Nf=Object.prototype.toString,y6="[object Object]",b6="[object Function]",w6="[object GeneratorFunction]",M6="[object HTMLAllCollection]",x6="[object HTML document.all class]",_6="[object HTMLCollection]",S6=typeof Symbol=="function"&&!!Symbol.toStringTag,A6=!(0 in[,]),Qo=function(){return!1};typeof document=="object"&&(uc=document.all,Nf.call(uc)===Nf.call(document.all)&&(Qo=function(t){if((A6||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Nf.call(t);return(r===M6||r===x6||r===_6||r===y6)&&t("")==null}catch{}return!1}));var uc;dc.exports=kn?function(t){if(Qo(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{kn(t,null,Xo)}catch(r){if(r!==Df)return!1}return!Yo(t)&&Jo(t)}:function(t){if(Qo(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(S6)return Jo(t);if(Yo(t))return!1;var r=Nf.call(t);return r!==b6&&r!==w6&&!/^\[object HTML/.test(r)?!1:Jo(t)}});var mc=I((v_,vc)=>{"use strict";var B6=cc(),E6=Object.prototype.toString,pc=Object.prototype.hasOwnProperty,k6=function(t,r,s){for(var a=0,c=t.length;a<c;a++)pc.call(t,a)&&(s==null?r(t[a],a,t):r.call(s,t[a],a,t))},q6=function(t,r,s){for(var a=0,c=t.length;a<c;a++)s==null?r(t.charAt(a),a,t):r.call(s,t.charAt(a),a,t)},I6=function(t,r,s){for(var a in t)pc.call(t,a)&&(s==null?r(t[a],a,t):r.call(s,t[a],a,t))};function R6(i){return E6.call(i)==="[object Array]"}vc.exports=function(t,r,s){if(!B6(r))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=s),R6(t)?k6(t,r,a):typeof t=="string"?q6(t,r,a):I6(t,r,a)}});var yc=I((m_,gc)=>{"use strict";gc.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var wc=I((g_,bc)=>{"use strict";var ts=yc(),T6=typeof globalThis>"u"?global:globalThis;bc.exports=function(){for(var t=[],r=0;r<ts.length;r++)typeof T6[ts[r]]=="function"&&(t[t.length]=ts[r]);return t}});var Sc=I((y_,_c)=>{"use strict";var Mc=Aa(),P6=Fo(),qn=Mn(),xc=xn();_c.exports=function(t,r,s){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new qn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new qn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new qn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new qn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new qn("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,g=arguments.length>5?arguments[5]:null,b=arguments.length>6?arguments[6]:!1,w=!!xc&&xc(t,r);if(Mc)Mc(t,r,{configurable:g===null&&w?w.configurable:!g,enumerable:a===null&&w?w.enumerable:!a,value:s,writable:c===null&&w?w.writable:!c});else if(b||!a&&!c&&!g)t[r]=s;else throw new P6("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ec=I((b_,Bc)=>{"use strict";var es=Aa(),Ac=function(){return!!es};Ac.hasArrayLengthDefineBug=function(){if(!es)return null;try{return es([],"length",{value:1}).length!==1}catch{return!0}};Bc.exports=Ac});var Tc=I((w_,Rc)=>{"use strict";var C6=Vo(),kc=Sc(),D6=Ec()(),qc=xn(),Ic=Mn(),N6=C6("%Math.floor%");Rc.exports=function(t,r){if(typeof t!="function")throw new Ic("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||N6(r)!==r)throw new Ic("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&qc){var g=qc(t,"length");g&&!g.configurable&&(a=!1),g&&!g.writable&&(c=!1)}return(a||c||!s)&&(D6?kc(t,"length",r,!0,!0):kc(t,"length",r)),t}});var Cc=I((M_,Pc)=>{"use strict";var L6=_n(),O6=Rf(),F6=$o();Pc.exports=function(){return F6(L6,O6,arguments)}});var Lc=I((x_,Lf)=>{"use strict";var U6=Tc(),Dc=Aa(),K6=Tf(),Nc=Cc();Lf.exports=function(t){var r=K6(arguments),s=t.length-(arguments.length-1);return U6(r,1+(s>0?s:0),!0)};Dc?Dc(Lf.exports,"apply",{value:Nc}):Lf.exports.apply=Nc});var Fc=I((__,Oc)=>{"use strict";var z6=Uo();Oc.exports=function(){return z6()&&!!Symbol.toStringTag}});var Hc=I((S_,$c)=>{"use strict";var Uf=mc(),$6=wc(),Uc=Lc(),is=jo(),Ff=xn(),Of=Go(),H6=is("Object.prototype.toString"),zc=Fc()(),Kc=typeof globalThis>"u"?global:globalThis,rs=$6(),ns=is("String.prototype.slice"),G6=is("Array.prototype.indexOf",!0)||function(t,r){for(var s=0;s<t.length;s+=1)if(t[s]===r)return s;return-1},Kf={__proto__:null};zc&&Ff&&Of?Uf(rs,function(i){var t=new Kc[i];if(Symbol.toStringTag in t&&Of){var r=Of(t),s=Ff(r,Symbol.toStringTag);if(!s&&r){var a=Of(r);s=Ff(a,Symbol.toStringTag)}Kf["$"+i]=Uc(s.get)}}):Uf(rs,function(i){var t=new Kc[i],r=t.slice||t.set;r&&(Kf["$"+i]=Uc(r))});var Z6=function(t){var r=!1;return Uf(Kf,function(s,a){if(!r)try{"$"+s(t)===a&&(r=ns(a,1))}catch{}}),r},W6=function(t){var r=!1;return Uf(Kf,function(s,a){if(!r)try{s(t),r=ns(a,1)}catch{}}),r};$c.exports=function(t){if(!t||typeof t!="object")return!1;if(!zc){var r=ns(H6(t),8,-1);return G6(rs,r)>-1?r:r!=="Object"?!1:W6(t)}return Ff?Z6(t):null}});var Zc=I((A_,Gc)=>{"use strict";var V6=Hc();Gc.exports=function(t){return!!V6(t)}});var Vc=I((B_,Wc)=>{"use strict";var j6=Mn(),J6=jo(),X6=J6("TypedArray.prototype.buffer",!0),Y6=Zc();Wc.exports=X6||function(t){if(!Y6(t))throw new j6("Not a Typed Array");return t.buffer}});var Xc=I((E_,Jc)=>{"use strict";var Gr=It().Buffer,Q6=Wl(),t4=Vc(),e4=ArrayBuffer.isView||function(t){try{return t4(t),!0}catch{return!1}},r4=typeof Uint8Array<"u",jc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i4=jc&&(Gr.prototype instanceof Uint8Array||Gr.TYPED_ARRAY_SUPPORT);Jc.exports=function(t,r){if(t instanceof Gr)return t;if(typeof t=="string")return Gr.from(t,r);if(jc&&e4(t)){if(t.byteLength===0)return Gr.alloc(0);if(i4){var s=Gr.from(t.buffer,t.byteOffset,t.byteLength);if(s.byteLength===t.byteLength)return s}var a=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),c=Gr.from(a);if(c.length===t.byteLength)return c}if(r4&&t instanceof Uint8Array)return Gr.from(t);var g=Q6(t);if(g)for(var b=0;b<t.length;b+=1){var w=t[b];if(typeof w!="number"||w<0||w>255||~~w!==w)throw new RangeError("Array items must be numbers in the range 0-255.")}if(g||Gr.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Gr.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var as=I((k_,t1)=>{"use strict";var n4=It().Buffer,a4=Xc(),Qc=typeof Uint8Array<"u",f4=Qc&&typeof ArrayBuffer<"u",Yc=f4&&ArrayBuffer.isView;t1.exports=function(i,t,r){if(typeof i=="string"||n4.isBuffer(i)||Qc&&i instanceof Uint8Array||Yc&&Yc(i))return a4(i,t);throw new TypeError(r+" must be a string, a Buffer, a Uint8Array, or a DataView")}});var fs=I((q_,n1)=>{"use strict";var o4=Fl(),s4=Gl(),h4=wf(),Gi=It().Buffer,u4=No(),e1=Lo(),r1=as(),l4=Gi.alloc(128),zf={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},d4={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function c4(i){return new s4().update(i).digest()}function p4(i){function t(r){return h4(i).update(r).digest()}return i==="rmd160"||i==="ripemd160"?c4:i==="md5"?o4:t}function i1(i,t,r){var s=p4(i),a=i==="sha512"||i==="sha384"?128:64;t.length>a?t=s(t):t.length<a&&(t=Gi.concat([t,l4],a));for(var c=Gi.allocUnsafe(a+zf[i]),g=Gi.allocUnsafe(a+zf[i]),b=0;b<a;b++)c[b]=t[b]^54,g[b]=t[b]^92;var w=Gi.allocUnsafe(a+r+4);c.copy(w,0,0,a),this.ipad1=w,this.ipad2=c,this.opad=g,this.alg=i,this.blocksize=a,this.hash=s,this.size=zf[i]}i1.prototype.run=function(i,t){i.copy(t,this.blocksize);var r=this.hash(t);return r.copy(this.opad,this.blocksize),this.hash(this.opad)};function v4(i,t,r,s,a){u4(r,s),i=r1(i,e1,"Password"),t=r1(t,e1,"Salt");var c=(a||"sha1").toLowerCase(),g=d4[c]||c,b=zf[g];if(typeof b!="number"||!b)throw new TypeError("Digest algorithm not supported: "+a);var w=new i1(g,i,t.length),_=Gi.allocUnsafe(s),S=Gi.allocUnsafe(t.length+4);t.copy(S,0,0,t.length);for(var A=0,q=b,R=Math.ceil(s/q),N=1;N<=R;N++){S.writeUInt32BE(N,t.length);for(var bt=w.run(S,w.ipad1),_t=bt,gt=1;gt<r;gt++){_t=w.run(_t,w.ipad2);for(var xt=0;xt<q;xt++)bt[xt]^=_t[xt]}bt.copy(_,A),A+=q}return _}n1.exports=v4});var l1=I((I_,u1)=>{"use strict";var s1=It().Buffer,m4=No(),a1=Lo(),f1=fs(),o1=as(),$f,qa=global.crypto&&global.crypto.subtle,g4={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},os=[],Zi;function ss(){return Zi||(global.process&&global.process.nextTick?Zi=global.process.nextTick:global.queueMicrotask?Zi=global.queueMicrotask:global.setImmediate?Zi=global.setImmediate:Zi=global.setTimeout,Zi)}function h1(i,t,r,s,a){return qa.importKey("raw",i,{name:"PBKDF2"},!1,["deriveBits"]).then(function(c){return qa.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:a}},c,s<<3)}).then(function(c){return s1.from(c)})}function y4(i){if(global.process&&!global.process.browser||!qa||!qa.importKey||!qa.deriveBits)return Promise.resolve(!1);if(os[i]!==void 0)return os[i];$f=$f||s1.alloc(8);var t=h1($f,$f,10,128,i).then(function(){return!0},function(){return!1});return os[i]=t,t}function b4(i,t){i.then(function(r){ss()(function(){t(null,r)})},function(r){ss()(function(){t(r)})})}u1.exports=function(i,t,r,s,a,c){typeof a=="function"&&(c=a,a=void 0),a=a||"sha1";var g=g4[a.toLowerCase()];if(!g||typeof global.Promise!="function"){ss()(function(){var b;try{b=f1(i,t,r,s,a)}catch(w){c(w);return}c(null,b)});return}if(m4(r,s),i=o1(i,a1,"Password"),t=o1(t,a1,"Salt"),typeof c!="function")throw new Error("No callback provided to pbkdf2");b4(y4(g).then(function(b){return b?h1(i,t,r,s,g):f1(i,t,r,s,a)}),c)}});var us=I(hs=>{"use strict";hs.pbkdf2=l1();hs.pbkdf2Sync=fs()});var ls=I(mr=>{"use strict";mr.readUInt32BE=function(t,r){var s=t[0+r]<<24|t[1+r]<<16|t[2+r]<<8|t[3+r];return s>>>0};mr.writeUInt32BE=function(t,r,s){t[0+s]=r>>>24,t[1+s]=r>>>16&255,t[2+s]=r>>>8&255,t[3+s]=r&255};mr.ip=function(t,r,s,a){for(var c=0,g=0,b=6;b>=0;b-=2){for(var w=0;w<=24;w+=8)c<<=1,c|=r>>>w+b&1;for(var w=0;w<=24;w+=8)c<<=1,c|=t>>>w+b&1}for(var b=6;b>=0;b-=2){for(var w=1;w<=25;w+=8)g<<=1,g|=r>>>w+b&1;for(var w=1;w<=25;w+=8)g<<=1,g|=t>>>w+b&1}s[a+0]=c>>>0,s[a+1]=g>>>0};mr.rip=function(t,r,s,a){for(var c=0,g=0,b=0;b<4;b++)for(var w=24;w>=0;w-=8)c<<=1,c|=r>>>w+b&1,c<<=1,c|=t>>>w+b&1;for(var b=4;b<8;b++)for(var w=24;w>=0;w-=8)g<<=1,g|=r>>>w+b&1,g<<=1,g|=t>>>w+b&1;s[a+0]=c>>>0,s[a+1]=g>>>0};mr.pc1=function(t,r,s,a){for(var c=0,g=0,b=7;b>=5;b--){for(var w=0;w<=24;w+=8)c<<=1,c|=r>>w+b&1;for(var w=0;w<=24;w+=8)c<<=1,c|=t>>w+b&1}for(var w=0;w<=24;w+=8)c<<=1,c|=r>>w+b&1;for(var b=1;b<=3;b++){for(var w=0;w<=24;w+=8)g<<=1,g|=r>>w+b&1;for(var w=0;w<=24;w+=8)g<<=1,g|=t>>w+b&1}for(var w=0;w<=24;w+=8)g<<=1,g|=t>>w+b&1;s[a+0]=c>>>0,s[a+1]=g>>>0};mr.r28shl=function(t,r){return t<<r&268435455|t>>>28-r};var Hf=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];mr.pc2=function(t,r,s,a){for(var c=0,g=0,b=Hf.length>>>1,w=0;w<b;w++)c<<=1,c|=t>>>Hf[w]&1;for(var w=b;w<Hf.length;w++)g<<=1,g|=r>>>Hf[w]&1;s[a+0]=c>>>0,s[a+1]=g>>>0};mr.expand=function(t,r,s){var a=0,c=0;a=(t&1)<<5|t>>>27;for(var g=23;g>=15;g-=4)a<<=6,a|=t>>>g&63;for(var g=11;g>=3;g-=4)c|=t>>>g&63,c<<=6;c|=(t&31)<<1|t>>>31,r[s+0]=a>>>0,r[s+1]=c>>>0};var d1=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];mr.substitute=function(t,r){for(var s=0,a=0;a<4;a++){var c=t>>>18-a*6&63,g=d1[a*64+c];s<<=4,s|=g}for(var a=0;a<4;a++){var c=r>>>18-a*6&63,g=d1[4*64+a*64+c];s<<=4,s|=g}return s>>>0};var c1=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];mr.permute=function(t){for(var r=0,s=0;s<c1.length;s++)r<<=1,r|=t>>>c1[s]&1;return r>>>0};mr.padSplit=function(t,r,s){for(var a=t.toString(2);a.length<r;)a="0"+a;for(var c=[],g=0;g<r;g+=s)c.push(a.slice(g,g+s));return c.join(" ")}});var ur=I((P_,v1)=>{"use strict";v1.exports=p1;function p1(i,t){if(!i)throw new Error(t||"Assertion failed")}p1.equal=function(t,r,s){if(t!=r)throw new Error(s||"Assertion failed: "+t+" != "+r)}});var Gf=I((C_,m1)=>{"use strict";var w4=ur();function gr(i){this.options=i,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=i.padding!==!1}m1.exports=gr;gr.prototype._init=function(){};gr.prototype.update=function(t){return t.length===0?[]:this.type==="decrypt"?this._updateDecrypt(t):this._updateEncrypt(t)};gr.prototype._buffer=function(t,r){for(var s=Math.min(this.buffer.length-this.bufferOff,t.length-r),a=0;a<s;a++)this.buffer[this.bufferOff+a]=t[r+a];return this.bufferOff+=s,s};gr.prototype._flushBuffer=function(t,r){return this._update(this.buffer,0,t,r),this.bufferOff=0,this.blockSize};gr.prototype._updateEncrypt=function(t){var r=0,s=0,a=(this.bufferOff+t.length)/this.blockSize|0,c=new Array(a*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(t,r),this.bufferOff===this.buffer.length&&(s+=this._flushBuffer(c,s)));for(var g=t.length-(t.length-r)%this.blockSize;r<g;r+=this.blockSize)this._update(t,r,c,s),s+=this.blockSize;for(;r<t.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=t[r];return c};gr.prototype._updateDecrypt=function(t){for(var r=0,s=0,a=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,c=new Array(a*this.blockSize);a>0;a--)r+=this._buffer(t,r),s+=this._flushBuffer(c,s);return r+=this._buffer(t,r),c};gr.prototype.final=function(t){var r;t&&(r=this.update(t));var s;return this.type==="encrypt"?s=this._finalEncrypt():s=this._finalDecrypt(),r?r.concat(s):s};gr.prototype._pad=function(t,r){if(r===0)return!1;for(;r<t.length;)t[r++]=0;return!0};gr.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t};gr.prototype._unpad=function(t){return t};gr.prototype._finalDecrypt=function(){w4.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}});var ds=I((D_,b1)=>{"use strict";var g1=ur(),M4=Rt(),Ce=ls(),y1=Gf();function x4(){this.tmp=new Array(2),this.keys=null}function Zr(i){y1.call(this,i);var t=new x4;this._desState=t,this.deriveKeys(t,i.key)}M4(Zr,y1);b1.exports=Zr;Zr.create=function(t){return new Zr(t)};var _4=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Zr.prototype.deriveKeys=function(t,r){t.keys=new Array(16*2),g1.equal(r.length,this.blockSize,"Invalid key length");var s=Ce.readUInt32BE(r,0),a=Ce.readUInt32BE(r,4);Ce.pc1(s,a,t.tmp,0),s=t.tmp[0],a=t.tmp[1];for(var c=0;c<t.keys.length;c+=2){var g=_4[c>>>1];s=Ce.r28shl(s,g),a=Ce.r28shl(a,g),Ce.pc2(s,a,t.keys,c)}};Zr.prototype._update=function(t,r,s,a){var c=this._desState,g=Ce.readUInt32BE(t,r),b=Ce.readUInt32BE(t,r+4);Ce.ip(g,b,c.tmp,0),g=c.tmp[0],b=c.tmp[1],this.type==="encrypt"?this._encrypt(c,g,b,c.tmp,0):this._decrypt(c,g,b,c.tmp,0),g=c.tmp[0],b=c.tmp[1],Ce.writeUInt32BE(s,g,a),Ce.writeUInt32BE(s,b,a+4)};Zr.prototype._pad=function(t,r){if(this.padding===!1)return!1;for(var s=t.length-r,a=r;a<t.length;a++)t[a]=s;return!0};Zr.prototype._unpad=function(t){if(this.padding===!1)return t;for(var r=t[t.length-1],s=t.length-r;s<t.length;s++)g1.equal(t[s],r);return t.slice(0,t.length-r)};Zr.prototype._encrypt=function(t,r,s,a,c){for(var g=r,b=s,w=0;w<t.keys.length;w+=2){var _=t.keys[w],S=t.keys[w+1];Ce.expand(b,t.tmp,0),_^=t.tmp[0],S^=t.tmp[1];var A=Ce.substitute(_,S),q=Ce.permute(A),R=b;b=(g^q)>>>0,g=R}Ce.rip(b,g,a,c)};Zr.prototype._decrypt=function(t,r,s,a,c){for(var g=s,b=r,w=t.keys.length-2;w>=0;w-=2){var _=t.keys[w],S=t.keys[w+1];Ce.expand(g,t.tmp,0),_^=t.tmp[0],S^=t.tmp[1];var A=Ce.substitute(_,S),q=Ce.permute(A),R=g;g=(b^q)>>>0,b=R}Ce.rip(g,b,a,c)}});var M1=I(w1=>{"use strict";var S4=ur(),A4=Rt(),Zf={};function B4(i){S4.equal(i.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=i[t]}function E4(i){function t(c){i.call(this,c),this._cbcInit()}A4(t,i);for(var r=Object.keys(Zf),s=0;s<r.length;s++){var a=r[s];t.prototype[a]=Zf[a]}return t.create=function(g){return new t(g)},t}w1.instantiate=E4;Zf._cbcInit=function(){var t=new B4(this.options.iv);this._cbcState=t};Zf._update=function(t,r,s,a){var c=this._cbcState,g=this.constructor.super_.prototype,b=c.iv;if(this.type==="encrypt"){for(var w=0;w<this.blockSize;w++)b[w]^=t[r+w];g._update.call(this,b,0,s,a);for(var w=0;w<this.blockSize;w++)b[w]=s[a+w]}else{g._update.call(this,t,r,s,a);for(var w=0;w<this.blockSize;w++)s[a+w]^=b[w];for(var w=0;w<this.blockSize;w++)b[w]=t[r+w]}}});var S1=I((L_,_1)=>{"use strict";var k4=ur(),q4=Rt(),x1=Gf(),Ei=ds();function I4(i,t){k4.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),s=t.slice(8,16),a=t.slice(16,24);i==="encrypt"?this.ciphers=[Ei.create({type:"encrypt",key:r}),Ei.create({type:"decrypt",key:s}),Ei.create({type:"encrypt",key:a})]:this.ciphers=[Ei.create({type:"decrypt",key:a}),Ei.create({type:"encrypt",key:s}),Ei.create({type:"decrypt",key:r})]}function Wi(i){x1.call(this,i);var t=new I4(this.type,this.options.key);this._edeState=t}q4(Wi,x1);_1.exports=Wi;Wi.create=function(t){return new Wi(t)};Wi.prototype._update=function(t,r,s,a){var c=this._edeState;c.ciphers[0]._update(t,r,s,a),c.ciphers[1]._update(s,a,s,a),c.ciphers[2]._update(s,a,s,a)};Wi.prototype._pad=Ei.prototype._pad;Wi.prototype._unpad=Ei.prototype._unpad});var A1=I(In=>{"use strict";In.utils=ls();In.Cipher=Gf();In.DES=ds();In.CBC=M1();In.EDE=S1()});var k1=I((F_,E1)=>{"use strict";var B1=si(),hi=A1(),R4=Rt(),Vi=It().Buffer,Ia={"des-ede3-cbc":hi.CBC.instantiate(hi.EDE),"des-ede3":hi.EDE,"des-ede-cbc":hi.CBC.instantiate(hi.EDE),"des-ede":hi.EDE,"des-cbc":hi.CBC.instantiate(hi.DES),"des-ecb":hi.DES};Ia.des=Ia["des-cbc"];Ia.des3=Ia["des-ede3-cbc"];E1.exports=Wf;R4(Wf,B1);function Wf(i){B1.call(this);var t=i.mode.toLowerCase(),r=Ia[t],s;i.decrypt?s="decrypt":s="encrypt";var a=i.key;Vi.isBuffer(a)||(a=Vi.from(a)),(t==="des-ede"||t==="des-ede-cbc")&&(a=Vi.concat([a,a.slice(0,8)]));var c=i.iv;Vi.isBuffer(c)||(c=Vi.from(c)),this._des=r.create({key:a,iv:c,type:s})}Wf.prototype._update=function(i){return Vi.from(this._des.update(i))};Wf.prototype._final=function(){return Vi.from(this._des.final())}});var q1=I(cs=>{"use strict";cs.encrypt=function(i,t){return i._cipher.encryptBlock(t)};cs.decrypt=function(i,t){return i._cipher.decryptBlock(t)}});var Rn=I((K_,I1)=>{"use strict";I1.exports=function(t,r){for(var s=Math.min(t.length,r.length),a=new Buffer(s),c=0;c<s;++c)a[c]=t[c]^r[c];return a}});var T1=I(ps=>{"use strict";var R1=Rn();ps.encrypt=function(i,t){var r=R1(t,i._prev);return i._prev=i._cipher.encryptBlock(r),i._prev};ps.decrypt=function(i,t){var r=i._prev;i._prev=t;var s=i._cipher.decryptBlock(t);return R1(s,r)}});var D1=I(C1=>{"use strict";var Ra=It().Buffer,T4=Rn();function P1(i,t,r){var s=t.length,a=T4(t,i._cache);return i._cache=i._cache.slice(s),i._prev=Ra.concat([i._prev,r?t:a]),a}C1.encrypt=function(i,t,r){for(var s=Ra.allocUnsafe(0),a;t.length;)if(i._cache.length===0&&(i._cache=i._cipher.encryptBlock(i._prev),i._prev=Ra.allocUnsafe(0)),i._cache.length<=t.length)a=i._cache.length,s=Ra.concat([s,P1(i,t.slice(0,a),r)]),t=t.slice(a);else{s=Ra.concat([s,P1(i,t,r)]);break}return s}});var L1=I(N1=>{"use strict";var vs=It().Buffer;function P4(i,t,r){var s=i._cipher.encryptBlock(i._prev),a=s[0]^t;return i._prev=vs.concat([i._prev.slice(1),vs.from([r?t:a])]),a}N1.encrypt=function(i,t,r){for(var s=t.length,a=vs.allocUnsafe(s),c=-1;++c<s;)a[c]=P4(i,t[c],r);return a}});var F1=I(O1=>{"use strict";var Vf=It().Buffer;function C4(i,t,r){for(var s,a=-1,c=8,g=0,b,w;++a<c;)s=i._cipher.encryptBlock(i._prev),b=t&1<<7-a?128:0,w=s[0]^b,g+=(w&128)>>a%8,i._prev=D4(i._prev,r?b:w);return g}function D4(i,t){var r=i.length,s=-1,a=Vf.allocUnsafe(i.length);for(i=Vf.concat([i,Vf.from([t])]);++s<r;)a[s]=i[s]<<1|i[s+1]>>7;return a}O1.encrypt=function(i,t,r){for(var s=t.length,a=Vf.allocUnsafe(s),c=-1;++c<s;)a[c]=C4(i,t[c],r);return a}});var K1=I(U1=>{"use strict";var N4=Rn();function L4(i){return i._prev=i._cipher.encryptBlock(i._prev),i._prev}U1.encrypt=function(i,t){for(;i._cache.length<t.length;)i._cache=Buffer.concat([i._cache,L4(i)]);var r=i._cache.slice(0,t.length);return i._cache=i._cache.slice(t.length),N4(t,r)}});var ms=I((W_,z1)=>{"use strict";function O4(i){for(var t=i.length,r;t--;)if(r=i.readUInt8(t),r===255)i.writeUInt8(0,t);else{r++,i.writeUInt8(r,t);break}}z1.exports=O4});var ys=I(H1=>{"use strict";var F4=Rn(),$1=It().Buffer,U4=ms();function K4(i){var t=i._cipher.encryptBlockRaw(i._prev);return U4(i._prev),t}var gs=16;H1.encrypt=function(i,t){var r=Math.ceil(t.length/gs),s=i._cache.length;i._cache=$1.concat([i._cache,$1.allocUnsafe(r*gs)]);for(var a=0;a<r;a++){var c=K4(i),g=s+a*gs;i._cache.writeUInt32BE(c[0],g+0),i._cache.writeUInt32BE(c[1],g+4),i._cache.writeUInt32BE(c[2],g+8),i._cache.writeUInt32BE(c[3],g+12)}var b=i._cache.slice(0,t.length);return i._cache=i._cache.slice(t.length),F4(t,b)}});var bs=I((j_,z4)=>{z4.exports={"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 Jf=I((J_,G1)=>{"use strict";var $4={ECB:q1(),CBC:T1(),CFB:D1(),CFB8:L1(),CFB1:F1(),OFB:K1(),CTR:ys(),GCM:ys()},jf=bs();for(ws in jf)jf[ws].module=$4[jf[ws].mode];var ws;G1.exports=jf});var Ta=I((X_,W1)=>{"use strict";var Xf=It().Buffer;function xs(i){Xf.isBuffer(i)||(i=Xf.from(i));for(var t=i.length/4|0,r=new Array(t),s=0;s<t;s++)r[s]=i.readUInt32BE(s*4);return r}function Ms(i){for(var t=0;t<i.length;i++)i[t]=0}function Z1(i,t,r,s,a){for(var c=r[0],g=r[1],b=r[2],w=r[3],_=i[0]^t[0],S=i[1]^t[1],A=i[2]^t[2],q=i[3]^t[3],R,N,bt,_t,gt=4,xt=1;xt<a;xt++)R=c[_>>>24]^g[S>>>16&255]^b[A>>>8&255]^w[q&255]^t[gt++],N=c[S>>>24]^g[A>>>16&255]^b[q>>>8&255]^w[_&255]^t[gt++],bt=c[A>>>24]^g[q>>>16&255]^b[_>>>8&255]^w[S&255]^t[gt++],_t=c[q>>>24]^g[_>>>16&255]^b[S>>>8&255]^w[A&255]^t[gt++],_=R,S=N,A=bt,q=_t;return R=(s[_>>>24]<<24|s[S>>>16&255]<<16|s[A>>>8&255]<<8|s[q&255])^t[gt++],N=(s[S>>>24]<<24|s[A>>>16&255]<<16|s[q>>>8&255]<<8|s[_&255])^t[gt++],bt=(s[A>>>24]<<24|s[q>>>16&255]<<16|s[_>>>8&255]<<8|s[S&255])^t[gt++],_t=(s[q>>>24]<<24|s[_>>>16&255]<<16|s[S>>>8&255]<<8|s[A&255])^t[gt++],R=R>>>0,N=N>>>0,bt=bt>>>0,_t=_t>>>0,[R,N,bt,_t]}var H4=[0,1,2,4,8,16,32,64,128,27,54],Te=function(){for(var i=new Array(256),t=0;t<256;t++)t<128?i[t]=t<<1:i[t]=t<<1^283;for(var r=[],s=[],a=[[],[],[],[]],c=[[],[],[],[]],g=0,b=0,w=0;w<256;++w){var _=b^b<<1^b<<2^b<<3^b<<4;_=_>>>8^_&255^99,r[g]=_,s[_]=g;var S=i[g],A=i[S],q=i[A],R=i[_]*257^_*16843008;a[0][g]=R<<24|R>>>8,a[1][g]=R<<16|R>>>16,a[2][g]=R<<8|R>>>24,a[3][g]=R,R=q*16843009^A*65537^S*257^g*16843008,c[0][_]=R<<24|R>>>8,c[1][_]=R<<16|R>>>16,c[2][_]=R<<8|R>>>24,c[3][_]=R,g===0?g=b=1:(g=S^i[i[i[q^S]]],b^=i[i[b]])}return{SBOX:r,INV_SBOX:s,SUB_MIX:a,INV_SUB_MIX:c}}();function yr(i){this._key=xs(i),this._reset()}yr.blockSize=4*4;yr.keySize=256/8;yr.prototype.blockSize=yr.blockSize;yr.prototype.keySize=yr.keySize;yr.prototype._reset=function(){for(var i=this._key,t=i.length,r=t+6,s=(r+1)*4,a=[],c=0;c<t;c++)a[c]=i[c];for(c=t;c<s;c++){var g=a[c-1];c%t===0?(g=g<<8|g>>>24,g=Te.SBOX[g>>>24]<<24|Te.SBOX[g>>>16&255]<<16|Te.SBOX[g>>>8&255]<<8|Te.SBOX[g&255],g^=H4[c/t|0]<<24):t>6&&c%t===4&&(g=Te.SBOX[g>>>24]<<24|Te.SBOX[g>>>16&255]<<16|Te.SBOX[g>>>8&255]<<8|Te.SBOX[g&255]),a[c]=a[c-t]^g}for(var b=[],w=0;w<s;w++){var _=s-w,S=a[_-(w%4?0:4)];w<4||_<=4?b[w]=S:b[w]=Te.INV_SUB_MIX[0][Te.SBOX[S>>>24]]^Te.INV_SUB_MIX[1][Te.SBOX[S>>>16&255]]^Te.INV_SUB_MIX[2][Te.SBOX[S>>>8&255]]^Te.INV_SUB_MIX[3][Te.SBOX[S&255]]}this._nRounds=r,this._keySchedule=a,this._invKeySchedule=b};yr.prototype.encryptBlockRaw=function(i){return i=xs(i),Z1(i,this._keySchedule,Te.SUB_MIX,Te.SBOX,this._nRounds)};yr.prototype.encryptBlock=function(i){var t=this.encryptBlockRaw(i),r=Xf.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r};yr.prototype.decryptBlock=function(i){i=xs(i);var t=i[1];i[1]=i[3],i[3]=t;var r=Z1(i,this._invKeySchedule,Te.INV_SUB_MIX,Te.INV_SBOX,this._nRounds),s=Xf.allocUnsafe(16);return s.writeUInt32BE(r[0],0),s.writeUInt32BE(r[3],4),s.writeUInt32BE(r[2],8),s.writeUInt32BE(r[1],12),s};yr.prototype.scrub=function(){Ms(this._keySchedule),Ms(this._invKeySchedule),Ms(this._key)};W1.exports.AES=yr});var J1=I((Y_,j1)=>{"use strict";var Tn=It().Buffer,G4=Tn.alloc(16,0);function Z4(i){return[i.readUInt32BE(0),i.readUInt32BE(4),i.readUInt32BE(8),i.readUInt32BE(12)]}function V1(i){var t=Tn.allocUnsafe(16);return t.writeUInt32BE(i[0]>>>0,0),t.writeUInt32BE(i[1]>>>0,4),t.writeUInt32BE(i[2]>>>0,8),t.writeUInt32BE(i[3]>>>0,12),t}function Pa(i){this.h=i,this.state=Tn.alloc(16,0),this.cache=Tn.allocUnsafe(0)}Pa.prototype.ghash=function(i){for(var t=-1;++t<i.length;)this.state[t]^=i[t];this._multiply()};Pa.prototype._multiply=function(){for(var i=Z4(this.h),t=[0,0,0,0],r,s,a,c=-1;++c<128;){for(s=(this.state[~~(c/8)]&1<<7-c%8)!==0,s&&(t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]),a=(i[3]&1)!==0,r=3;r>0;r--)i[r]=i[r]>>>1|(i[r-1]&1)<<31;i[0]=i[0]>>>1,a&&(i[0]=i[0]^225<<24)}this.state=V1(t)};Pa.prototype.update=function(i){this.cache=Tn.concat([this.cache,i]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)};Pa.prototype.final=function(i,t){return this.cache.length&&this.ghash(Tn.concat([this.cache,G4],16)),this.ghash(V1([0,i,0,t])),this.state};j1.exports=Pa});var _s=I((Q_,Q1)=>{"use strict";var W4=Ta(),ar=It().Buffer,X1=si(),V4=Rt(),Y1=J1(),j4=Rn(),J4=ms();function X4(i,t){var r=0;i.length!==t.length&&r++;for(var s=Math.min(i.length,t.length),a=0;a<s;++a)r+=i[a]^t[a];return r}function Y4(i,t,r){if(t.length===12)return i._finID=ar.concat([t,ar.from([0,0,0,1])]),ar.concat([t,ar.from([0,0,0,2])]);var s=new Y1(r),a=t.length,c=a%16;s.update(t),c&&(c=16-c,s.update(ar.alloc(c,0))),s.update(ar.alloc(8,0));var g=a*8,b=ar.alloc(8);b.writeUIntBE(g,0,8),s.update(b),i._finID=s.state;var w=ar.from(i._finID);return J4(w),w}function ji(i,t,r,s){X1.call(this);var a=ar.alloc(4,0);this._cipher=new W4.AES(t);var c=this._cipher.encryptBlock(a);this._ghash=new Y1(c),r=Y4(this,r,c),this._prev=ar.from(r),this._cache=ar.allocUnsafe(0),this._secCache=ar.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}V4(ji,X1);ji.prototype._update=function(i){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=ar.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,i);return this._decrypt?this._ghash.update(i):this._ghash.update(r),this._len+=i.length,r};ji.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var i=j4(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&X4(i,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=i,this._cipher.scrub()};ji.prototype.getAuthTag=function(){if(this._decrypt||!ar.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};ji.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t};ji.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length};Q1.exports=ji});var As=I((tS,ep)=>{"use strict";var Q4=Ta(),Ss=It().Buffer,tp=si(),tw=Rt();function Yf(i,t,r,s){tp.call(this),this._cipher=new Q4.AES(t),this._prev=Ss.from(r),this._cache=Ss.allocUnsafe(0),this._secCache=Ss.allocUnsafe(0),this._decrypt=s,this._mode=i}tw(Yf,tp);Yf.prototype._update=function(i){return this._mode.encrypt(this,i,this._decrypt)};Yf.prototype._final=function(){this._cipher.scrub()};ep.exports=Yf});var Ca=I((eS,rp)=>{"use strict";var Ji=It().Buffer,ew=vf();function rw(i,t,r,s){if(Ji.isBuffer(i)||(i=Ji.from(i,"binary")),t&&(Ji.isBuffer(t)||(t=Ji.from(t,"binary")),t.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,c=Ji.alloc(a),g=Ji.alloc(s||0),b=Ji.alloc(0);a>0||s>0;){var w=new ew;w.update(b),w.update(i),t&&w.update(t),b=w.digest();var _=0;if(a>0){var S=c.length-a;_=Math.min(a,b.length),b.copy(c,S,0,_),a-=_}if(_<b.length&&s>0){var A=g.length-s,q=Math.min(s,b.length-_);b.copy(g,A,_,_+q),s-=q}}return b.fill(0),{key:c,iv:g}}rp.exports=rw});var fp=I(Bs=>{"use strict";var ip=Jf(),iw=_s(),ui=It().Buffer,nw=As(),np=si(),aw=Ta(),fw=Ca(),ow=Rt();function Da(i,t,r){np.call(this),this._cache=new Qf,this._cipher=new aw.AES(t),this._prev=ui.from(r),this._mode=i,this._autopadding=!0}ow(Da,np);Da.prototype._update=function(i){this._cache.add(i);for(var t,r,s=[];t=this._cache.get();)r=this._mode.encrypt(this,t),s.push(r);return ui.concat(s)};var sw=ui.alloc(16,16);Da.prototype._final=function(){var i=this._cache.flush();if(this._autopadding)return i=this._mode.encrypt(this,i),this._cipher.scrub(),i;if(!i.equals(sw))throw this._cipher.scrub(),new Error("data not multiple of block length")};Da.prototype.setAutoPadding=function(i){return this._autopadding=!!i,this};function Qf(){this.cache=ui.allocUnsafe(0)}Qf.prototype.add=function(i){this.cache=ui.concat([this.cache,i])};Qf.prototype.get=function(){if(this.cache.length>15){var i=this.cache.slice(0,16);return this.cache=this.cache.slice(16),i}return null};Qf.prototype.flush=function(){for(var i=16-this.cache.length,t=ui.allocUnsafe(i),r=-1;++r<i;)t.writeUInt8(i,r);return ui.concat([this.cache,t])};function ap(i,t,r){var s=ip[i.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof t=="string"&&(t=ui.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if(typeof r=="string"&&(r=ui.from(r)),s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return s.type==="stream"?new nw(s.module,t,r):s.type==="auth"?new iw(s.module,t,r):new Da(s.module,t,r)}function hw(i,t){var r=ip[i.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var s=fw(t,!1,r.key,r.iv);return ap(i,s.key,s.iv)}Bs.createCipheriv=ap;Bs.createCipher=hw});var up=I(Es=>{"use strict";var uw=_s(),Pn=It().Buffer,op=Jf(),lw=As(),sp=si(),dw=Ta(),cw=Ca(),pw=Rt();function Na(i,t,r){sp.call(this),this._cache=new t0,this._last=void 0,this._cipher=new dw.AES(t),this._prev=Pn.from(r),this._mode=i,this._autopadding=!0}pw(Na,sp);Na.prototype._update=function(i){this._cache.add(i);for(var t,r,s=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),s.push(r);return Pn.concat(s)};Na.prototype._final=function(){var i=this._cache.flush();if(this._autopadding)return vw(this._mode.decrypt(this,i));if(i)throw new Error("data not multiple of block length")};Na.prototype.setAutoPadding=function(i){return this._autopadding=!!i,this};function t0(){this.cache=Pn.allocUnsafe(0)}t0.prototype.add=function(i){this.cache=Pn.concat([this.cache,i])};t0.prototype.get=function(i){var t;if(i){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null};t0.prototype.flush=function(){if(this.cache.length)return this.cache};function vw(i){var t=i[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(i[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(t!==16)return i.slice(0,16-t)}function hp(i,t,r){var s=op[i.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof r=="string"&&(r=Pn.from(r)),s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if(typeof t=="string"&&(t=Pn.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return s.type==="stream"?new lw(s.module,t,r,!0):s.type==="auth"?new uw(s.module,t,r,!0):new Na(s.module,t,r)}function mw(i,t){var r=op[i.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var s=cw(t,!1,r.key,r.iv);return hp(i,s.key,s.iv)}Es.createDecipher=mw;Es.createDecipheriv=hp});var e0=I(Br=>{"use strict";var lp=fp(),dp=up(),gw=bs();function yw(){return Object.keys(gw)}Br.createCipher=Br.Cipher=lp.createCipher;Br.createCipheriv=Br.Cipheriv=lp.createCipheriv;Br.createDecipher=Br.Decipher=dp.createDecipher;Br.createDecipheriv=Br.Decipheriv=dp.createDecipheriv;Br.listCiphers=Br.getCiphers=yw});var cp=I(li=>{"use strict";li["des-ecb"]={key:8,iv:0};li["des-cbc"]=li.des={key:8,iv:8};li["des-ede3-cbc"]=li.des3={key:24,iv:8};li["des-ede3"]={key:24,iv:0};li["des-ede-cbc"]={key:16,iv:8};li["des-ede"]={key:16,iv:0}});var yp=I(Er=>{"use strict";var pp=k1(),ks=e0(),ki=Jf(),di=cp(),vp=Ca();function bw(i,t){i=i.toLowerCase();var r,s;if(ki[i])r=ki[i].key,s=ki[i].iv;else if(di[i])r=di[i].key*8,s=di[i].iv;else throw new TypeError("invalid suite type");var a=vp(t,!1,r,s);return mp(i,a.key,a.iv)}function ww(i,t){i=i.toLowerCase();var r,s;if(ki[i])r=ki[i].key,s=ki[i].iv;else if(di[i])r=di[i].key*8,s=di[i].iv;else throw new TypeError("invalid suite type");var a=vp(t,!1,r,s);return gp(i,a.key,a.iv)}function mp(i,t,r){if(i=i.toLowerCase(),ki[i])return ks.createCipheriv(i,t,r);if(di[i])return new pp({key:t,iv:r,mode:i});throw new TypeError("invalid suite type")}function gp(i,t,r){if(i=i.toLowerCase(),ki[i])return ks.createDecipheriv(i,t,r);if(di[i])return new pp({key:t,iv:r,mode:i,decrypt:!0});throw new TypeError("invalid suite type")}function Mw(){return Object.keys(di).concat(ks.getCiphers())}Er.createCipher=Er.Cipher=bw;Er.createCipheriv=Er.Cipheriv=mp;Er.createDecipher=Er.Decipher=ww;Er.createDecipheriv=Er.Decipheriv=gp;Er.listCiphers=Er.getCiphers=Mw});var qi=I(()=>{"use strict"});var Is=I((bp,qs)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof qs>"u"||qs,bp)});var Mp=I((wp,Rs)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof Rs>"u"||Rs,wp)});var r0=I((hS,Cs)=>{"use strict";var Ts;Cs.exports=function(t){return Ts||(Ts=new Ii(null)),Ts.generate(t)};function Ii(i){this.rand=i}Cs.exports.Rand=Ii;Ii.prototype.generate=function(t){return this._rand(t)};Ii.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),s=0;s<r.length;s++)r[s]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ii.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Ii.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Ii.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(Ps=Ds(),typeof Ps.randomBytes!="function")throw new Error("Not supported");Ii.prototype._rand=function(t){return Ps.randomBytes(t)}}catch{}var Ps});var Ns=I((uS,xp)=>{"use strict";var Xi=Mp(),xw=r0();function Yi(i){this.rand=i||new xw.Rand}xp.exports=Yi;Yi.create=function(t){return new Yi(t)};Yi.prototype._randbelow=function(t){var r=t.bitLength(),s=Math.ceil(r/8);do var a=new Xi(this.rand.generate(s));while(a.cmp(t)>=0);return a};Yi.prototype._randrange=function(t,r){var s=r.sub(t);return t.add(this._randbelow(s))};Yi.prototype.test=function(t,r,s){var a=t.bitLength(),c=Xi.mont(t),g=new Xi(1).toRed(c);r||(r=Math.max(1,a/48|0));for(var b=t.subn(1),w=0;!b.testn(w);w++);for(var _=t.shrn(w),S=b.toRed(c),A=!0;r>0;r--){var q=this._randrange(new Xi(2),b);s&&s(q);var R=q.toRed(c).redPow(_);if(!(R.cmp(g)===0||R.cmp(S)===0)){for(var N=1;N<w;N++){if(R=R.redSqr(),R.cmp(g)===0)return!1;if(R.cmp(S)===0)break}if(N===w)return!1}}return A};Yi.prototype.getDivisor=function(t,r){var s=t.bitLength(),a=Xi.mont(t),c=new Xi(1).toRed(a);r||(r=Math.max(1,s/48|0));for(var g=t.subn(1),b=0;!g.testn(b);b++);for(var w=t.shrn(b),_=g.toRed(a);r>0;r--){var S=this._randrange(new Xi(2),g),A=t.gcd(S);if(A.cmpn(1)!==0)return A;var q=S.toRed(a).redPow(w);if(!(q.cmp(c)===0||q.cmp(_)===0)){for(var R=1;R<b;R++){if(q=q.redSqr(),q.cmp(c)===0)return q.fromRed().subn(1).gcd(t);if(q.cmp(_)===0)break}if(R===b)return q=q.redSqr(),q.fromRed().subn(1).gcd(t)}}return!1}});var zs=I((vS,Ap)=>{"use strict";var _w=Ui();Ap.exports=Ks;Ks.simpleSieve=Fs;Ks.fermatTest=Us;var ze=Is(),Sw=new ze(24),Aw=Ns(),_p=new Aw,Bw=new ze(1),Os=new ze(2),Ew=new ze(5),lS=new ze(16),dS=new ze(8),kw=new ze(10),qw=new ze(3),cS=new ze(7),Iw=new ze(11),Sp=new ze(4),pS=new ze(12),Ls=null;function Rw(){if(Ls!==null)return Ls;var i=1048576,t=[];t[0]=2;for(var r=1,s=3;s<i;s+=2){for(var a=Math.ceil(Math.sqrt(s)),c=0;c<r&&t[c]<=a&&s%t[c]!==0;c++);r!==c&&t[c]<=a||(t[r++]=s)}return Ls=t,t}function Fs(i){for(var t=Rw(),r=0;r<t.length;r++)if(i.modn(t[r])===0)return i.cmpn(t[r])===0;return!0}function Us(i){var t=ze.mont(i);return Os.toRed(t).redPow(i.subn(1)).fromRed().cmpn(1)===0}function Ks(i,t){if(i<16)return t===2||t===5?new ze([140,123]):new ze([140,39]);t=new ze(t);for(var r,s;;){for(r=new ze(_w(Math.ceil(i/8)));r.bitLength()>i;)r.ishrn(1);if(r.isEven()&&r.iadd(Bw),r.testn(1)||r.iadd(Os),t.cmp(Os)){if(!t.cmp(Ew))for(;r.mod(kw).cmp(qw);)r.iadd(Sp)}else for(;r.mod(Sw).cmp(Iw);)r.iadd(Sp);if(s=r.shrn(1),Fs(s)&&Fs(r)&&Us(s)&&Us(r)&&_p.test(s)&&_p.test(r))return r}}});var Bp=I((mS,Tw)=>{Tw.exports={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 Ip=I((gS,qp)=>{"use strict";var br=Is(),Pw=Ns(),Ep=new Pw,Cw=new br(24),Dw=new br(11),Nw=new br(10),Lw=new br(3),Ow=new br(7),kp=zs(),Fw=Ui();qp.exports=ci;function Uw(i,t){return t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t)),this._pub=new br(i),this}function Kw(i,t){return t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t)),this._priv=new br(i),this}var i0={};function zw(i,t){var r=t.toString("hex"),s=[r,i.toString(16)].join("_");if(s in i0)return i0[s];var a=0;if(i.isEven()||!kp.simpleSieve||!kp.fermatTest(i)||!Ep.test(i))return a+=1,r==="02"||r==="05"?a+=8:a+=4,i0[s]=a,a;Ep.test(i.shrn(1))||(a+=2);var c;switch(r){case"02":i.mod(Cw).cmp(Dw)&&(a+=8);break;case"05":c=i.mod(Nw),c.cmp(Lw)&&c.cmp(Ow)&&(a+=8);break;default:a+=4}return i0[s]=a,a}function ci(i,t,r){this.setGenerator(t),this.__prime=new br(i),this._prime=br.mont(this.__prime),this._primeLen=i.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=Uw,this.setPrivateKey=Kw):this._primeCode=8}Object.defineProperty(ci.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=zw(this.__prime,this.__gen)),this._primeCode}});ci.prototype.generateKeys=function(){return this._priv||(this._priv=new br(Fw(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()};ci.prototype.computeSecret=function(i){i=new br(i),i=i.toRed(this._prime);var t=i.redPow(this._priv).fromRed(),r=new Buffer(t.toArray()),s=this.getPrime();if(r.length<s.length){var a=new Buffer(s.length-r.length);a.fill(0),r=Buffer.concat([a,r])}return r};ci.prototype.getPublicKey=function(t){return n0(this._pub,t)};ci.prototype.getPrivateKey=function(t){return n0(this._priv,t)};ci.prototype.getPrime=function(i){return n0(this.__prime,i)};ci.prototype.getGenerator=function(i){return n0(this._gen,i)};ci.prototype.setGenerator=function(i,t){return t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t)),this.__gen=i,this._gen=new br(i),this};function n0(i,t){var r=new Buffer(i.toArray());return t?r.toString(t):r}});var Pp=I(Cn=>{"use strict";var $w=zs(),Rp=Bp(),$s=Ip();function Hw(i){var t=new Buffer(Rp[i].prime,"hex"),r=new Buffer(Rp[i].gen,"hex");return new $s(t,r)}var Gw={binary:!0,hex:!0,base64:!0};function Tp(i,t,r,s){return Buffer.isBuffer(t)||Gw[t]===void 0?Tp(i,"binary",t,r):(t=t||"binary",s=s||"binary",r=r||new Buffer([2]),Buffer.isBuffer(r)||(r=new Buffer(r,s)),typeof i=="number"?new $s($w(i,r),r,!0):(Buffer.isBuffer(i)||(i=new Buffer(i,t)),new $s(i,r,!0)))}Cn.DiffieHellmanGroup=Cn.createDiffieHellmanGroup=Cn.getDiffieHellman=Hw;Cn.createDiffieHellman=Cn.DiffieHellman=Tp});var La=I((bS,Hs)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Hs.exports={nextTick:Zw}:Hs.exports=process;function Zw(i,t,r,s){if(typeof i!="function")throw new TypeError('"callback" argument must be a function');var a=arguments.length,c,g;switch(a){case 0:case 1:return process.nextTick(i);case 2:return process.nextTick(function(){i.call(null,t)});case 3:return process.nextTick(function(){i.call(null,t,r)});case 4:return process.nextTick(function(){i.call(null,t,r,s)});default:for(c=new Array(a-1),g=0;g<c.length;)c[g++]=arguments[g];return process.nextTick(function(){i.apply(null,c)})}}});var Dp=I((wS,Cp)=>{"use strict";var Ww={}.toString;Cp.exports=Array.isArray||function(i){return Ww.call(i)=="[object Array]"}});var o0=I((MS,Gs)=>{"use strict";var Dn=typeof Reflect=="object"?Reflect:null,Np=Dn&&typeof Dn.apply=="function"?Dn.apply:function(t,r,s){return Function.prototype.apply.call(t,r,s)},a0;Dn&&typeof Dn.ownKeys=="function"?a0=Dn.ownKeys:Object.getOwnPropertySymbols?a0=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:a0=function(t){return Object.getOwnPropertyNames(t)};function Vw(i){console&&console.warn&&console.warn(i)}var Op=Number.isNaN||function(t){return t!==t};function Ht(){Ht.init.call(this)}Gs.exports=Ht;Gs.exports.once=Yw;Ht.EventEmitter=Ht;Ht.prototype._events=void 0;Ht.prototype._eventsCount=0;Ht.prototype._maxListeners=void 0;var Lp=10;function f0(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(Ht,"defaultMaxListeners",{enumerable:!0,get:function(){return Lp},set:function(i){if(typeof i!="number"||i<0||Op(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Lp=i}});Ht.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Ht.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Op(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Fp(i){return i._maxListeners===void 0?Ht.defaultMaxListeners:i._maxListeners}Ht.prototype.getMaxListeners=function(){return Fp(this)};Ht.prototype.emit=function(t){for(var r=[],s=1;s<arguments.length;s++)r.push(arguments[s]);var a=t==="error",c=this._events;if(c!==void 0)a=a&&c.error===void 0;else if(!a)return!1;if(a){var g;if(r.length>0&&(g=r[0]),g instanceof Error)throw g;var b=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw b.context=g,b}var w=c[t];if(w===void 0)return!1;if(typeof w=="function")Np(w,this,r);else for(var _=w.length,S=Hp(w,_),s=0;s<_;++s)Np(S[s],this,r);return!0};function Up(i,t,r,s){var a,c,g;if(f0(r),c=i._events,c===void 0?(c=i._events=Object.create(null),i._eventsCount=0):(c.newListener!==void 0&&(i.emit("newListener",t,r.listener?r.listener:r),c=i._events),g=c[t]),g===void 0)g=c[t]=r,++i._eventsCount;else if(typeof g=="function"?g=c[t]=s?[r,g]:[g,r]:s?g.unshift(r):g.push(r),a=Fp(i),a>0&&g.length>a&&!g.warned){g.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=i,b.type=t,b.count=g.length,Vw(b)}return i}Ht.prototype.addListener=function(t,r){return Up(this,t,r,!1)};Ht.prototype.on=Ht.prototype.addListener;Ht.prototype.prependListener=function(t,r){return Up(this,t,r,!0)};function jw(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Kp(i,t,r){var s={fired:!1,wrapFn:void 0,target:i,type:t,listener:r},a=jw.bind(s);return a.listener=r,s.wrapFn=a,a}Ht.prototype.once=function(t,r){return f0(r),this.on(t,Kp(this,t,r)),this};Ht.prototype.prependOnceListener=function(t,r){return f0(r),this.prependListener(t,Kp(this,t,r)),this};Ht.prototype.removeListener=function(t,r){var s,a,c,g,b;if(f0(r),a=this._events,a===void 0)return this;if(s=a[t],s===void 0)return this;if(s===r||s.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,s.listener||r));else if(typeof s!="function"){for(c=-1,g=s.length-1;g>=0;g--)if(s[g]===r||s[g].listener===r){b=s[g].listener,c=g;break}if(c<0)return this;c===0?s.shift():Jw(s,c),s.length===1&&(a[t]=s[0]),a.removeListener!==void 0&&this.emit("removeListener",t,b||r)}return this};Ht.prototype.off=Ht.prototype.removeListener;Ht.prototype.removeAllListeners=function(t){var r,s,a;if(s=this._events,s===void 0)return this;if(s.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):s[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete s[t]),this;if(arguments.length===0){var c=Object.keys(s),g;for(a=0;a<c.length;++a)g=c[a],g!=="removeListener"&&this.removeAllListeners(g);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=s[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(a=r.length-1;a>=0;a--)this.removeListener(t,r[a]);return this};function zp(i,t,r){var s=i._events;if(s===void 0)return[];var a=s[t];return a===void 0?[]:typeof a=="function"?r?[a.listener||a]:[a]:r?Xw(a):Hp(a,a.length)}Ht.prototype.listeners=function(t){return zp(this,t,!0)};Ht.prototype.rawListeners=function(t){return zp(this,t,!1)};Ht.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):$p.call(i,t)};Ht.prototype.listenerCount=$p;function $p(i){var t=this._events;if(t!==void 0){var r=t[i];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Ht.prototype.eventNames=function(){return this._eventsCount>0?a0(this._events):[]};function Hp(i,t){for(var r=new Array(t),s=0;s<t;++s)r[s]=i[s];return r}function Jw(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function Xw(i){for(var t=new Array(i.length),r=0;r<t.length;++r)t[r]=i[r].listener||i[r];return t}function Yw(i,t){return new Promise(function(r,s){function a(g){i.removeListener(t,c),s(g)}function c(){typeof i.removeListener=="function"&&i.removeListener("error",a),r([].slice.call(arguments))}Gp(i,t,c,{once:!0}),t!=="error"&&Qw(i,a,{once:!0})})}function Qw(i,t,r){typeof i.on=="function"&&Gp(i,"error",t,r)}function Gp(i,t,r,s){if(typeof i.on=="function")s.once?i.once(t,r):i.on(t,r);else if(typeof i.addEventListener=="function")i.addEventListener(t,function a(c){s.once&&i.removeEventListener(t,a),r(c)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}});var Zs=I((xS,Zp)=>{"use strict";Zp.exports=o0().EventEmitter});var h0=I((Ws,Vp)=>{"use strict";var s0=ai(),pi=s0.Buffer;function Wp(i,t){for(var r in i)t[r]=i[r]}pi.from&&pi.alloc&&pi.allocUnsafe&&pi.allocUnsafeSlow?Vp.exports=s0:(Wp(s0,Ws),Ws.Buffer=Nn);function Nn(i,t,r){return pi(i,t,r)}Wp(pi,Nn);Nn.from=function(i,t,r){if(typeof i=="number")throw new TypeError("Argument must not be a number");return pi(i,t,r)};Nn.alloc=function(i,t,r){if(typeof i!="number")throw new TypeError("Argument must be a number");var s=pi(i);return t!==void 0?typeof r=="string"?s.fill(t,r):s.fill(t):s.fill(0),s};Nn.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return pi(i)};Nn.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return s0.SlowBuffer(i)}});var Ln=I(Qe=>{"use strict";function t8(i){return Array.isArray?Array.isArray(i):u0(i)==="[object Array]"}Qe.isArray=t8;function e8(i){return typeof i=="boolean"}Qe.isBoolean=e8;function r8(i){return i===null}Qe.isNull=r8;function i8(i){return i==null}Qe.isNullOrUndefined=i8;function n8(i){return typeof i=="number"}Qe.isNumber=n8;function a8(i){return typeof i=="string"}Qe.isString=a8;function f8(i){return typeof i=="symbol"}Qe.isSymbol=f8;function o8(i){return i===void 0}Qe.isUndefined=o8;function s8(i){return u0(i)==="[object RegExp]"}Qe.isRegExp=s8;function h8(i){return typeof i=="object"&&i!==null}Qe.isObject=h8;function u8(i){return u0(i)==="[object Date]"}Qe.isDate=u8;function l8(i){return u0(i)==="[object Error]"||i instanceof Error}Qe.isError=l8;function d8(i){return typeof i=="function"}Qe.isFunction=d8;function c8(i){return i===null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||typeof i=="symbol"||typeof i>"u"}Qe.isPrimitive=c8;Qe.isBuffer=ai().Buffer.isBuffer;function u0(i){return Object.prototype.toString.call(i)}});var Vs=I(()=>{"use strict"});var Jp=I((BS,js)=>{"use strict";function p8(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var jp=h0().Buffer,Oa=Vs();function v8(i,t,r){i.copy(t,r)}js.exports=function(){function i(){p8(this,i),this.head=null,this.tail=null,this.length=0}return i.prototype.push=function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length},i.prototype.unshift=function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length},i.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(r){if(this.length===0)return"";for(var s=this.head,a=""+s.data;s=s.next;)a+=r+s.data;return a},i.prototype.concat=function(r){if(this.length===0)return jp.alloc(0);for(var s=jp.allocUnsafe(r>>>0),a=this.head,c=0;a;)v8(a.data,s,c),c+=a.data.length,a=a.next;return s},i}();Oa&&Oa.inspect&&Oa.inspect.custom&&(js.exports.prototype[Oa.inspect.custom]=function(){var i=Oa.inspect({length:this.length});return this.constructor.name+" "+i})});var Js=I((ES,Xp)=>{"use strict";var l0=La();function m8(i,t){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(t?t(i):i&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,l0.nextTick(d0,this,i)):l0.nextTick(d0,this,i)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(i||null,function(c){!t&&c?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,l0.nextTick(d0,r,c)):l0.nextTick(d0,r,c):t&&t(c)}),this)}function g8(){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 d0(i,t){i.emit("error",t)}Xp.exports={destroy:m8,undestroy:g8}});var Qp=I((kS,Yp)=>{"use strict";Yp.exports=y8;function y8(i,t){if(Xs("noDeprecation"))return i;var r=!1;function s(){if(!r){if(Xs("throwDeprecation"))throw new Error(t);Xs("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return i.apply(this,arguments)}return s}function Xs(i){try{if(!global.localStorage)return!1}catch{return!1}var t=global.localStorage[i];return t==null?!1:String(t).toLowerCase()==="true"}});var Qs=I((qS,ov)=>{"use strict";var Qi=La();ov.exports=Pe;function ev(i){var t=this;this.next=null,this.entry=null,this.finish=function(){N8(t,i)}}var b8=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Qi.nextTick,On;Pe.WritableState=Ua;var rv=Object.create(Ln());rv.inherits=Rt();var w8={deprecate:Qp()},iv=Zs(),p0=h0().Buffer,M8=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function x8(i){return p0.from(i)}function _8(i){return p0.isBuffer(i)||i instanceof M8}var nv=Js();rv.inherits(Pe,iv);function S8(){}function Ua(i,t){On=On||tn(),i=i||{};var r=t instanceof On;this.objectMode=!!i.objectMode,r&&(this.objectMode=this.objectMode||!!i.writableObjectMode);var s=i.highWaterMark,a=i.writableHighWaterMark,c=this.objectMode?16:16*1024;s||s===0?this.highWaterMark=s:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var g=i.decodeStrings===!1;this.decodeStrings=!g,this.defaultEncoding=i.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(b){R8(t,b)},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 ev(this)}Ua.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(Ua.prototype,"buffer",{get:w8.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var c0;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(c0=Function.prototype[Symbol.hasInstance],Object.defineProperty(Pe,Symbol.hasInstance,{value:function(i){return c0.call(this,i)?!0:this!==Pe?!1:i&&i._writableState instanceof Ua}})):c0=function(i){return i instanceof this};function Pe(i){if(On=On||tn(),!c0.call(Pe,this)&&!(this instanceof On))return new Pe(i);this._writableState=new Ua(i,this),this.writable=!0,i&&(typeof i.write=="function"&&(this._write=i.write),typeof i.writev=="function"&&(this._writev=i.writev),typeof i.destroy=="function"&&(this._destroy=i.destroy),typeof i.final=="function"&&(this._final=i.final)),iv.call(this)}Pe.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function A8(i,t){var r=new Error("write after end");i.emit("error",r),Qi.nextTick(t,r)}function B8(i,t,r,s){var a=!0,c=!1;return r===null?c=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(c=new TypeError("Invalid non-string/buffer chunk")),c&&(i.emit("error",c),Qi.nextTick(s,c),a=!1),a}Pe.prototype.write=function(i,t,r){var s=this._writableState,a=!1,c=!s.objectMode&&_8(i);return c&&!p0.isBuffer(i)&&(i=x8(i)),typeof t=="function"&&(r=t,t=null),c?t="buffer":t||(t=s.defaultEncoding),typeof r!="function"&&(r=S8),s.ended?A8(this,r):(c||B8(this,s,i,r))&&(s.pendingcb++,a=k8(this,s,c,i,t,r)),a};Pe.prototype.cork=function(){var i=this._writableState;i.corked++};Pe.prototype.uncork=function(){var i=this._writableState;i.corked&&(i.corked--,!i.writing&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&av(this,i))};Pe.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function E8(i,t,r){return!i.objectMode&&i.decodeStrings!==!1&&typeof t=="string"&&(t=p0.from(t,r)),t}Object.defineProperty(Pe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k8(i,t,r,s,a,c){if(!r){var g=E8(t,s,a);s!==g&&(r=!0,a="buffer",s=g)}var b=t.objectMode?1:s.length;t.length+=b;var w=t.length<t.highWaterMark;if(w||(t.needDrain=!0),t.writing||t.corked){var _=t.lastBufferedRequest;t.lastBufferedRequest={chunk:s,encoding:a,isBuf:r,callback:c,next:null},_?_.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Ys(i,t,!1,b,s,a,c);return w}function Ys(i,t,r,s,a,c,g){t.writelen=s,t.writecb=g,t.writing=!0,t.sync=!0,r?i._writev(a,t.onwrite):i._write(a,c,t.onwrite),t.sync=!1}function q8(i,t,r,s,a){--t.pendingcb,r?(Qi.nextTick(a,s),Qi.nextTick(Fa,i,t),i._writableState.errorEmitted=!0,i.emit("error",s)):(a(s),i._writableState.errorEmitted=!0,i.emit("error",s),Fa(i,t))}function I8(i){i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0}function R8(i,t){var r=i._writableState,s=r.sync,a=r.writecb;if(I8(r),t)q8(i,r,s,t,a);else{var c=fv(r);!c&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&av(i,r),s?b8(tv,i,r,c,a):tv(i,r,c,a)}}function tv(i,t,r,s){r||T8(i,t),t.pendingcb--,s(),Fa(i,t)}function T8(i,t){t.length===0&&t.needDrain&&(t.needDrain=!1,i.emit("drain"))}function av(i,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(i._writev&&r&&r.next){var s=t.bufferedRequestCount,a=new Array(s),c=t.corkedRequestsFree;c.entry=r;for(var g=0,b=!0;r;)a[g]=r,r.isBuf||(b=!1),r=r.next,g+=1;a.allBuffers=b,Ys(i,t,!0,t.length,a,"",c.finish),t.pendingcb++,t.lastBufferedRequest=null,c.next?(t.corkedRequestsFree=c.next,c.next=null):t.corkedRequestsFree=new ev(t),t.bufferedRequestCount=0}else{for(;r;){var w=r.chunk,_=r.encoding,S=r.callback,A=t.objectMode?1:w.length;if(Ys(i,t,!1,A,w,_,S),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Pe.prototype._write=function(i,t,r){r(new Error("_write() is not implemented"))};Pe.prototype._writev=null;Pe.prototype.end=function(i,t,r){var s=this._writableState;typeof i=="function"?(r=i,i=null,t=null):typeof t=="function"&&(r=t,t=null),i!=null&&this.write(i,t),s.corked&&(s.corked=1,this.uncork()),s.ending||D8(this,s,r)};function fv(i){return i.ending&&i.length===0&&i.bufferedRequest===null&&!i.finished&&!i.writing}function P8(i,t){i._final(function(r){t.pendingcb--,r&&i.emit("error",r),t.prefinished=!0,i.emit("prefinish"),Fa(i,t)})}function C8(i,t){!t.prefinished&&!t.finalCalled&&(typeof i._final=="function"?(t.pendingcb++,t.finalCalled=!0,Qi.nextTick(P8,i,t)):(t.prefinished=!0,i.emit("prefinish")))}function Fa(i,t){var r=fv(t);return r&&(C8(i,t),t.pendingcb===0&&(t.finished=!0,i.emit("finish"))),r}function D8(i,t,r){t.ending=!0,Fa(i,t),r&&(t.finished?Qi.nextTick(r):i.once("finish",r)),t.ended=!0,i.writable=!1}function N8(i,t,r){var s=i.entry;for(i.entry=null;s;){var a=s.callback;t.pendingcb--,a(r),s=s.next}t.corkedRequestsFree.next=i}Object.defineProperty(Pe.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(i){this._writableState&&(this._writableState.destroyed=i)}});Pe.prototype.destroy=nv.destroy;Pe.prototype._undestroy=nv.undestroy;Pe.prototype._destroy=function(i,t){this.end(),t(i)}});var tn=I((IS,lv)=>{"use strict";var sv=La(),L8=Object.keys||function(i){var t=[];for(var r in i)t.push(r);return t};lv.exports=vi;var hv=Object.create(Ln());hv.inherits=Rt();var uv=rh(),eh=Qs();hv.inherits(vi,uv);for(th=L8(eh.prototype),v0=0;v0<th.length;v0++)m0=th[v0],vi.prototype[m0]||(vi.prototype[m0]=eh.prototype[m0]);var th,m0,v0;function vi(i){if(!(this instanceof vi))return new vi(i);uv.call(this,i),eh.call(this,i),i&&i.readable===!1&&(this.readable=!1),i&&i.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,i&&i.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",O8)}Object.defineProperty(vi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O8(){this.allowHalfOpen||this._writableState.ended||sv.nextTick(F8,this)}function F8(i){i.end()}Object.defineProperty(vi.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(i){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=i,this._writableState.destroyed=i)}});vi.prototype._destroy=function(i,t){this.push(null),this.end(),sv.nextTick(t,i)}});var rh=I((TS,_v)=>{"use strict";var Un=La();_v.exports=ce;var U8=Dp(),Ka;ce.ReadableState=yv;var RS=o0().EventEmitter,vv=function(i,t){return i.listeners(t).length},oh=Zs(),za=h0().Buffer,K8=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function z8(i){return za.from(i)}function $8(i){return za.isBuffer(i)||i instanceof K8}var mv=Object.create(Ln());mv.inherits=Rt();var ih=Vs(),zt=void 0;ih&&ih.debuglog?zt=ih.debuglog("stream"):zt=function(){};var H8=Jp(),gv=Js(),Fn;mv.inherits(ce,oh);var nh=["error","close","destroy","pause","resume"];function G8(i,t,r){if(typeof i.prependListener=="function")return i.prependListener(t,r);!i._events||!i._events[t]?i.on(t,r):U8(i._events[t])?i._events[t].unshift(r):i._events[t]=[r,i._events[t]]}function yv(i,t){Ka=Ka||tn(),i=i||{};var r=t instanceof Ka;this.objectMode=!!i.objectMode,r&&(this.objectMode=this.objectMode||!!i.readableObjectMode);var s=i.highWaterMark,a=i.readableHighWaterMark,c=this.objectMode?16:16*1024;s||s===0?this.highWaterMark=s:r&&(a||a===0)?this.highWaterMark=a:this.highWaterMark=c,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new H8,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=i.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,i.encoding&&(Fn||(Fn=xf().StringDecoder),this.decoder=new Fn(i.encoding),this.encoding=i.encoding)}function ce(i){if(Ka=Ka||tn(),!(this instanceof ce))return new ce(i);this._readableState=new yv(i,this),this.readable=!0,i&&(typeof i.read=="function"&&(this._read=i.read),typeof i.destroy=="function"&&(this._destroy=i.destroy)),oh.call(this)}Object.defineProperty(ce.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(i){this._readableState&&(this._readableState.destroyed=i)}});ce.prototype.destroy=gv.destroy;ce.prototype._undestroy=gv.undestroy;ce.prototype._destroy=function(i,t){this.push(null),t(i)};ce.prototype.push=function(i,t){var r=this._readableState,s;return r.objectMode?s=!0:typeof i=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(i=za.from(i,t),t=""),s=!0),bv(this,i,t,!1,s)};ce.prototype.unshift=function(i){return bv(this,i,null,!0,!1)};function bv(i,t,r,s,a){var c=i._readableState;if(t===null)c.reading=!1,j8(i,c);else{var g;a||(g=Z8(c,t)),g?i.emit("error",g):c.objectMode||t&&t.length>0?(typeof t!="string"&&!c.objectMode&&Object.getPrototypeOf(t)!==za.prototype&&(t=z8(t)),s?c.endEmitted?i.emit("error",new Error("stream.unshift() after end event")):ah(i,c,t,!0):c.ended?i.emit("error",new Error("stream.push() after EOF")):(c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||t.length!==0?ah(i,c,t,!1):wv(i,c)):ah(i,c,t,!1))):s||(c.reading=!1)}return W8(c)}function ah(i,t,r,s){t.flowing&&t.length===0&&!t.sync?(i.emit("data",r),i.read(0)):(t.length+=t.objectMode?1:r.length,s?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&g0(i)),wv(i,t)}function Z8(i,t){var r;return!$8(t)&&typeof t!="string"&&t!==void 0&&!i.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function W8(i){return!i.ended&&(i.needReadable||i.length<i.highWaterMark||i.length===0)}ce.prototype.isPaused=function(){return this._readableState.flowing===!1};ce.prototype.setEncoding=function(i){return Fn||(Fn=xf().StringDecoder),this._readableState.decoder=new Fn(i),this._readableState.encoding=i,this};var dv=8388608;function V8(i){return i>=dv?i=dv:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),i}function cv(i,t){return i<=0||t.length===0&&t.ended?0:t.objectMode?1:i!==i?t.flowing&&t.length?t.buffer.head.data.length:t.length:(i>t.highWaterMark&&(t.highWaterMark=V8(i)),i<=t.length?i:t.ended?t.length:(t.needReadable=!0,0))}ce.prototype.read=function(i){zt("read",i),i=parseInt(i,10);var t=this._readableState,r=i;if(i!==0&&(t.emittedReadable=!1),i===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return zt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?fh(this):g0(this),null;if(i=cv(i,t),i===0&&t.ended)return t.length===0&&fh(this),null;var s=t.needReadable;zt("need readable",s),(t.length===0||t.length-i<t.highWaterMark)&&(s=!0,zt("length less than watermark",s)),t.ended||t.reading?(s=!1,zt("reading or ended",s)):s&&(zt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(i=cv(r,t)));var a;return i>0?a=Mv(i,t):a=null,a===null?(t.needReadable=!0,i=0):t.length-=i,t.length===0&&(t.ended||(t.needReadable=!0),r!==i&&t.ended&&fh(this)),a!==null&&this.emit("data",a),a};function j8(i,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,g0(i)}}function g0(i){var t=i._readableState;t.needReadable=!1,t.emittedReadable||(zt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Un.nextTick(pv,i):pv(i))}function pv(i){zt("emit readable"),i.emit("readable"),sh(i)}function wv(i,t){t.readingMore||(t.readingMore=!0,Un.nextTick(J8,i,t))}function J8(i,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(zt("maybeReadMore read 0"),i.read(0),r!==t.length);)r=t.length;t.readingMore=!1}ce.prototype._read=function(i){this.emit("error",new Error("_read() is not implemented"))};ce.prototype.pipe=function(i,t){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=i;break;case 1:s.pipes=[s.pipes,i];break;default:s.pipes.push(i);break}s.pipesCount+=1,zt("pipe count=%d opts=%j",s.pipesCount,t);var a=(!t||t.end!==!1)&&i!==process.stdout&&i!==process.stderr,c=a?b:_t;s.endEmitted?Un.nextTick(c):r.once("end",c),i.on("unpipe",g);function g(gt,xt){zt("onunpipe"),gt===r&&xt&&xt.hasUnpiped===!1&&(xt.hasUnpiped=!0,S())}function b(){zt("onend"),i.end()}var w=X8(r);i.on("drain",w);var _=!1;function S(){zt("cleanup"),i.removeListener("close",N),i.removeListener("finish",bt),i.removeListener("drain",w),i.removeListener("error",R),i.removeListener("unpipe",g),r.removeListener("end",b),r.removeListener("end",_t),r.removeListener("data",q),_=!0,s.awaitDrain&&(!i._writableState||i._writableState.needDrain)&&w()}var A=!1;r.on("data",q);function q(gt){zt("ondata"),A=!1;var xt=i.write(gt);xt===!1&&!A&&((s.pipesCount===1&&s.pipes===i||s.pipesCount>1&&xv(s.pipes,i)!==-1)&&!_&&(zt("false write response, pause",s.awaitDrain),s.awaitDrain++,A=!0),r.pause())}function R(gt){zt("onerror",gt),_t(),i.removeListener("error",R),vv(i,"error")===0&&i.emit("error",gt)}G8(i,"error",R);function N(){i.removeListener("finish",bt),_t()}i.once("close",N);function bt(){zt("onfinish"),i.removeListener("close",N),_t()}i.once("finish",bt);function _t(){zt("unpipe"),r.unpipe(i)}return i.emit("pipe",r),s.flowing||(zt("pipe resume"),r.resume()),i};function X8(i){return function(){var t=i._readableState;zt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&vv(i,"data")&&(t.flowing=!0,sh(i))}}ce.prototype.unpipe=function(i){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return i&&i!==t.pipes?this:(i||(i=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,i&&i.emit("unpipe",this,r),this);if(!i){var s=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var c=0;c<a;c++)s[c].emit("unpipe",this,{hasUnpiped:!1});return this}var g=xv(t.pipes,i);return g===-1?this:(t.pipes.splice(g,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),i.emit("unpipe",this,r),this)};ce.prototype.on=function(i,t){var r=oh.prototype.on.call(this,i,t);if(i==="data")this._readableState.flowing!==!1&&this.resume();else if(i==="readable"){var s=this._readableState;!s.endEmitted&&!s.readableListening&&(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&g0(this):Un.nextTick(Y8,this))}return r};ce.prototype.addListener=ce.prototype.on;function Y8(i){zt("readable nexttick read 0"),i.read(0)}ce.prototype.resume=function(){var i=this._readableState;return i.flowing||(zt("resume"),i.flowing=!0,Q8(this,i)),this};function Q8(i,t){t.resumeScheduled||(t.resumeScheduled=!0,Un.nextTick(tM,i,t))}function tM(i,t){t.reading||(zt("resume read 0"),i.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,i.emit("resume"),sh(i),t.flowing&&!t.reading&&i.read(0)}ce.prototype.pause=function(){return zt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(zt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function sh(i){var t=i._readableState;for(zt("flow",t.flowing);t.flowing&&i.read()!==null;);}ce.prototype.wrap=function(i){var t=this,r=this._readableState,s=!1;i.on("end",function(){if(zt("wrapped end"),r.decoder&&!r.ended){var g=r.decoder.end();g&&g.length&&t.push(g)}t.push(null)}),i.on("data",function(g){if(zt("wrapped data"),r.decoder&&(g=r.decoder.write(g)),!(r.objectMode&&g==null)&&!(!r.objectMode&&(!g||!g.length))){var b=t.push(g);b||(s=!0,i.pause())}});for(var a in i)this[a]===void 0&&typeof i[a]=="function"&&(this[a]=function(g){return function(){return i[g].apply(i,arguments)}}(a));for(var c=0;c<nh.length;c++)i.on(nh[c],this.emit.bind(this,nh[c]));return this._read=function(g){zt("wrapped _read",g),s&&(s=!1,i.resume())},this};Object.defineProperty(ce.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});ce._fromList=Mv;function Mv(i,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!i||i>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=eM(i,t.buffer,t.decoder),r}function eM(i,t,r){var s;return i<t.head.data.length?(s=t.head.data.slice(0,i),t.head.data=t.head.data.slice(i)):i===t.head.data.length?s=t.shift():s=r?rM(i,t):iM(i,t),s}function rM(i,t){var r=t.head,s=1,a=r.data;for(i-=a.length;r=r.next;){var c=r.data,g=i>c.length?c.length:i;if(g===c.length?a+=c:a+=c.slice(0,i),i-=g,i===0){g===c.length?(++s,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=c.slice(g));break}++s}return t.length-=s,a}function iM(i,t){var r=za.allocUnsafe(i),s=t.head,a=1;for(s.data.copy(r),i-=s.data.length;s=s.next;){var c=s.data,g=i>c.length?c.length:i;if(c.copy(r,r.length-i,0,g),i-=g,i===0){g===c.length?(++a,s.next?t.head=s.next:t.head=t.tail=null):(t.head=s,s.data=c.slice(g));break}++a}return t.length-=a,r}function fh(i){var t=i._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Un.nextTick(nM,t,i))}function nM(i,t){!i.endEmitted&&i.length===0&&(i.endEmitted=!0,t.readable=!1,t.emit("end"))}function xv(i,t){for(var r=0,s=i.length;r<s;r++)if(i[r]===t)return r;return-1}});var hh=I((PS,Bv)=>{"use strict";Bv.exports=mi;var y0=tn(),Av=Object.create(Ln());Av.inherits=Rt();Av.inherits(mi,y0);function aM(i,t){var r=this._transformState;r.transforming=!1;var s=r.writecb;if(!s)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),s(i);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function mi(i){if(!(this instanceof mi))return new mi(i);y0.call(this,i),this._transformState={afterTransform:aM.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,i&&(typeof i.transform=="function"&&(this._transform=i.transform),typeof i.flush=="function"&&(this._flush=i.flush)),this.on("prefinish",fM)}function fM(){var i=this;typeof this._flush=="function"?this._flush(function(t,r){Sv(i,t,r)}):Sv(this,null,null)}mi.prototype.push=function(i,t){return this._transformState.needTransform=!1,y0.prototype.push.call(this,i,t)};mi.prototype._transform=function(i,t,r){throw new Error("_transform() is not implemented")};mi.prototype._write=function(i,t,r){var s=this._transformState;if(s.writecb=r,s.writechunk=i,s.writeencoding=t,!s.transforming){var a=this._readableState;(s.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};mi.prototype._read=function(i){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};mi.prototype._destroy=function(i,t){var r=this;y0.prototype._destroy.call(this,i,function(s){t(s),r.emit("close")})};function Sv(i,t,r){if(t)return i.emit("error",t);if(r!=null&&i.push(r),i._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(i._transformState.transforming)throw new Error("Calling transform done when still transforming");return i.push(null)}});var Iv=I((CS,qv)=>{"use strict";qv.exports=$a;var Ev=hh(),kv=Object.create(Ln());kv.inherits=Rt();kv.inherits($a,Ev);function $a(i){if(!(this instanceof $a))return new $a(i);Ev.call(this,i)}$a.prototype._transform=function(i,t,r){r(null,i)}});var Tv=I((Wr,Rv)=>{"use strict";Wr=Rv.exports=rh();Wr.Stream=Wr;Wr.Readable=Wr;Wr.Writable=Qs();Wr.Duplex=tn();Wr.Transform=hh();Wr.PassThrough=Iv()});var b0=I((Pv,uh)=>{"use strict";(function(i,t){"use strict";function r(h,o){if(!h)throw new Error(o||"Assertion failed")}function s(h,o){h.super_=o;var u=function(){};u.prototype=o.prototype,h.prototype=new u,h.prototype.constructor=h}function a(h,o,u){if(a.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(h||0,o||10,u||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(o){return o instanceof a?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===a.wordSize&&Array.isArray(o.words)},a.max=function(o,u){return o.cmp(u)>0?o:u},a.min=function(o,u){return o.cmp(u)<0?o:u},a.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),r(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m<o.length&&(u===16?this._parseHex(o,m,p):(this._parseBase(o,u,m),p==="le"&&this._initArray(this.toArray(),u,p)))},a.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(r(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},a.prototype._initArray=function(o,u,p){if(r(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var l,n,d=0;if(p==="be")for(m=o.length-1,l=0;m>=0;m-=3)n=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[l]|=n<<d&67108863,this.words[l+1]=n>>>26-d&67108863,d+=24,d>=26&&(d-=26,l++);else if(p==="le")for(m=0,l=0;m<o.length;m+=3)n=o[m]|o[m+1]<<8|o[m+2]<<16,this.words[l]|=n<<d&67108863,this.words[l+1]=n>>>26-d&67108863,d+=24,d>=26&&(d-=26,l++);return this._strip()};function g(h,o){var u=h.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;r(!1,"Invalid character in "+h)}function b(h,o,u){var p=g(h,u);return u-1>=o&&(p|=g(h,u-1)<<4),p}a.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var l=0,n=0,d;if(p==="be")for(m=o.length-1;m>=u;m-=2)d=b(o,u,m)<<l,this.words[n]|=d&67108863,l>=18?(l-=18,n+=1,this.words[n]|=d>>>26):l+=8;else{var M=o.length-u;for(m=M%2===0?u+1:u;m<o.length;m+=2)d=b(o,u,m)<<l,this.words[n]|=d&67108863,l>=18?(l-=18,n+=1,this.words[n]|=d>>>26):l+=8}this._strip()};function w(h,o,u,p){for(var m=0,l=0,n=Math.min(h.length,u),d=o;d<n;d++){var M=h.charCodeAt(d)-48;m*=p,M>=49?l=M-49+10:M>=17?l=M-17+10:l=M,r(M>=0&&l<p,"Invalid character"),m+=l}return m}a.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var m=0,l=1;l<=67108863;l*=u)m++;m--,l=l/u|0;for(var n=o.length-p,d=n%m,M=Math.min(n,n-d)+p,y=0,x=p;x<M;x+=m)y=w(o,x,x+m,u),this.imuln(l),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y);if(d!==0){var B=1;for(y=w(o,x,o.length,u),x=0;x<d;x++)B*=u;this.imuln(B),this.words[0]+y<67108864?this.words[0]+=y:this._iaddn(y)}this._strip()},a.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function _(h,o){h.words=o.words,h.length=o.length,h.negative=o.negative,h.red=o.red}if(a.prototype._move=function(o){_(o,this)},a.prototype.clone=function(){var o=new a(null);return this.copy(o),o},a.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch{a.prototype.inspect=S}else a.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var A=["","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"],q=[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],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var m=0,l=0,n=0;n<this.length;n++){var d=this.words[n],M=((d<<m|l)&16777215).toString(16);l=d>>>24-m&16777215,m+=2,m>=26&&(m-=26,n--),l!==0||n!==this.length-1?p=A[6-M.length]+M+p:p=M+p}for(l!==0&&(p=l.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var y=q[o],x=R[o];p="";var B=this.clone();for(B.negative=0;!B.isZero();){var E=B.modrn(x).toString(o);B=B.idivn(x),B.isZero()?p=E+p:p=A[y-E.length]+E+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},a.prototype.toJSON=function(){return this.toString(16,2)},c&&(a.prototype.toBuffer=function(o,u){return this.toArrayLike(c,o,u)}),a.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var N=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};a.prototype.toArrayLike=function(o,u,p){this._strip();var m=this.byteLength(),l=p||Math.max(1,m);r(m<=l,"byte array longer than desired length"),r(l>0,"Requested array length <= 0");var n=N(o,l),d=u==="le"?"LE":"BE";return this["_toArrayLike"+d](n,m),n},a.prototype._toArrayLikeLE=function(o,u){for(var p=0,m=0,l=0,n=0;l<this.length;l++){var d=this.words[l]<<n|m;o[p++]=d&255,p<o.length&&(o[p++]=d>>8&255),p<o.length&&(o[p++]=d>>16&255),n===6?(p<o.length&&(o[p++]=d>>24&255),m=0,n=0):(m=d>>>24,n+=2)}if(p<o.length)for(o[p++]=m;p<o.length;)o[p++]=0},a.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,m=0,l=0,n=0;l<this.length;l++){var d=this.words[l]<<n|m;o[p--]=d&255,p>=0&&(o[p--]=d>>8&255),p>=0&&(o[p--]=d>>16&255),n===6?(p>=0&&(o[p--]=d>>24&255),m=0,n=0):(m=d>>>24,n+=2)}if(p>=0)for(o[p--]=m;p>=0;)o[p--]=0},Math.clz32?a.prototype._countBits=function(o){return 32-Math.clz32(o)}:a.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},a.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return(u&8191)===0&&(p+=13,u>>>=13),(u&127)===0&&(p+=7,u>>>=7),(u&15)===0&&(p+=4,u>>>=4),(u&3)===0&&(p+=2,u>>>=2),(u&1)===0&&p++,p},a.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function bt(h){for(var o=new Array(h.bitLength()),u=0;u<o.length;u++){var p=u/26|0,m=u%26;o[u]=h.words[p]>>>m&1}return o}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},a.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},a.prototype.ior=function(o){return r((this.negative|o.negative)===0),this.iuor(o)},a.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},a.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},a.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},a.prototype.iand=function(o){return r((this.negative|o.negative)===0),this.iuand(o)},a.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},a.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},a.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var m=0;m<p.length;m++)this.words[m]=u.words[m]^p.words[m];if(this!==u)for(;m<u.length;m++)this.words[m]=u.words[m];return this.length=u.length,this._strip()},a.prototype.ixor=function(o){return r((this.negative|o.negative)===0),this.iuxor(o)},a.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},a.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},a.prototype.inotn=function(o){r(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var m=0;m<u;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},a.prototype.notn=function(o){return this.clone().inotn(o)},a.prototype.setn=function(o,u){r(typeof o=="number"&&o>=0);var p=o/26|0,m=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},a.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,m;this.length>o.length?(p=this,m=o):(p=o,m=this);for(var l=0,n=0;n<m.length;n++)u=(p.words[n]|0)+(m.words[n]|0)+l,this.words[n]=u&67108863,l=u>>>26;for(;l!==0&&n<p.length;n++)u=(p.words[n]|0)+l,this.words[n]=u&67108863,l=u>>>26;if(this.length=p.length,l!==0)this.words[this.length]=l,this.length++;else if(p!==this)for(;n<p.length;n++)this.words[n]=p.words[n];return this},a.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},a.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,l;p>0?(m=this,l=o):(m=o,l=this);for(var n=0,d=0;d<l.length;d++)u=(m.words[d]|0)-(l.words[d]|0)+n,n=u>>26,this.words[d]=u&67108863;for(;n!==0&&d<m.length;d++)u=(m.words[d]|0)+n,n=u>>26,this.words[d]=u&67108863;if(n===0&&d<m.length&&m!==this)for(;d<m.length;d++)this.words[d]=m.words[d];return this.length=Math.max(this.length,d),m!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(o){return this.clone().isub(o)};function _t(h,o,u){u.negative=o.negative^h.negative;var p=h.length+o.length|0;u.length=p,p=p-1|0;var m=h.words[0]|0,l=o.words[0]|0,n=m*l,d=n&67108863,M=n/67108864|0;u.words[0]=d;for(var y=1;y<p;y++){for(var x=M>>>26,B=M&67108863,E=Math.min(y,o.length-1),k=Math.max(0,y-h.length+1);k<=E;k++){var wt=y-k|0;m=h.words[wt]|0,l=o.words[k]|0,n=m*l+B,x+=n/67108864|0,B=n&67108863}u.words[y]=B|0,M=x|0}return M!==0?u.words[y]=M|0:u.length--,u._strip()}var gt=function(o,u,p){var m=o.words,l=u.words,n=p.words,d=0,M,y,x,B=m[0]|0,E=B&8191,k=B>>>13,wt=m[1]|0,T=wt&8191,P=wt>>>13,ue=m[2]|0,D=ue&8191,L=ue>>>13,me=m[3]|0,F=me&8191,U=me>>>13,ge=m[4]|0,K=ge&8191,z=ge>>>13,ye=m[5]|0,$=ye&8191,H=ye>>>13,be=m[6]|0,G=be&8191,Z=be>>>13,we=m[7]|0,W=we&8191,V=we>>>13,Me=m[8]|0,j=Me&8191,J=Me>>>13,xe=m[9]|0,X=xe&8191,Y=xe>>>13,_e=l[0]|0,Q=_e&8191,tt=_e>>>13,Se=l[1]|0,et=Se&8191,rt=Se>>>13,Ae=l[2]|0,it=Ae&8191,nt=Ae>>>13,Be=l[3]|0,at=Be&8191,ft=Be>>>13,Ee=l[4]|0,ot=Ee&8191,st=Ee>>>13,ke=l[5]|0,ht=ke&8191,ut=ke>>>13,qe=l[6]|0,lt=qe&8191,dt=qe>>>13,Ie=l[7]|0,ct=Ie&8191,pt=Ie>>>13,Re=l[8]|0,vt=Re&8191,mt=Re>>>13,le=l[9]|0,Et=le&8191,kt=le>>>13;p.negative=o.negative^u.negative,p.length=19,M=Math.imul(E,Q),y=Math.imul(E,tt),y=y+Math.imul(k,Q)|0,x=Math.imul(k,tt);var Wt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,M=Math.imul(T,Q),y=Math.imul(T,tt),y=y+Math.imul(P,Q)|0,x=Math.imul(P,tt),M=M+Math.imul(E,et)|0,y=y+Math.imul(E,rt)|0,y=y+Math.imul(k,et)|0,x=x+Math.imul(k,rt)|0;var Vt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,M=Math.imul(D,Q),y=Math.imul(D,tt),y=y+Math.imul(L,Q)|0,x=Math.imul(L,tt),M=M+Math.imul(T,et)|0,y=y+Math.imul(T,rt)|0,y=y+Math.imul(P,et)|0,x=x+Math.imul(P,rt)|0,M=M+Math.imul(E,it)|0,y=y+Math.imul(E,nt)|0,y=y+Math.imul(k,it)|0,x=x+Math.imul(k,nt)|0;var jt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(jt>>>26)|0,jt&=67108863,M=Math.imul(F,Q),y=Math.imul(F,tt),y=y+Math.imul(U,Q)|0,x=Math.imul(U,tt),M=M+Math.imul(D,et)|0,y=y+Math.imul(D,rt)|0,y=y+Math.imul(L,et)|0,x=x+Math.imul(L,rt)|0,M=M+Math.imul(T,it)|0,y=y+Math.imul(T,nt)|0,y=y+Math.imul(P,it)|0,x=x+Math.imul(P,nt)|0,M=M+Math.imul(E,at)|0,y=y+Math.imul(E,ft)|0,y=y+Math.imul(k,at)|0,x=x+Math.imul(k,ft)|0;var Jt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,M=Math.imul(K,Q),y=Math.imul(K,tt),y=y+Math.imul(z,Q)|0,x=Math.imul(z,tt),M=M+Math.imul(F,et)|0,y=y+Math.imul(F,rt)|0,y=y+Math.imul(U,et)|0,x=x+Math.imul(U,rt)|0,M=M+Math.imul(D,it)|0,y=y+Math.imul(D,nt)|0,y=y+Math.imul(L,it)|0,x=x+Math.imul(L,nt)|0,M=M+Math.imul(T,at)|0,y=y+Math.imul(T,ft)|0,y=y+Math.imul(P,at)|0,x=x+Math.imul(P,ft)|0,M=M+Math.imul(E,ot)|0,y=y+Math.imul(E,st)|0,y=y+Math.imul(k,ot)|0,x=x+Math.imul(k,st)|0;var Xt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,M=Math.imul($,Q),y=Math.imul($,tt),y=y+Math.imul(H,Q)|0,x=Math.imul(H,tt),M=M+Math.imul(K,et)|0,y=y+Math.imul(K,rt)|0,y=y+Math.imul(z,et)|0,x=x+Math.imul(z,rt)|0,M=M+Math.imul(F,it)|0,y=y+Math.imul(F,nt)|0,y=y+Math.imul(U,it)|0,x=x+Math.imul(U,nt)|0,M=M+Math.imul(D,at)|0,y=y+Math.imul(D,ft)|0,y=y+Math.imul(L,at)|0,x=x+Math.imul(L,ft)|0,M=M+Math.imul(T,ot)|0,y=y+Math.imul(T,st)|0,y=y+Math.imul(P,ot)|0,x=x+Math.imul(P,st)|0,M=M+Math.imul(E,ht)|0,y=y+Math.imul(E,ut)|0,y=y+Math.imul(k,ht)|0,x=x+Math.imul(k,ut)|0;var Yt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,M=Math.imul(G,Q),y=Math.imul(G,tt),y=y+Math.imul(Z,Q)|0,x=Math.imul(Z,tt),M=M+Math.imul($,et)|0,y=y+Math.imul($,rt)|0,y=y+Math.imul(H,et)|0,x=x+Math.imul(H,rt)|0,M=M+Math.imul(K,it)|0,y=y+Math.imul(K,nt)|0,y=y+Math.imul(z,it)|0,x=x+Math.imul(z,nt)|0,M=M+Math.imul(F,at)|0,y=y+Math.imul(F,ft)|0,y=y+Math.imul(U,at)|0,x=x+Math.imul(U,ft)|0,M=M+Math.imul(D,ot)|0,y=y+Math.imul(D,st)|0,y=y+Math.imul(L,ot)|0,x=x+Math.imul(L,st)|0,M=M+Math.imul(T,ht)|0,y=y+Math.imul(T,ut)|0,y=y+Math.imul(P,ht)|0,x=x+Math.imul(P,ut)|0,M=M+Math.imul(E,lt)|0,y=y+Math.imul(E,dt)|0,y=y+Math.imul(k,lt)|0,x=x+Math.imul(k,dt)|0;var Qt=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,M=Math.imul(W,Q),y=Math.imul(W,tt),y=y+Math.imul(V,Q)|0,x=Math.imul(V,tt),M=M+Math.imul(G,et)|0,y=y+Math.imul(G,rt)|0,y=y+Math.imul(Z,et)|0,x=x+Math.imul(Z,rt)|0,M=M+Math.imul($,it)|0,y=y+Math.imul($,nt)|0,y=y+Math.imul(H,it)|0,x=x+Math.imul(H,nt)|0,M=M+Math.imul(K,at)|0,y=y+Math.imul(K,ft)|0,y=y+Math.imul(z,at)|0,x=x+Math.imul(z,ft)|0,M=M+Math.imul(F,ot)|0,y=y+Math.imul(F,st)|0,y=y+Math.imul(U,ot)|0,x=x+Math.imul(U,st)|0,M=M+Math.imul(D,ht)|0,y=y+Math.imul(D,ut)|0,y=y+Math.imul(L,ht)|0,x=x+Math.imul(L,ut)|0,M=M+Math.imul(T,lt)|0,y=y+Math.imul(T,dt)|0,y=y+Math.imul(P,lt)|0,x=x+Math.imul(P,dt)|0,M=M+Math.imul(E,ct)|0,y=y+Math.imul(E,pt)|0,y=y+Math.imul(k,ct)|0,x=x+Math.imul(k,pt)|0;var te=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(te>>>26)|0,te&=67108863,M=Math.imul(j,Q),y=Math.imul(j,tt),y=y+Math.imul(J,Q)|0,x=Math.imul(J,tt),M=M+Math.imul(W,et)|0,y=y+Math.imul(W,rt)|0,y=y+Math.imul(V,et)|0,x=x+Math.imul(V,rt)|0,M=M+Math.imul(G,it)|0,y=y+Math.imul(G,nt)|0,y=y+Math.imul(Z,it)|0,x=x+Math.imul(Z,nt)|0,M=M+Math.imul($,at)|0,y=y+Math.imul($,ft)|0,y=y+Math.imul(H,at)|0,x=x+Math.imul(H,ft)|0,M=M+Math.imul(K,ot)|0,y=y+Math.imul(K,st)|0,y=y+Math.imul(z,ot)|0,x=x+Math.imul(z,st)|0,M=M+Math.imul(F,ht)|0,y=y+Math.imul(F,ut)|0,y=y+Math.imul(U,ht)|0,x=x+Math.imul(U,ut)|0,M=M+Math.imul(D,lt)|0,y=y+Math.imul(D,dt)|0,y=y+Math.imul(L,lt)|0,x=x+Math.imul(L,dt)|0,M=M+Math.imul(T,ct)|0,y=y+Math.imul(T,pt)|0,y=y+Math.imul(P,ct)|0,x=x+Math.imul(P,pt)|0,M=M+Math.imul(E,vt)|0,y=y+Math.imul(E,mt)|0,y=y+Math.imul(k,vt)|0,x=x+Math.imul(k,mt)|0;var ee=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(ee>>>26)|0,ee&=67108863,M=Math.imul(X,Q),y=Math.imul(X,tt),y=y+Math.imul(Y,Q)|0,x=Math.imul(Y,tt),M=M+Math.imul(j,et)|0,y=y+Math.imul(j,rt)|0,y=y+Math.imul(J,et)|0,x=x+Math.imul(J,rt)|0,M=M+Math.imul(W,it)|0,y=y+Math.imul(W,nt)|0,y=y+Math.imul(V,it)|0,x=x+Math.imul(V,nt)|0,M=M+Math.imul(G,at)|0,y=y+Math.imul(G,ft)|0,y=y+Math.imul(Z,at)|0,x=x+Math.imul(Z,ft)|0,M=M+Math.imul($,ot)|0,y=y+Math.imul($,st)|0,y=y+Math.imul(H,ot)|0,x=x+Math.imul(H,st)|0,M=M+Math.imul(K,ht)|0,y=y+Math.imul(K,ut)|0,y=y+Math.imul(z,ht)|0,x=x+Math.imul(z,ut)|0,M=M+Math.imul(F,lt)|0,y=y+Math.imul(F,dt)|0,y=y+Math.imul(U,lt)|0,x=x+Math.imul(U,dt)|0,M=M+Math.imul(D,ct)|0,y=y+Math.imul(D,pt)|0,y=y+Math.imul(L,ct)|0,x=x+Math.imul(L,pt)|0,M=M+Math.imul(T,vt)|0,y=y+Math.imul(T,mt)|0,y=y+Math.imul(P,vt)|0,x=x+Math.imul(P,mt)|0,M=M+Math.imul(E,Et)|0,y=y+Math.imul(E,kt)|0,y=y+Math.imul(k,Et)|0,x=x+Math.imul(k,kt)|0;var re=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(re>>>26)|0,re&=67108863,M=Math.imul(X,et),y=Math.imul(X,rt),y=y+Math.imul(Y,et)|0,x=Math.imul(Y,rt),M=M+Math.imul(j,it)|0,y=y+Math.imul(j,nt)|0,y=y+Math.imul(J,it)|0,x=x+Math.imul(J,nt)|0,M=M+Math.imul(W,at)|0,y=y+Math.imul(W,ft)|0,y=y+Math.imul(V,at)|0,x=x+Math.imul(V,ft)|0,M=M+Math.imul(G,ot)|0,y=y+Math.imul(G,st)|0,y=y+Math.imul(Z,ot)|0,x=x+Math.imul(Z,st)|0,M=M+Math.imul($,ht)|0,y=y+Math.imul($,ut)|0,y=y+Math.imul(H,ht)|0,x=x+Math.imul(H,ut)|0,M=M+Math.imul(K,lt)|0,y=y+Math.imul(K,dt)|0,y=y+Math.imul(z,lt)|0,x=x+Math.imul(z,dt)|0,M=M+Math.imul(F,ct)|0,y=y+Math.imul(F,pt)|0,y=y+Math.imul(U,ct)|0,x=x+Math.imul(U,pt)|0,M=M+Math.imul(D,vt)|0,y=y+Math.imul(D,mt)|0,y=y+Math.imul(L,vt)|0,x=x+Math.imul(L,mt)|0,M=M+Math.imul(T,Et)|0,y=y+Math.imul(T,kt)|0,y=y+Math.imul(P,Et)|0,x=x+Math.imul(P,kt)|0;var ie=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(ie>>>26)|0,ie&=67108863,M=Math.imul(X,it),y=Math.imul(X,nt),y=y+Math.imul(Y,it)|0,x=Math.imul(Y,nt),M=M+Math.imul(j,at)|0,y=y+Math.imul(j,ft)|0,y=y+Math.imul(J,at)|0,x=x+Math.imul(J,ft)|0,M=M+Math.imul(W,ot)|0,y=y+Math.imul(W,st)|0,y=y+Math.imul(V,ot)|0,x=x+Math.imul(V,st)|0,M=M+Math.imul(G,ht)|0,y=y+Math.imul(G,ut)|0,y=y+Math.imul(Z,ht)|0,x=x+Math.imul(Z,ut)|0,M=M+Math.imul($,lt)|0,y=y+Math.imul($,dt)|0,y=y+Math.imul(H,lt)|0,x=x+Math.imul(H,dt)|0,M=M+Math.imul(K,ct)|0,y=y+Math.imul(K,pt)|0,y=y+Math.imul(z,ct)|0,x=x+Math.imul(z,pt)|0,M=M+Math.imul(F,vt)|0,y=y+Math.imul(F,mt)|0,y=y+Math.imul(U,vt)|0,x=x+Math.imul(U,mt)|0,M=M+Math.imul(D,Et)|0,y=y+Math.imul(D,kt)|0,y=y+Math.imul(L,Et)|0,x=x+Math.imul(L,kt)|0;var ne=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(ne>>>26)|0,ne&=67108863,M=Math.imul(X,at),y=Math.imul(X,ft),y=y+Math.imul(Y,at)|0,x=Math.imul(Y,ft),M=M+Math.imul(j,ot)|0,y=y+Math.imul(j,st)|0,y=y+Math.imul(J,ot)|0,x=x+Math.imul(J,st)|0,M=M+Math.imul(W,ht)|0,y=y+Math.imul(W,ut)|0,y=y+Math.imul(V,ht)|0,x=x+Math.imul(V,ut)|0,M=M+Math.imul(G,lt)|0,y=y+Math.imul(G,dt)|0,y=y+Math.imul(Z,lt)|0,x=x+Math.imul(Z,dt)|0,M=M+Math.imul($,ct)|0,y=y+Math.imul($,pt)|0,y=y+Math.imul(H,ct)|0,x=x+Math.imul(H,pt)|0,M=M+Math.imul(K,vt)|0,y=y+Math.imul(K,mt)|0,y=y+Math.imul(z,vt)|0,x=x+Math.imul(z,mt)|0,M=M+Math.imul(F,Et)|0,y=y+Math.imul(F,kt)|0,y=y+Math.imul(U,Et)|0,x=x+Math.imul(U,kt)|0;var ae=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(ae>>>26)|0,ae&=67108863,M=Math.imul(X,ot),y=Math.imul(X,st),y=y+Math.imul(Y,ot)|0,x=Math.imul(Y,st),M=M+Math.imul(j,ht)|0,y=y+Math.imul(j,ut)|0,y=y+Math.imul(J,ht)|0,x=x+Math.imul(J,ut)|0,M=M+Math.imul(W,lt)|0,y=y+Math.imul(W,dt)|0,y=y+Math.imul(V,lt)|0,x=x+Math.imul(V,dt)|0,M=M+Math.imul(G,ct)|0,y=y+Math.imul(G,pt)|0,y=y+Math.imul(Z,ct)|0,x=x+Math.imul(Z,pt)|0,M=M+Math.imul($,vt)|0,y=y+Math.imul($,mt)|0,y=y+Math.imul(H,vt)|0,x=x+Math.imul(H,mt)|0,M=M+Math.imul(K,Et)|0,y=y+Math.imul(K,kt)|0,y=y+Math.imul(z,Et)|0,x=x+Math.imul(z,kt)|0;var fe=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(fe>>>26)|0,fe&=67108863,M=Math.imul(X,ht),y=Math.imul(X,ut),y=y+Math.imul(Y,ht)|0,x=Math.imul(Y,ut),M=M+Math.imul(j,lt)|0,y=y+Math.imul(j,dt)|0,y=y+Math.imul(J,lt)|0,x=x+Math.imul(J,dt)|0,M=M+Math.imul(W,ct)|0,y=y+Math.imul(W,pt)|0,y=y+Math.imul(V,ct)|0,x=x+Math.imul(V,pt)|0,M=M+Math.imul(G,vt)|0,y=y+Math.imul(G,mt)|0,y=y+Math.imul(Z,vt)|0,x=x+Math.imul(Z,mt)|0,M=M+Math.imul($,Et)|0,y=y+Math.imul($,kt)|0,y=y+Math.imul(H,Et)|0,x=x+Math.imul(H,kt)|0;var oe=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(oe>>>26)|0,oe&=67108863,M=Math.imul(X,lt),y=Math.imul(X,dt),y=y+Math.imul(Y,lt)|0,x=Math.imul(Y,dt),M=M+Math.imul(j,ct)|0,y=y+Math.imul(j,pt)|0,y=y+Math.imul(J,ct)|0,x=x+Math.imul(J,pt)|0,M=M+Math.imul(W,vt)|0,y=y+Math.imul(W,mt)|0,y=y+Math.imul(V,vt)|0,x=x+Math.imul(V,mt)|0,M=M+Math.imul(G,Et)|0,y=y+Math.imul(G,kt)|0,y=y+Math.imul(Z,Et)|0,x=x+Math.imul(Z,kt)|0;var se=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(se>>>26)|0,se&=67108863,M=Math.imul(X,ct),y=Math.imul(X,pt),y=y+Math.imul(Y,ct)|0,x=Math.imul(Y,pt),M=M+Math.imul(j,vt)|0,y=y+Math.imul(j,mt)|0,y=y+Math.imul(J,vt)|0,x=x+Math.imul(J,mt)|0,M=M+Math.imul(W,Et)|0,y=y+Math.imul(W,kt)|0,y=y+Math.imul(V,Et)|0,x=x+Math.imul(V,kt)|0;var io=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(io>>>26)|0,io&=67108863,M=Math.imul(X,vt),y=Math.imul(X,mt),y=y+Math.imul(Y,vt)|0,x=Math.imul(Y,mt),M=M+Math.imul(j,Et)|0,y=y+Math.imul(j,kt)|0,y=y+Math.imul(J,Et)|0,x=x+Math.imul(J,kt)|0;var no=(d+M|0)+((y&8191)<<13)|0;d=(x+(y>>>13)|0)+(no>>>26)|0,no&=67108863,M=Math.imul(X,Et),y=Math.imul(X,kt),y=y+Math.imul(Y,Et)|0,x=Math.imul(Y,kt);var ao=(d+M|0)+((y&8191)<<13)|0;return d=(x+(y>>>13)|0)+(ao>>>26)|0,ao&=67108863,n[0]=Wt,n[1]=Vt,n[2]=jt,n[3]=Jt,n[4]=Xt,n[5]=Yt,n[6]=Qt,n[7]=te,n[8]=ee,n[9]=re,n[10]=ie,n[11]=ne,n[12]=ae,n[13]=fe,n[14]=oe,n[15]=se,n[16]=io,n[17]=no,n[18]=ao,d!==0&&(n[19]=d,p.length++),p};Math.imul||(gt=_t);function xt(h,o,u){u.negative=o.negative^h.negative,u.length=h.length+o.length;for(var p=0,m=0,l=0;l<u.length-1;l++){var n=m;m=0;for(var d=p&67108863,M=Math.min(l,o.length-1),y=Math.max(0,l-h.length+1);y<=M;y++){var x=l-y,B=h.words[x]|0,E=o.words[y]|0,k=B*E,wt=k&67108863;n=n+(k/67108864|0)|0,wt=wt+d|0,d=wt&67108863,n=n+(wt>>>26)|0,m+=n>>>26,n&=67108863}u.words[l]=d,p=n,n=m}return p!==0?u.words[l]=p:u.length--,u._strip()}function Mt(h,o,u){return xt(h,o,u)}a.prototype.mulTo=function(o,u){var p,m=this.length+o.length;return this.length===10&&o.length===10?p=gt(this,o,u):m<63?p=_t(this,o,u):m<1024?p=xt(this,o,u):p=Mt(this,o,u),p};function At(h,o){this.x=h,this.y=o}At.prototype.makeRBT=function(o){for(var u=new Array(o),p=a.prototype._countBits(o)-1,m=0;m<o;m++)u[m]=this.revBin(m,p,o);return u},At.prototype.revBin=function(o,u,p){if(o===0||o===p-1)return o;for(var m=0,l=0;l<u;l++)m|=(o&1)<<u-l-1,o>>=1;return m},At.prototype.permute=function(o,u,p,m,l,n){for(var d=0;d<n;d++)m[d]=u[o[d]],l[d]=p[o[d]]},At.prototype.transform=function(o,u,p,m,l,n){this.permute(n,o,u,p,m,l);for(var d=1;d<l;d<<=1)for(var M=d<<1,y=Math.cos(2*Math.PI/M),x=Math.sin(2*Math.PI/M),B=0;B<l;B+=M)for(var E=y,k=x,wt=0;wt<d;wt++){var T=p[B+wt],P=m[B+wt],ue=p[B+wt+d],D=m[B+wt+d],L=E*ue-k*D;D=E*D+k*ue,ue=L,p[B+wt]=T+ue,m[B+wt]=P+D,p[B+wt+d]=T-ue,m[B+wt+d]=P-D,wt!==M&&(L=y*E-x*k,k=y*k+x*E,E=L)}},At.prototype.guessLen13b=function(o,u){var p=Math.max(u,o)|1,m=p&1,l=0;for(p=p/2|0;p;p=p>>>1)l++;return 1<<l+1+m},At.prototype.conjugate=function(o,u,p){if(!(p<=1))for(var m=0;m<p/2;m++){var l=o[m];o[m]=o[p-m-1],o[p-m-1]=l,l=u[m],u[m]=-u[p-m-1],u[p-m-1]=-l}},At.prototype.normalize13b=function(o,u){for(var p=0,m=0;m<u/2;m++){var l=Math.round(o[2*m+1]/u)*8192+Math.round(o[2*m]/u)+p;o[m]=l&67108863,l<67108864?p=0:p=l/67108864|0}return o},At.prototype.convert13b=function(o,u,p,m){for(var l=0,n=0;n<u;n++)l=l+(o[n]|0),p[2*n]=l&8191,l=l>>>13,p[2*n+1]=l&8191,l=l>>>13;for(n=2*u;n<m;++n)p[n]=0;r(l===0),r((l&-8192)===0)},At.prototype.stub=function(o){for(var u=new Array(o),p=0;p<o;p++)u[p]=0;return u},At.prototype.mulp=function(o,u,p){var m=2*this.guessLen13b(o.length,u.length),l=this.makeRBT(m),n=this.stub(m),d=new Array(m),M=new Array(m),y=new Array(m),x=new Array(m),B=new Array(m),E=new Array(m),k=p.words;k.length=m,this.convert13b(o.words,o.length,d,m),this.convert13b(u.words,u.length,x,m),this.transform(d,n,M,y,m,l),this.transform(x,n,B,E,m,l);for(var wt=0;wt<m;wt++){var T=M[wt]*B[wt]-y[wt]*E[wt];y[wt]=M[wt]*E[wt]+y[wt]*B[wt],M[wt]=T}return this.conjugate(M,y,m),this.transform(M,y,k,n,m,l),this.conjugate(k,n,m),this.normalize13b(k,m),p.negative=o.negative^u.negative,p.length=o.length+u.length,p._strip()},a.prototype.mul=function(o){var u=new a(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},a.prototype.mulf=function(o){var u=new a(null);return u.words=new Array(this.length+o.length),Mt(this,o,u)},a.prototype.imul=function(o){return this.clone().mulTo(o,this)},a.prototype.imuln=function(o){var u=o<0;u&&(o=-o),r(typeof o=="number"),r(o<67108864);for(var p=0,m=0;m<this.length;m++){var l=(this.words[m]|0)*o,n=(l&67108863)+(p&67108863);p>>=26,p+=l/67108864|0,p+=n>>>26,this.words[m]=n&67108863}return p!==0&&(this.words[m]=p,this.length++),u?this.ineg():this},a.prototype.muln=function(o){return this.clone().imuln(o)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(o){var u=bt(o);if(u.length===0)return new a(1);for(var p=this,m=0;m<u.length&&u[m]===0;m++,p=p.sqr());if(++m<u.length)for(var l=p.sqr();m<u.length;m++,l=l.sqr())u[m]!==0&&(p=p.mul(l));return p},a.prototype.iushln=function(o){r(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=67108863>>>26-u<<26-u,l;if(u!==0){var n=0;for(l=0;l<this.length;l++){var d=this.words[l]&m,M=(this.words[l]|0)-d<<u;this.words[l]=M|n,n=d>>>26-u}n&&(this.words[l]=n,this.length++)}if(p!==0){for(l=this.length-1;l>=0;l--)this.words[l+p]=this.words[l];for(l=0;l<p;l++)this.words[l]=0;this.length+=p}return this._strip()},a.prototype.ishln=function(o){return r(this.negative===0),this.iushln(o)},a.prototype.iushrn=function(o,u,p){r(typeof o=="number"&&o>=0);var m;u?m=(u-u%26)/26:m=0;var l=o%26,n=Math.min((o-l)/26,this.length),d=67108863^67108863>>>l<<l,M=p;if(m-=n,m=Math.max(0,m),M){for(var y=0;y<n;y++)M.words[y]=this.words[y];M.length=n}if(n!==0)if(this.length>n)for(this.length-=n,y=0;y<this.length;y++)this.words[y]=this.words[y+n];else this.words[0]=0,this.length=1;var x=0;for(y=this.length-1;y>=0&&(x!==0||y>=m);y--){var B=this.words[y]|0;this.words[y]=x<<26-l|B>>>l,x=B&d}return M&&x!==0&&(M.words[M.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(o,u,p){return r(this.negative===0),this.iushrn(o,u,p)},a.prototype.shln=function(o){return this.clone().ishln(o)},a.prototype.ushln=function(o){return this.clone().iushln(o)},a.prototype.shrn=function(o){return this.clone().ishrn(o)},a.prototype.ushrn=function(o){return this.clone().iushrn(o)},a.prototype.testn=function(o){r(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return!1;var l=this.words[p];return!!(l&m)},a.prototype.imaskn=function(o){r(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var m=67108863^67108863>>>u<<u;this.words[this.length-1]&=m}return this._strip()},a.prototype.maskn=function(o){return this.clone().imaskn(o)},a.prototype.iaddn=function(o){return r(typeof o=="number"),r(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},a.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},a.prototype.isubn=function(o){if(r(typeof o=="number"),r(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},a.prototype.addn=function(o){return this.clone().iaddn(o)},a.prototype.subn=function(o){return this.clone().isubn(o)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(o,u,p){var m=o.length+p,l;this._expand(m);var n,d=0;for(l=0;l<o.length;l++){n=(this.words[l+p]|0)+d;var M=(o.words[l]|0)*u;n-=M&67108863,d=(n>>26)-(M/67108864|0),this.words[l+p]=n&67108863}for(;l<this.length-p;l++)n=(this.words[l+p]|0)+d,d=n>>26,this.words[l+p]=n&67108863;if(d===0)return this._strip();for(r(d===-1),d=0,l=0;l<this.length;l++)n=-(this.words[l]|0)+d,d=n>>26,this.words[l]=n&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(o,u){var p=this.length-o.length,m=this.clone(),l=o,n=l.words[l.length-1]|0,d=this._countBits(n);p=26-d,p!==0&&(l=l.ushln(p),m.iushln(p),n=l.words[l.length-1]|0);var M=m.length-l.length,y;if(u!=="mod"){y=new a(null),y.length=M+1,y.words=new Array(y.length);for(var x=0;x<y.length;x++)y.words[x]=0}var B=m.clone()._ishlnsubmul(l,1,M);B.negative===0&&(m=B,y&&(y.words[M]=1));for(var E=M-1;E>=0;E--){var k=(m.words[l.length+E]|0)*67108864+(m.words[l.length+E-1]|0);for(k=Math.min(k/n|0,67108863),m._ishlnsubmul(l,k,E);m.negative!==0;)k--,m.negative=0,m._ishlnsubmul(l,1,E),m.isZero()||(m.negative^=1);y&&(y.words[E]=k)}return y&&y._strip(),m._strip(),u!=="div"&&p!==0&&m.iushrn(p),{div:y||null,mod:m}},a.prototype.divmod=function(o,u,p){if(r(!o.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var m,l,n;return this.negative!==0&&o.negative===0?(n=this.neg().divmod(o,u),u!=="mod"&&(m=n.div.neg()),u!=="div"&&(l=n.mod.neg(),p&&l.negative!==0&&l.iadd(o)),{div:m,mod:l}):this.negative===0&&o.negative!==0?(n=this.divmod(o.neg(),u),u!=="mod"&&(m=n.div.neg()),{div:m,mod:n.mod}):(this.negative&o.negative)!==0?(n=this.neg().divmod(o.neg(),u),u!=="div"&&(l=n.mod.neg(),p&&l.negative!==0&&l.isub(o)),{div:n.div,mod:l}):o.length>this.length||this.cmp(o)<0?{div:new a(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new a(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new a(this.modrn(o.words[0]))}:this._wordDiv(o,u)},a.prototype.div=function(o){return this.divmod(o,"div",!1).div},a.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},a.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},a.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,m=o.ushrn(1),l=o.andln(1),n=p.cmp(m);return n<0||l===1&&n===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},a.prototype.modrn=function(o){var u=o<0;u&&(o=-o),r(o<=67108863);for(var p=(1<<26)%o,m=0,l=this.length-1;l>=0;l--)m=(p*m+(this.words[l]|0))%o;return u?-m:m},a.prototype.modn=function(o){return this.modrn(o)},a.prototype.idivn=function(o){var u=o<0;u&&(o=-o),r(o<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var l=(this.words[m]|0)+p*67108864;this.words[m]=l/o|0,p=l%o}return this._strip(),u?this.ineg():this},a.prototype.divn=function(o){return this.clone().idivn(o)},a.prototype.egcd=function(o){r(o.negative===0),r(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new a(1),l=new a(0),n=new a(0),d=new a(1),M=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++M;for(var y=p.clone(),x=u.clone();!u.isZero();){for(var B=0,E=1;(u.words[0]&E)===0&&B<26;++B,E<<=1);if(B>0)for(u.iushrn(B);B-- >0;)(m.isOdd()||l.isOdd())&&(m.iadd(y),l.isub(x)),m.iushrn(1),l.iushrn(1);for(var k=0,wt=1;(p.words[0]&wt)===0&&k<26;++k,wt<<=1);if(k>0)for(p.iushrn(k);k-- >0;)(n.isOdd()||d.isOdd())&&(n.iadd(y),d.isub(x)),n.iushrn(1),d.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(n),l.isub(d)):(p.isub(u),n.isub(m),d.isub(l))}return{a:n,b:d,gcd:p.iushln(M)}},a.prototype._invmp=function(o){r(o.negative===0),r(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new a(1),l=new a(0),n=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var d=0,M=1;(u.words[0]&M)===0&&d<26;++d,M<<=1);if(d>0)for(u.iushrn(d);d-- >0;)m.isOdd()&&m.iadd(n),m.iushrn(1);for(var y=0,x=1;(p.words[0]&x)===0&&y<26;++y,x<<=1);if(y>0)for(p.iushrn(y);y-- >0;)l.isOdd()&&l.iadd(n),l.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(l)):(p.isub(u),l.isub(m))}var B;return u.cmpn(1)===0?B=m:B=l,B.cmpn(0)<0&&B.iadd(o),B},a.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var m=0;u.isEven()&&p.isEven();m++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var l=u.cmp(p);if(l<0){var n=u;u=p,p=n}else if(l===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(m)},a.prototype.invm=function(o){return this.egcd(o).a.umod(o)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(o){return this.words[0]&o},a.prototype.bincn=function(o){r(typeof o=="number");var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var l=m,n=p;l!==0&&n<this.length;n++){var d=this.words[n]|0;d+=l,l=d>>>26,d&=67108863,this.words[n]=d}return l!==0&&(this.words[n]=l,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),r(o<=67108863,"Number is too big");var m=this.words[0]|0;p=m===o?0:m<o?-1:1}return this.negative!==0?-p|0:p},a.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},a.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,l=o.words[p]|0;if(m!==l){m<l?u=-1:m>l&&(u=1);break}}return u},a.prototype.gtn=function(o){return this.cmpn(o)===1},a.prototype.gt=function(o){return this.cmp(o)===1},a.prototype.gten=function(o){return this.cmpn(o)>=0},a.prototype.gte=function(o){return this.cmp(o)>=0},a.prototype.ltn=function(o){return this.cmpn(o)===-1},a.prototype.lt=function(o){return this.cmp(o)===-1},a.prototype.lten=function(o){return this.cmpn(o)<=0},a.prototype.lte=function(o){return this.cmp(o)<=0},a.prototype.eqn=function(o){return this.cmpn(o)===0},a.prototype.eq=function(o){return this.cmp(o)===0},a.red=function(o){return new e(o)},a.prototype.toRed=function(o){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(o){return this.red=o,this},a.prototype.forceRed=function(o){return r(!this.red,"Already a number in reduction context"),this._forceRed(o)},a.prototype.redAdd=function(o){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},a.prototype.redIAdd=function(o){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},a.prototype.redSub=function(o){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},a.prototype.redISub=function(o){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},a.prototype.redShl=function(o){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},a.prototype.redMul=function(o){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},a.prototype.redIMul=function(o){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(o){return r(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var Tt={k256:null,p224:null,p192:null,p25519:null};function Bt(h,o){this.name=h,this.p=new a(o,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var o=new a(null);return o.words=new Array(Math.ceil(this.n/13)),o},Bt.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var m=p<this.n?-1:u.ucmp(this.p);return m===0?(u.words[0]=0,u.length=1):m>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},Bt.prototype.split=function(o,u){o.iushrn(this.n,0,u)},Bt.prototype.imulK=function(o){return o.imul(this.k)};function Pt(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Pt,Bt),Pt.prototype.split=function(o,u){for(var p=4194303,m=Math.min(o.length,9),l=0;l<m;l++)u.words[l]=o.words[l];if(u.length=m,o.length<=9){o.words[0]=0,o.length=1;return}var n=o.words[9];for(u.words[u.length++]=n&p,l=10;l<o.length;l++){var d=o.words[l]|0;o.words[l-10]=(d&p)<<4|n>>>22,n=d}n>>>=22,o.words[l-10]=n,n===0&&o.length>10?o.length-=10:o.length-=9},Pt.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var m=o.words[p]|0;u+=m*977,o.words[p]=u&67108863,u=m*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function O(){Bt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(O,Bt);function St(){Bt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(St,Bt);function v(){Bt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(v,Bt),v.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var m=(o.words[p]|0)*19+u,l=m&67108863;m>>>=26,o.words[p]=l,u=m}return u!==0&&(o.words[o.length++]=u),o},a._prime=function(o){if(Tt[o])return Tt[o];var u;if(o==="k256")u=new Pt;else if(o==="p224")u=new O;else if(o==="p192")u=new St;else if(o==="p25519")u=new v;else throw new Error("Unknown prime "+o);return Tt[o]=u,u};function e(h){if(typeof h=="string"){var o=a._prime(h);this.m=o.p,this.prime=o}else r(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}e.prototype._verify1=function(o){r(o.negative===0,"red works only with positives"),r(o.red,"red works only with red numbers")},e.prototype._verify2=function(o,u){r((o.negative|u.negative)===0,"red works only with positives"),r(o.red&&o.red===u.red,"red works only with red numbers")},e.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(_(o,o.umod(this.m)._forceRed(this)),o)},e.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},e.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},e.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},e.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},e.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},e.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},e.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},e.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},e.prototype.isqr=function(o){return this.imul(o,o.clone())},e.prototype.sqr=function(o){return this.mul(o,o)},e.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(r(u%2===1),u===3){var p=this.m.add(new a(1)).iushrn(2);return this.pow(o,p)}for(var m=this.m.subn(1),l=0;!m.isZero()&&m.andln(1)===0;)l++,m.iushrn(1);r(!m.isZero());var n=new a(1).toRed(this),d=n.redNeg(),M=this.m.subn(1).iushrn(1),y=this.m.bitLength();for(y=new a(2*y*y).toRed(this);this.pow(y,M).cmp(d)!==0;)y.redIAdd(d);for(var x=this.pow(y,m),B=this.pow(o,m.addn(1).iushrn(1)),E=this.pow(o,m),k=l;E.cmp(n)!==0;){for(var wt=E,T=0;wt.cmp(n)!==0;T++)wt=wt.redSqr();r(T<k);var P=this.pow(x,new a(1).iushln(k-T-1));B=B.redMul(P),x=P.redSqr(),E=E.redMul(x),k=T}return B},e.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},e.prototype.pow=function(o,u){if(u.isZero())return new a(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,m=new Array(1<<p);m[0]=new a(1).toRed(this),m[1]=o;for(var l=2;l<m.length;l++)m[l]=this.mul(m[l-1],o);var n=m[0],d=0,M=0,y=u.bitLength()%26;for(y===0&&(y=26),l=u.length-1;l>=0;l--){for(var x=u.words[l],B=y-1;B>=0;B--){var E=x>>B&1;if(n!==m[0]&&(n=this.sqr(n)),E===0&&d===0){M=0;continue}d<<=1,d|=E,M++,!(M!==p&&(l!==0||B!==0))&&(n=this.mul(n,m[d]),M=0,d=0)}y=26}return n},e.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},e.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},a.mont=function(o){return new f(o)};function f(h){e.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(f,e),f.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},f.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},f.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=p.isub(m).iushrn(this.shift),n=l;return l.cmp(this.m)>=0?n=l.isub(this.m):l.cmpn(0)<0&&(n=l.iadd(this.m)),n._forceRed(this)},f.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new a(0)._forceRed(this);var p=o.mul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),l=p.isub(m).iushrn(this.shift),n=l;return l.cmp(this.m)>=0?n=l.isub(this.m):l.cmpn(0)<0&&(n=l.iadd(this.m)),n._forceRed(this)},f.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(typeof uh>"u"||uh,Pv)});var w0=I((DS,Nv)=>{"use strict";var Kn=b0(),oM=Ui(),sM=It().Buffer;function Cv(i){var t=i.modulus.byteLength(),r;do r=new Kn(oM(t));while(r.cmp(i.modulus)>=0||!r.umod(i.prime1)||!r.umod(i.prime2));return r}function hM(i){var t=Cv(i),r=t.toRed(Kn.mont(i.modulus)).redPow(new Kn(i.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(i.modulus)}}function Dv(i,t){var r=hM(t),s=t.modulus.byteLength(),a=new Kn(i).mul(r.blinder).umod(t.modulus),c=a.toRed(Kn.mont(t.prime1)),g=a.toRed(Kn.mont(t.prime2)),b=t.coefficient,w=t.prime1,_=t.prime2,S=c.redPow(t.exponent1).fromRed(),A=g.redPow(t.exponent2).fromRed(),q=S.isub(A).imul(b).umod(w).imul(_);return A.iadd(q).imul(r.unblinder).umod(t.modulus).toArrayLike(sM,"be",s)}Dv.getr=Cv;Nv.exports=Dv});var Lv=I((NS,uM)=>{uM.exports={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 Vr=I((Ov,lh)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof lh>"u"||lh,Ov)});var dh=I(Kv=>{"use strict";var M0=Kv;function lM(i,t){if(Array.isArray(i))return i.slice();if(!i)return[];var r=[];if(typeof i!="string"){for(var s=0;s<i.length;s++)r[s]=i[s]|0;return r}if(t==="hex"){i=i.replace(/[^a-z0-9]+/ig,""),i.length%2!==0&&(i="0"+i);for(var s=0;s<i.length;s+=2)r.push(parseInt(i[s]+i[s+1],16))}else for(var s=0;s<i.length;s++){var a=i.charCodeAt(s),c=a>>8,g=a&255;c?r.push(c,g):r.push(g)}return r}M0.toArray=lM;function Fv(i){return i.length===1?"0"+i:i}M0.zero2=Fv;function Uv(i){for(var t="",r=0;r<i.length;r++)t+=Fv(i[r].toString(16));return t}M0.toHex=Uv;M0.encode=function(t,r){return r==="hex"?Uv(t):t}});var lr=I(zv=>{"use strict";var kr=zv,dM=Vr(),cM=ur(),x0=dh();kr.assert=cM;kr.toArray=x0.toArray;kr.zero2=x0.zero2;kr.toHex=x0.toHex;kr.encode=x0.encode;function pM(i,t,r){var s=new Array(Math.max(i.bitLength(),r)+1),a;for(a=0;a<s.length;a+=1)s[a]=0;var c=1<<t+1,g=i.clone();for(a=0;a<s.length;a++){var b,w=g.andln(c-1);g.isOdd()?(w>(c>>1)-1?b=(c>>1)-w:b=w,g.isubn(b)):b=0,s[a]=b,g.iushrn(1)}return s}kr.getNAF=pM;function vM(i,t){var r=[[],[]];i=i.clone(),t=t.clone();for(var s=0,a=0,c;i.cmpn(-s)>0||t.cmpn(-a)>0;){var g=i.andln(3)+s&3,b=t.andln(3)+a&3;g===3&&(g=-1),b===3&&(b=-1);var w;(g&1)===0?w=0:(c=i.andln(7)+s&7,(c===3||c===5)&&b===2?w=-g:w=g),r[0].push(w);var _;(b&1)===0?_=0:(c=t.andln(7)+a&7,(c===3||c===5)&&g===2?_=-b:_=b),r[1].push(_),2*s===w+1&&(s=1-s),2*a===_+1&&(a=1-a),i.iushrn(1),t.iushrn(1)}return r}kr.getJSF=vM;function mM(i,t,r){var s="_"+t;i.prototype[t]=function(){return this[s]!==void 0?this[s]:this[s]=r.call(this)}}kr.cachedProperty=mM;function gM(i){return typeof i=="string"?kr.toArray(i,"hex"):i}kr.parseBytes=gM;function yM(i){return new dM(i,"hex","le")}kr.intFromLE=yM});var Ga=I((FS,$v)=>{"use strict";var en=Vr(),Ha=lr(),_0=Ha.getNAF,bM=Ha.getJSF,S0=Ha.assert;function Ri(i,t){this.type=i,this.p=new en(t.p,16),this.red=t.prime?en.red(t.prime):en.mont(this.p),this.zero=new en(0).toRed(this.red),this.one=new en(1).toRed(this.red),this.two=new en(2).toRed(this.red),this.n=t.n&&new en(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}$v.exports=Ri;Ri.prototype.point=function(){throw new Error("Not implemented")};Ri.prototype.validate=function(){throw new Error("Not implemented")};Ri.prototype._fixedNafMul=function(t,r){S0(t.precomputed);var s=t._getDoubles(),a=_0(r,1,this._bitLength),c=(1<<s.step+1)-(s.step%2===0?2:1);c/=3;var g=[],b,w;for(b=0;b<a.length;b+=s.step){w=0;for(var _=b+s.step-1;_>=b;_--)w=(w<<1)+a[_];g.push(w)}for(var S=this.jpoint(null,null,null),A=this.jpoint(null,null,null),q=c;q>0;q--){for(b=0;b<g.length;b++)w=g[b],w===q?A=A.mixedAdd(s.points[b]):w===-q&&(A=A.mixedAdd(s.points[b].neg()));S=S.add(A)}return S.toP()};Ri.prototype._wnafMul=function(t,r){var s=4,a=t._getNAFPoints(s);s=a.wnd;for(var c=a.points,g=_0(r,s,this._bitLength),b=this.jpoint(null,null,null),w=g.length-1;w>=0;w--){for(var _=0;w>=0&&g[w]===0;w--)_++;if(w>=0&&_++,b=b.dblp(_),w<0)break;var S=g[w];S0(S!==0),t.type==="affine"?S>0?b=b.mixedAdd(c[S-1>>1]):b=b.mixedAdd(c[-S-1>>1].neg()):S>0?b=b.add(c[S-1>>1]):b=b.add(c[-S-1>>1].neg())}return t.type==="affine"?b.toP():b};Ri.prototype._wnafMulAdd=function(t,r,s,a,c){var g=this._wnafT1,b=this._wnafT2,w=this._wnafT3,_=0,S,A,q;for(S=0;S<a;S++){q=r[S];var R=q._getNAFPoints(t);g[S]=R.wnd,b[S]=R.points}for(S=a-1;S>=1;S-=2){var N=S-1,bt=S;if(g[N]!==1||g[bt]!==1){w[N]=_0(s[N],g[N],this._bitLength),w[bt]=_0(s[bt],g[bt],this._bitLength),_=Math.max(w[N].length,_),_=Math.max(w[bt].length,_);continue}var _t=[r[N],null,null,r[bt]];r[N].y.cmp(r[bt].y)===0?(_t[1]=r[N].add(r[bt]),_t[2]=r[N].toJ().mixedAdd(r[bt].neg())):r[N].y.cmp(r[bt].y.redNeg())===0?(_t[1]=r[N].toJ().mixedAdd(r[bt]),_t[2]=r[N].add(r[bt].neg())):(_t[1]=r[N].toJ().mixedAdd(r[bt]),_t[2]=r[N].toJ().mixedAdd(r[bt].neg()));var gt=[-3,-1,-5,-7,0,7,5,1,3],xt=bM(s[N],s[bt]);for(_=Math.max(xt[0].length,_),w[N]=new Array(_),w[bt]=new Array(_),A=0;A<_;A++){var Mt=xt[0][A]|0,At=xt[1][A]|0;w[N][A]=gt[(Mt+1)*3+(At+1)],w[bt][A]=0,b[N]=_t}}var Tt=this.jpoint(null,null,null),Bt=this._wnafT4;for(S=_;S>=0;S--){for(var Pt=0;S>=0;){var O=!0;for(A=0;A<a;A++)Bt[A]=w[A][S]|0,Bt[A]!==0&&(O=!1);if(!O)break;Pt++,S--}if(S>=0&&Pt++,Tt=Tt.dblp(Pt),S<0)break;for(A=0;A<a;A++){var St=Bt[A];St!==0&&(St>0?q=b[A][St-1>>1]:St<0&&(q=b[A][-St-1>>1].neg()),q.type==="affine"?Tt=Tt.mixedAdd(q):Tt=Tt.add(q))}}for(S=0;S<a;S++)b[S]=null;return c?Tt:Tt.toP()};function wr(i,t){this.curve=i,this.type=t,this.precomputed=null}Ri.BasePoint=wr;wr.prototype.eq=function(){throw new Error("Not implemented")};wr.prototype.validate=function(){return this.curve.validate(this)};Ri.prototype.decodePoint=function(t,r){t=Ha.toArray(t,r);var s=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*s){t[0]===6?S0(t[t.length-1]%2===0):t[0]===7&&S0(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+s),t.slice(1+s,1+2*s));return a}else if((t[0]===2||t[0]===3)&&t.length-1===s)return this.pointFromX(t.slice(1,1+s),t[0]===3);throw new Error("Unknown point format")};wr.prototype.encodeCompressed=function(t){return this.encode(t,!0)};wr.prototype._encode=function(t){var r=this.curve.p.byteLength(),s=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(s):[4].concat(s,this.getY().toArray("be",r))};wr.prototype.encode=function(t,r){return Ha.encode(this._encode(r),t)};wr.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};wr.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};wr.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var s=[this],a=this,c=0;c<r;c+=t){for(var g=0;g<t;g++)a=a.dbl();s.push(a)}return{step:t,points:s}};wr.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],s=(1<<t)-1,a=s===1?null:this.dbl(),c=1;c<s;c++)r[c]=r[c-1].add(a);return{wnd:t,points:r}};wr.prototype._getBeta=function(){return null};wr.prototype.dblp=function(t){for(var r=this,s=0;s<t;s++)r=r.dbl();return r}});var Gv=I((US,Hv)=>{"use strict";var wM=lr(),pe=Vr(),ch=Rt(),zn=Ga(),MM=wM.assert;function Mr(i){zn.call(this,"short",i),this.a=new pe(i.a,16).toRed(this.red),this.b=new pe(i.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(i),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ch(Mr,zn);Hv.exports=Mr;Mr.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,s;if(t.beta)r=new pe(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=a[0].cmp(a[1])<0?a[0]:a[1],r=r.toRed(this.red)}if(t.lambda)s=new pe(t.lambda,16);else{var c=this._getEndoRoots(this.n);this.g.mul(c[0]).x.cmp(this.g.x.redMul(r))===0?s=c[0]:(s=c[1],MM(this.g.mul(s).x.cmp(this.g.x.redMul(r))===0))}var g;return t.basis?g=t.basis.map(function(b){return{a:new pe(b.a,16),b:new pe(b.b,16)}}):g=this._getEndoBasis(s),{beta:r,lambda:s,basis:g}}};Mr.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:pe.mont(t),s=new pe(2).toRed(r).redInvm(),a=s.redNeg(),c=new pe(3).toRed(r).redNeg().redSqrt().redMul(s),g=a.redAdd(c).fromRed(),b=a.redSub(c).fromRed();return[g,b]};Mr.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),s=t,a=this.n.clone(),c=new pe(1),g=new pe(0),b=new pe(0),w=new pe(1),_,S,A,q,R,N,bt,_t=0,gt,xt;s.cmpn(0)!==0;){var Mt=a.div(s);gt=a.sub(Mt.mul(s)),xt=b.sub(Mt.mul(c));var At=w.sub(Mt.mul(g));if(!A&&gt.cmp(r)<0)_=bt.neg(),S=c,A=gt.neg(),q=xt;else if(A&&++_t===2)break;bt=gt,a=s,s=gt,b=c,c=xt,w=g,g=At}R=gt.neg(),N=xt;var Tt=A.sqr().add(q.sqr()),Bt=R.sqr().add(N.sqr());return Bt.cmp(Tt)>=0&&(R=_,N=S),A.negative&&(A=A.neg(),q=q.neg()),R.negative&&(R=R.neg(),N=N.neg()),[{a:A,b:q},{a:R,b:N}]};Mr.prototype._endoSplit=function(t){var r=this.endo.basis,s=r[0],a=r[1],c=a.b.mul(t).divRound(this.n),g=s.b.neg().mul(t).divRound(this.n),b=c.mul(s.a),w=g.mul(a.a),_=c.mul(s.b),S=g.mul(a.b),A=t.sub(b).sub(w),q=_.add(S).neg();return{k1:A,k2:q}};Mr.prototype.pointFromX=function(t,r){t=new pe(t,16),t.red||(t=t.toRed(this.red));var s=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=s.redSqrt();if(a.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var c=a.fromRed().isOdd();return(r&&!c||!r&&c)&&(a=a.redNeg()),this.point(t,a)};Mr.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,s=t.y,a=this.a.redMul(r),c=r.redSqr().redMul(r).redIAdd(a).redIAdd(this.b);return s.redSqr().redISub(c).cmpn(0)===0};Mr.prototype._endoWnafMulAdd=function(t,r,s){for(var a=this._endoWnafT1,c=this._endoWnafT2,g=0;g<t.length;g++){var b=this._endoSplit(r[g]),w=t[g],_=w._getBeta();b.k1.negative&&(b.k1.ineg(),w=w.neg(!0)),b.k2.negative&&(b.k2.ineg(),_=_.neg(!0)),a[g*2]=w,a[g*2+1]=_,c[g*2]=b.k1,c[g*2+1]=b.k2}for(var S=this._wnafMulAdd(1,a,c,g*2,s),A=0;A<g*2;A++)a[A]=null,c[A]=null;return S};function Oe(i,t,r,s){zn.BasePoint.call(this,i,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new pe(t,16),this.y=new pe(r,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)}ch(Oe,zn.BasePoint);Mr.prototype.point=function(t,r,s){return new Oe(this,t,r,s)};Mr.prototype.pointFromJSON=function(t,r){return Oe.fromJSON(this,t,r)};Oe.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var s=this.curve,a=function(c){return s.point(c.x.redMul(s.endo.beta),c.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return r}};Oe.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]};Oe.fromJSON=function(t,r,s){typeof r=="string"&&(r=JSON.parse(r));var a=t.point(r[0],r[1],s);if(!r[2])return a;function c(b){return t.point(b[0],b[1],s)}var g=r[2];return a.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[a].concat(g.doubles.points.map(c))},naf:g.naf&&{wnd:g.naf.wnd,points:[a].concat(g.naf.points.map(c))}},a};Oe.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)+">"};Oe.prototype.isInfinity=function(){return this.inf};Oe.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var s=r.redSqr().redISub(this.x).redISub(t.x),a=r.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)};Oe.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,s=this.x.redSqr(),a=t.redInvm(),c=s.redAdd(s).redIAdd(s).redIAdd(r).redMul(a),g=c.redSqr().redISub(this.x.redAdd(this.x)),b=c.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,b)};Oe.prototype.getX=function(){return this.x.fromRed()};Oe.prototype.getY=function(){return this.y.fromRed()};Oe.prototype.mul=function(t){return t=new pe(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Oe.prototype.mulAdd=function(t,r,s){var a=[this,r],c=[t,s];return this.curve.endo?this.curve._endoWnafMulAdd(a,c):this.curve._wnafMulAdd(1,a,c,2)};Oe.prototype.jmulAdd=function(t,r,s){var a=[this,r],c=[t,s];return this.curve.endo?this.curve._endoWnafMulAdd(a,c,!0):this.curve._wnafMulAdd(1,a,c,2,!0)};Oe.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Oe.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var s=this.precomputed,a=function(c){return c.neg()};r.precomputed={naf:s.naf&&{wnd:s.naf.wnd,points:s.naf.points.map(a)},doubles:s.doubles&&{step:s.doubles.step,points:s.doubles.points.map(a)}}}return r};Oe.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function $e(i,t,r,s){zn.BasePoint.call(this,i,"jacobian"),t===null&&r===null&&s===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new pe(0)):(this.x=new pe(t,16),this.y=new pe(r,16),this.z=new pe(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}ch($e,zn.BasePoint);Mr.prototype.jpoint=function(t,r,s){return new $e(this,t,r,s)};$e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),s=this.x.redMul(r),a=this.y.redMul(r).redMul(t);return this.curve.point(s,a)};$e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};$e.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),s=this.z.redSqr(),a=this.x.redMul(r),c=t.x.redMul(s),g=this.y.redMul(r.redMul(t.z)),b=t.y.redMul(s.redMul(this.z)),w=a.redSub(c),_=g.redSub(b);if(w.cmpn(0)===0)return _.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=w.redSqr(),A=S.redMul(w),q=a.redMul(S),R=_.redSqr().redIAdd(A).redISub(q).redISub(q),N=_.redMul(q.redISub(R)).redISub(g.redMul(A)),bt=this.z.redMul(t.z).redMul(w);return this.curve.jpoint(R,N,bt)};$e.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),s=this.x,a=t.x.redMul(r),c=this.y,g=t.y.redMul(r).redMul(this.z),b=s.redSub(a),w=c.redSub(g);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var _=b.redSqr(),S=_.redMul(b),A=s.redMul(_),q=w.redSqr().redIAdd(S).redISub(A).redISub(A),R=w.redMul(A.redISub(q)).redISub(c.redMul(S)),N=this.z.redMul(b);return this.curve.jpoint(q,R,N)};$e.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var s=this;for(r=0;r<t;r++)s=s.dbl();return s}var a=this.curve.a,c=this.curve.tinv,g=this.x,b=this.y,w=this.z,_=w.redSqr().redSqr(),S=b.redAdd(b);for(r=0;r<t;r++){var A=g.redSqr(),q=S.redSqr(),R=q.redSqr(),N=A.redAdd(A).redIAdd(A).redIAdd(a.redMul(_)),bt=g.redMul(q),_t=N.redSqr().redISub(bt.redAdd(bt)),gt=bt.redISub(_t),xt=N.redMul(gt);xt=xt.redIAdd(xt).redISub(R);var Mt=S.redMul(w);r+1<t&&(_=_.redMul(R)),g=_t,w=Mt,S=xt}return this.curve.jpoint(g,S.redMul(c),w)};$e.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};$e.prototype._zeroDbl=function(){var t,r,s;if(this.zOne){var a=this.x.redSqr(),c=this.y.redSqr(),g=c.redSqr(),b=this.x.redAdd(c).redSqr().redISub(a).redISub(g);b=b.redIAdd(b);var w=a.redAdd(a).redIAdd(a),_=w.redSqr().redISub(b).redISub(b),S=g.redIAdd(g);S=S.redIAdd(S),S=S.redIAdd(S),t=_,r=w.redMul(b.redISub(_)).redISub(S),s=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),q=this.y.redSqr(),R=q.redSqr(),N=this.x.redAdd(q).redSqr().redISub(A).redISub(R);N=N.redIAdd(N);var bt=A.redAdd(A).redIAdd(A),_t=bt.redSqr(),gt=R.redIAdd(R);gt=gt.redIAdd(gt),gt=gt.redIAdd(gt),t=_t.redISub(N).redISub(N),r=bt.redMul(N.redISub(t)).redISub(gt),s=this.y.redMul(this.z),s=s.redIAdd(s)}return this.curve.jpoint(t,r,s)};$e.prototype._threeDbl=function(){var t,r,s;if(this.zOne){var a=this.x.redSqr(),c=this.y.redSqr(),g=c.redSqr(),b=this.x.redAdd(c).redSqr().redISub(a).redISub(g);b=b.redIAdd(b);var w=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),_=w.redSqr().redISub(b).redISub(b);t=_;var S=g.redIAdd(g);S=S.redIAdd(S),S=S.redIAdd(S),r=w.redMul(b.redISub(_)).redISub(S),s=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),q=this.y.redSqr(),R=this.x.redMul(q),N=this.x.redSub(A).redMul(this.x.redAdd(A));N=N.redAdd(N).redIAdd(N);var bt=R.redIAdd(R);bt=bt.redIAdd(bt);var _t=bt.redAdd(bt);t=N.redSqr().redISub(_t),s=this.y.redAdd(this.z).redSqr().redISub(q).redISub(A);var gt=q.redSqr();gt=gt.redIAdd(gt),gt=gt.redIAdd(gt),gt=gt.redIAdd(gt),r=N.redMul(bt.redISub(t)).redISub(gt)}return this.curve.jpoint(t,r,s)};$e.prototype._dbl=function(){var t=this.curve.a,r=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),g=r.redSqr(),b=s.redSqr(),w=g.redAdd(g).redIAdd(g).redIAdd(t.redMul(c)),_=r.redAdd(r);_=_.redIAdd(_);var S=_.redMul(b),A=w.redSqr().redISub(S.redAdd(S)),q=S.redISub(A),R=b.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var N=w.redMul(q).redISub(R),bt=s.redAdd(s).redMul(a);return this.curve.jpoint(A,N,bt)};$e.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),s=this.z.redSqr(),a=r.redSqr(),c=t.redAdd(t).redIAdd(t),g=c.redSqr(),b=this.x.redAdd(r).redSqr().redISub(t).redISub(a);b=b.redIAdd(b),b=b.redAdd(b).redIAdd(b),b=b.redISub(g);var w=b.redSqr(),_=a.redIAdd(a);_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var S=c.redIAdd(b).redSqr().redISub(g).redISub(w).redISub(_),A=r.redMul(S);A=A.redIAdd(A),A=A.redIAdd(A);var q=this.x.redMul(w).redISub(A);q=q.redIAdd(q),q=q.redIAdd(q);var R=this.y.redMul(S.redMul(_.redISub(S)).redISub(b.redMul(w)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var N=this.z.redAdd(b).redSqr().redISub(s).redISub(w);return this.curve.jpoint(q,R,N)};$e.prototype.mul=function(t,r){return t=new pe(t,r),this.curve._wnafMul(this,t)};$e.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),s=t.z.redSqr();if(this.x.redMul(s).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var a=r.redMul(this.z),c=s.redMul(t.z);return this.y.redMul(c).redISub(t.y.redMul(a)).cmpn(0)===0};$e.prototype.eqXToP=function(t){var r=this.z.redSqr(),s=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(s)===0)return!0;for(var a=t.clone(),c=this.curve.redN.redMul(r);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(c),this.x.cmp(s)===0)return!0}};$e.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)+">"};$e.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var Vv=I((KS,Wv)=>{"use strict";var $n=Vr(),Zv=Rt(),A0=Ga(),xM=lr();function Hn(i){A0.call(this,"mont",i),this.a=new $n(i.a,16).toRed(this.red),this.b=new $n(i.b,16).toRed(this.red),this.i4=new $n(4).toRed(this.red).redInvm(),this.two=new $n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Zv(Hn,A0);Wv.exports=Hn;Hn.prototype.validate=function(t){var r=t.normalize().x,s=r.redSqr(),a=s.redMul(r).redAdd(s.redMul(this.a)).redAdd(r),c=a.redSqrt();return c.redSqr().cmp(a)===0};function Fe(i,t,r){A0.BasePoint.call(this,i,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new $n(t,16),this.z=new $n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Zv(Fe,A0.BasePoint);Hn.prototype.decodePoint=function(t,r){return this.point(xM.toArray(t,r),1)};Hn.prototype.point=function(t,r){return new Fe(this,t,r)};Hn.prototype.pointFromJSON=function(t){return Fe.fromJSON(this,t)};Fe.prototype.precompute=function(){};Fe.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Fe.fromJSON=function(t,r){return new Fe(t,r[0],r[1]||t.one)};Fe.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)+">"};Fe.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Fe.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),s=this.x.redSub(this.z),a=s.redSqr(),c=r.redSub(a),g=r.redMul(a),b=c.redMul(a.redAdd(this.curve.a24.redMul(c)));return this.curve.point(g,b)};Fe.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Fe.prototype.diffAdd=function(t,r){var s=this.x.redAdd(this.z),a=this.x.redSub(this.z),c=t.x.redAdd(t.z),g=t.x.redSub(t.z),b=g.redMul(s),w=c.redMul(a),_=r.z.redMul(b.redAdd(w).redSqr()),S=r.x.redMul(b.redISub(w).redSqr());return this.curve.point(_,S)};Fe.prototype.mul=function(t){for(var r=t.clone(),s=this,a=this.curve.point(null,null),c=this,g=[];r.cmpn(0)!==0;r.iushrn(1))g.push(r.andln(1));for(var b=g.length-1;b>=0;b--)g[b]===0?(s=s.diffAdd(a,c),a=a.dbl()):(a=s.diffAdd(a,c),s=s.dbl());return a};Fe.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Fe.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Fe.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Fe.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Fe.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var Xv=I((zS,Jv)=>{"use strict";var _M=lr(),gi=Vr(),jv=Rt(),B0=Ga(),SM=_M.assert;function jr(i){this.twisted=(i.a|0)!==1,this.mOneA=this.twisted&&(i.a|0)===-1,this.extended=this.mOneA,B0.call(this,"edwards",i),this.a=new gi(i.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new gi(i.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new gi(i.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),SM(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(i.c|0)===1}jv(jr,B0);Jv.exports=jr;jr.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};jr.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};jr.prototype.jpoint=function(t,r,s,a){return this.point(t,r,s,a)};jr.prototype.pointFromX=function(t,r){t=new gi(t,16),t.red||(t=t.toRed(this.red));var s=t.redSqr(),a=this.c2.redSub(this.a.redMul(s)),c=this.one.redSub(this.c2.redMul(this.d).redMul(s)),g=a.redMul(c.redInvm()),b=g.redSqrt();if(b.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var w=b.fromRed().isOdd();return(r&&!w||!r&&w)&&(b=b.redNeg()),this.point(t,b)};jr.prototype.pointFromY=function(t,r){t=new gi(t,16),t.red||(t=t.toRed(this.red));var s=t.redSqr(),a=s.redSub(this.c2),c=s.redMul(this.d).redMul(this.c2).redSub(this.a),g=a.redMul(c.redInvm());if(g.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var b=g.redSqrt();if(b.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return b.fromRed().isOdd()!==r&&(b=b.redNeg()),this.point(b,t)};jr.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),s=t.y.redSqr(),a=r.redMul(this.a).redAdd(s),c=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(s)));return a.cmp(c)===0};function de(i,t,r,s,a){B0.BasePoint.call(this,i,"projective"),t===null&&r===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 gi(t,16),this.y=new gi(r,16),this.z=s?new gi(s,16):this.curve.one,this.t=a&&new gi(a,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()))))}jv(de,B0.BasePoint);jr.prototype.pointFromJSON=function(t){return de.fromJSON(this,t)};jr.prototype.point=function(t,r,s,a){return new de(this,t,r,s,a)};de.fromJSON=function(t,r){return new de(t,r[0],r[1],r[2])};de.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)+">"};de.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};de.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),s=this.z.redSqr();s=s.redIAdd(s);var a=this.curve._mulA(t),c=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),g=a.redAdd(r),b=g.redSub(s),w=a.redSub(r),_=c.redMul(b),S=g.redMul(w),A=c.redMul(w),q=b.redMul(g);return this.curve.point(_,S,q,A)};de.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),s=this.y.redSqr(),a,c,g,b,w,_;if(this.curve.twisted){b=this.curve._mulA(r);var S=b.redAdd(s);this.zOne?(a=t.redSub(r).redSub(s).redMul(S.redSub(this.curve.two)),c=S.redMul(b.redSub(s)),g=S.redSqr().redSub(S).redSub(S)):(w=this.z.redSqr(),_=S.redSub(w).redISub(w),a=t.redSub(r).redISub(s).redMul(_),c=S.redMul(b.redSub(s)),g=S.redMul(_))}else b=r.redAdd(s),w=this.curve._mulC(this.z).redSqr(),_=b.redSub(w).redSub(w),a=this.curve._mulC(t.redISub(b)).redMul(_),c=this.curve._mulC(b).redMul(r.redISub(s)),g=b.redMul(_);return this.curve.point(a,c,g)};de.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};de.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),s=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),a=this.t.redMul(this.curve.dd).redMul(t.t),c=this.z.redMul(t.z.redAdd(t.z)),g=s.redSub(r),b=c.redSub(a),w=c.redAdd(a),_=s.redAdd(r),S=g.redMul(b),A=w.redMul(_),q=g.redMul(_),R=b.redMul(w);return this.curve.point(S,A,R,q)};de.prototype._projAdd=function(t){var r=this.z.redMul(t.z),s=r.redSqr(),a=this.x.redMul(t.x),c=this.y.redMul(t.y),g=this.curve.d.redMul(a).redMul(c),b=s.redSub(g),w=s.redAdd(g),_=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(c),S=r.redMul(b).redMul(_),A,q;return this.curve.twisted?(A=r.redMul(w).redMul(c.redSub(this.curve._mulA(a))),q=b.redMul(w)):(A=r.redMul(w).redMul(c.redSub(a)),q=this.curve._mulC(b).redMul(w)),this.curve.point(S,A,q)};de.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};de.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};de.prototype.mulAdd=function(t,r,s){return this.curve._wnafMulAdd(1,[this,r],[t,s],2,!1)};de.prototype.jmulAdd=function(t,r,s){return this.curve._wnafMulAdd(1,[this,r],[t,s],2,!0)};de.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};de.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};de.prototype.getX=function(){return this.normalize(),this.x.fromRed()};de.prototype.getY=function(){return this.normalize(),this.y.fromRed()};de.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};de.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var s=t.clone(),a=this.curve.redN.redMul(this.z);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(a),this.x.cmp(r)===0)return!0}};de.prototype.toP=de.prototype.normalize;de.prototype.mixedAdd=de.prototype.add});var ph=I(Yv=>{"use strict";var E0=Yv;E0.base=Ga();E0.short=Gv();E0.mont=Vv();E0.edwards=Xv()});var qr=I(he=>{"use strict";var AM=ur(),BM=Rt();he.inherits=BM;function EM(i,t){return(i.charCodeAt(t)&64512)!==55296||t<0||t+1>=i.length?!1:(i.charCodeAt(t+1)&64512)===56320}function kM(i,t){if(Array.isArray(i))return i.slice();if(!i)return[];var r=[];if(typeof i=="string")if(t){if(t==="hex")for(i=i.replace(/[^a-z0-9]+/ig,""),i.length%2!==0&&(i="0"+i),a=0;a<i.length;a+=2)r.push(parseInt(i[a]+i[a+1],16))}else for(var s=0,a=0;a<i.length;a++){var c=i.charCodeAt(a);c<128?r[s++]=c:c<2048?(r[s++]=c>>6|192,r[s++]=c&63|128):EM(i,a)?(c=65536+((c&1023)<<10)+(i.charCodeAt(++a)&1023),r[s++]=c>>18|240,r[s++]=c>>12&63|128,r[s++]=c>>6&63|128,r[s++]=c&63|128):(r[s++]=c>>12|224,r[s++]=c>>6&63|128,r[s++]=c&63|128)}else for(a=0;a<i.length;a++)r[a]=i[a]|0;return r}he.toArray=kM;function qM(i){for(var t="",r=0;r<i.length;r++)t+=tm(i[r].toString(16));return t}he.toHex=qM;function Qv(i){var t=i>>>24|i>>>8&65280|i<<8&16711680|(i&255)<<24;return t>>>0}he.htonl=Qv;function IM(i,t){for(var r="",s=0;s<i.length;s++){var a=i[s];t==="little"&&(a=Qv(a)),r+=em(a.toString(16))}return r}he.toHex32=IM;function tm(i){return i.length===1?"0"+i:i}he.zero2=tm;function em(i){return i.length===7?"0"+i:i.length===6?"00"+i:i.length===5?"000"+i:i.length===4?"0000"+i:i.length===3?"00000"+i:i.length===2?"000000"+i:i.length===1?"0000000"+i:i}he.zero8=em;function RM(i,t,r,s){var a=r-t;AM(a%4===0);for(var c=new Array(a/4),g=0,b=t;g<c.length;g++,b+=4){var w;s==="big"?w=i[b]<<24|i[b+1]<<16|i[b+2]<<8|i[b+3]:w=i[b+3]<<24|i[b+2]<<16|i[b+1]<<8|i[b],c[g]=w>>>0}return c}he.join32=RM;function TM(i,t){for(var r=new Array(i.length*4),s=0,a=0;s<i.length;s++,a+=4){var c=i[s];t==="big"?(r[a]=c>>>24,r[a+1]=c>>>16&255,r[a+2]=c>>>8&255,r[a+3]=c&255):(r[a+3]=c>>>24,r[a+2]=c>>>16&255,r[a+1]=c>>>8&255,r[a]=c&255)}return r}he.split32=TM;function PM(i,t){return i>>>t|i<<32-t}he.rotr32=PM;function CM(i,t){return i<<t|i>>>32-t}he.rotl32=CM;function DM(i,t){return i+t>>>0}he.sum32=DM;function NM(i,t,r){return i+t+r>>>0}he.sum32_3=NM;function LM(i,t,r,s){return i+t+r+s>>>0}he.sum32_4=LM;function OM(i,t,r,s,a){return i+t+r+s+a>>>0}he.sum32_5=OM;function FM(i,t,r,s){var a=i[t],c=i[t+1],g=s+c>>>0,b=(g<s?1:0)+r+a;i[t]=b>>>0,i[t+1]=g}he.sum64=FM;function UM(i,t,r,s){var a=t+s>>>0,c=(a<t?1:0)+i+r;return c>>>0}he.sum64_hi=UM;function KM(i,t,r,s){var a=t+s;return a>>>0}he.sum64_lo=KM;function zM(i,t,r,s,a,c,g,b){var w=0,_=t;_=_+s>>>0,w+=_<t?1:0,_=_+c>>>0,w+=_<c?1:0,_=_+b>>>0,w+=_<b?1:0;var S=i+r+a+g+w;return S>>>0}he.sum64_4_hi=zM;function $M(i,t,r,s,a,c,g,b){var w=t+s+c+b;return w>>>0}he.sum64_4_lo=$M;function HM(i,t,r,s,a,c,g,b,w,_){var S=0,A=t;A=A+s>>>0,S+=A<t?1:0,A=A+c>>>0,S+=A<c?1:0,A=A+b>>>0,S+=A<b?1:0,A=A+_>>>0,S+=A<_?1:0;var q=i+r+a+g+w+S;return q>>>0}he.sum64_5_hi=HM;function GM(i,t,r,s,a,c,g,b,w,_){var S=t+s+c+b+_;return S>>>0}he.sum64_5_lo=GM;function ZM(i,t,r){var s=t<<32-r|i>>>r;return s>>>0}he.rotr64_hi=ZM;function WM(i,t,r){var s=i<<32-r|t>>>r;return s>>>0}he.rotr64_lo=WM;function VM(i,t,r){return i>>>r}he.shr64_hi=VM;function jM(i,t,r){var s=i<<32-r|t>>>r;return s>>>0}he.shr64_lo=jM});var Gn=I(im=>{"use strict";var rm=qr(),JM=ur();function k0(){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}im.BlockHash=k0;k0.prototype.update=function(t,r){if(t=rm.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var s=t.length%this._delta8;this.pending=t.slice(t.length-s,t.length),this.pending.length===0&&(this.pending=null),t=rm.join32(t,0,t.length-s,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this};k0.prototype.digest=function(t){return this.update(this._pad()),JM(this.pending===null),this._digest(t)};k0.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,s=r-(t+this.padLength)%r,a=new Array(s+this.padLength);a[0]=128;for(var c=1;c<s;c++)a[c]=0;if(t<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)a[c++]=0;a[c++]=0,a[c++]=0,a[c++]=0,a[c++]=0,a[c++]=t>>>24&255,a[c++]=t>>>16&255,a[c++]=t>>>8&255,a[c++]=t&255}else for(a[c++]=t&255,a[c++]=t>>>8&255,a[c++]=t>>>16&255,a[c++]=t>>>24&255,a[c++]=0,a[c++]=0,a[c++]=0,a[c++]=0,g=8;g<this.padLength;g++)a[c++]=0;return a}});var vh=I(yi=>{"use strict";var XM=qr(),Jr=XM.rotr32;function YM(i,t,r,s){if(i===0)return nm(t,r,s);if(i===1||i===3)return fm(t,r,s);if(i===2)return am(t,r,s)}yi.ft_1=YM;function nm(i,t,r){return i&t^~i&r}yi.ch32=nm;function am(i,t,r){return i&t^i&r^t&r}yi.maj32=am;function fm(i,t,r){return i^t^r}yi.p32=fm;function QM(i){return Jr(i,2)^Jr(i,13)^Jr(i,22)}yi.s0_256=QM;function t5(i){return Jr(i,6)^Jr(i,11)^Jr(i,25)}yi.s1_256=t5;function e5(i){return Jr(i,7)^Jr(i,18)^i>>>3}yi.g0_256=e5;function r5(i){return Jr(i,17)^Jr(i,19)^i>>>10}yi.g1_256=r5});var hm=I((WS,sm)=>{"use strict";var Zn=qr(),i5=Gn(),n5=vh(),mh=Zn.rotl32,Za=Zn.sum32,a5=Zn.sum32_5,f5=n5.ft_1,om=i5.BlockHash,o5=[1518500249,1859775393,2400959708,3395469782];function Xr(){if(!(this instanceof Xr))return new Xr;om.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Zn.inherits(Xr,om);sm.exports=Xr;Xr.blockSize=512;Xr.outSize=160;Xr.hmacStrength=80;Xr.padLength=64;Xr.prototype._update=function(t,r){for(var s=this.W,a=0;a<16;a++)s[a]=t[r+a];for(;a<s.length;a++)s[a]=mh(s[a-3]^s[a-8]^s[a-14]^s[a-16],1);var c=this.h[0],g=this.h[1],b=this.h[2],w=this.h[3],_=this.h[4];for(a=0;a<s.length;a++){var S=~~(a/20),A=a5(mh(c,5),f5(S,g,b,w),_,s[a],o5[S]);_=w,w=b,b=mh(g,30),g=c,c=A}this.h[0]=Za(this.h[0],c),this.h[1]=Za(this.h[1],g),this.h[2]=Za(this.h[2],b),this.h[3]=Za(this.h[3],w),this.h[4]=Za(this.h[4],_)};Xr.prototype._digest=function(t){return t==="hex"?Zn.toHex32(this.h,"big"):Zn.split32(this.h,"big")}});var gh=I((VS,lm)=>{"use strict";var Wn=qr(),s5=Gn(),Vn=vh(),h5=ur(),Ir=Wn.sum32,u5=Wn.sum32_4,l5=Wn.sum32_5,d5=Vn.ch32,c5=Vn.maj32,p5=Vn.s0_256,v5=Vn.s1_256,m5=Vn.g0_256,g5=Vn.g1_256,um=s5.BlockHash,y5=[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 Yr(){if(!(this instanceof Yr))return new Yr;um.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y5,this.W=new Array(64)}Wn.inherits(Yr,um);lm.exports=Yr;Yr.blockSize=512;Yr.outSize=256;Yr.hmacStrength=192;Yr.padLength=64;Yr.prototype._update=function(t,r){for(var s=this.W,a=0;a<16;a++)s[a]=t[r+a];for(;a<s.length;a++)s[a]=u5(g5(s[a-2]),s[a-7],m5(s[a-15]),s[a-16]);var c=this.h[0],g=this.h[1],b=this.h[2],w=this.h[3],_=this.h[4],S=this.h[5],A=this.h[6],q=this.h[7];for(h5(this.k.length===s.length),a=0;a<s.length;a++){var R=l5(q,v5(_),d5(_,S,A),this.k[a],s[a]),N=Ir(p5(c),c5(c,g,b));q=A,A=S,S=_,_=Ir(w,R),w=b,b=g,g=c,c=Ir(R,N)}this.h[0]=Ir(this.h[0],c),this.h[1]=Ir(this.h[1],g),this.h[2]=Ir(this.h[2],b),this.h[3]=Ir(this.h[3],w),this.h[4]=Ir(this.h[4],_),this.h[5]=Ir(this.h[5],S),this.h[6]=Ir(this.h[6],A),this.h[7]=Ir(this.h[7],q)};Yr.prototype._digest=function(t){return t==="hex"?Wn.toHex32(this.h,"big"):Wn.split32(this.h,"big")}});var pm=I((jS,cm)=>{"use strict";var yh=qr(),dm=gh();function bi(){if(!(this instanceof bi))return new bi;dm.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}yh.inherits(bi,dm);cm.exports=bi;bi.blockSize=512;bi.outSize=224;bi.hmacStrength=192;bi.padLength=64;bi.prototype._digest=function(t){return t==="hex"?yh.toHex32(this.h.slice(0,7),"big"):yh.split32(this.h.slice(0,7),"big")}});var Mh=I((JS,ym)=>{"use strict";var fr=qr(),b5=Gn(),w5=ur(),Qr=fr.rotr64_hi,ti=fr.rotr64_lo,vm=fr.shr64_hi,mm=fr.shr64_lo,Ti=fr.sum64,bh=fr.sum64_hi,wh=fr.sum64_lo,M5=fr.sum64_4_hi,x5=fr.sum64_4_lo,_5=fr.sum64_5_hi,S5=fr.sum64_5_lo,gm=b5.BlockHash,A5=[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 Rr(){if(!(this instanceof Rr))return new Rr;gm.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=A5,this.W=new Array(160)}fr.inherits(Rr,gm);ym.exports=Rr;Rr.blockSize=1024;Rr.outSize=512;Rr.hmacStrength=192;Rr.padLength=128;Rr.prototype._prepareBlock=function(t,r){for(var s=this.W,a=0;a<32;a++)s[a]=t[r+a];for(;a<s.length;a+=2){var c=N5(s[a-4],s[a-3]),g=L5(s[a-4],s[a-3]),b=s[a-14],w=s[a-13],_=C5(s[a-30],s[a-29]),S=D5(s[a-30],s[a-29]),A=s[a-32],q=s[a-31];s[a]=M5(c,g,b,w,_,S,A,q),s[a+1]=x5(c,g,b,w,_,S,A,q)}};Rr.prototype._update=function(t,r){this._prepareBlock(t,r);var s=this.W,a=this.h[0],c=this.h[1],g=this.h[2],b=this.h[3],w=this.h[4],_=this.h[5],S=this.h[6],A=this.h[7],q=this.h[8],R=this.h[9],N=this.h[10],bt=this.h[11],_t=this.h[12],gt=this.h[13],xt=this.h[14],Mt=this.h[15];w5(this.k.length===s.length);for(var At=0;At<s.length;At+=2){var Tt=xt,Bt=Mt,Pt=T5(q,R),O=P5(q,R),St=B5(q,R,N,bt,_t,gt),v=E5(q,R,N,bt,_t,gt),e=this.k[At],f=this.k[At+1],h=s[At],o=s[At+1],u=_5(Tt,Bt,Pt,O,St,v,e,f,h,o),p=S5(Tt,Bt,Pt,O,St,v,e,f,h,o);Tt=I5(a,c),Bt=R5(a,c),Pt=k5(a,c,g,b,w,_),O=q5(a,c,g,b,w,_);var m=bh(Tt,Bt,Pt,O),l=wh(Tt,Bt,Pt,O);xt=_t,Mt=gt,_t=N,gt=bt,N=q,bt=R,q=bh(S,A,u,p),R=wh(A,A,u,p),S=w,A=_,w=g,_=b,g=a,b=c,a=bh(u,p,m,l),c=wh(u,p,m,l)}Ti(this.h,0,a,c),Ti(this.h,2,g,b),Ti(this.h,4,w,_),Ti(this.h,6,S,A),Ti(this.h,8,q,R),Ti(this.h,10,N,bt),Ti(this.h,12,_t,gt),Ti(this.h,14,xt,Mt)};Rr.prototype._digest=function(t){return t==="hex"?fr.toHex32(this.h,"big"):fr.split32(this.h,"big")};function B5(i,t,r,s,a){var c=i&r^~i&a;return c<0&&(c+=4294967296),c}function E5(i,t,r,s,a,c){var g=t&s^~t&c;return g<0&&(g+=4294967296),g}function k5(i,t,r,s,a){var c=i&r^i&a^r&a;return c<0&&(c+=4294967296),c}function q5(i,t,r,s,a,c){var g=t&s^t&c^s&c;return g<0&&(g+=4294967296),g}function I5(i,t){var r=Qr(i,t,28),s=Qr(t,i,2),a=Qr(t,i,7),c=r^s^a;return c<0&&(c+=4294967296),c}function R5(i,t){var r=ti(i,t,28),s=ti(t,i,2),a=ti(t,i,7),c=r^s^a;return c<0&&(c+=4294967296),c}function T5(i,t){var r=Qr(i,t,14),s=Qr(i,t,18),a=Qr(t,i,9),c=r^s^a;return c<0&&(c+=4294967296),c}function P5(i,t){var r=ti(i,t,14),s=ti(i,t,18),a=ti(t,i,9),c=r^s^a;return c<0&&(c+=4294967296),c}function C5(i,t){var r=Qr(i,t,1),s=Qr(i,t,8),a=vm(i,t,7),c=r^s^a;return c<0&&(c+=4294967296),c}function D5(i,t){var r=ti(i,t,1),s=ti(i,t,8),a=mm(i,t,7),c=r^s^a;return c<0&&(c+=4294967296),c}function N5(i,t){var r=Qr(i,t,19),s=Qr(t,i,29),a=vm(i,t,6),c=r^s^a;return c<0&&(c+=4294967296),c}function L5(i,t){var r=ti(i,t,19),s=ti(t,i,29),a=mm(i,t,6),c=r^s^a;return c<0&&(c+=4294967296),c}});var Mm=I((XS,wm)=>{"use strict";var xh=qr(),bm=Mh();function wi(){if(!(this instanceof wi))return new wi;bm.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}xh.inherits(wi,bm);wm.exports=wi;wi.blockSize=1024;wi.outSize=384;wi.hmacStrength=192;wi.padLength=128;wi.prototype._digest=function(t){return t==="hex"?xh.toHex32(this.h.slice(0,12),"big"):xh.split32(this.h.slice(0,12),"big")}});var xm=I(jn=>{"use strict";jn.sha1=hm();jn.sha224=pm();jn.sha256=gh();jn.sha384=Mm();jn.sha512=Mh()});var km=I(Em=>{"use strict";var rn=qr(),O5=Gn(),q0=rn.rotl32,_m=rn.sum32,Wa=rn.sum32_3,Sm=rn.sum32_4,Bm=O5.BlockHash;function ei(){if(!(this instanceof ei))return new ei;Bm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}rn.inherits(ei,Bm);Em.ripemd160=ei;ei.blockSize=512;ei.outSize=160;ei.hmacStrength=192;ei.padLength=64;ei.prototype._update=function(t,r){for(var s=this.h[0],a=this.h[1],c=this.h[2],g=this.h[3],b=this.h[4],w=s,_=a,S=c,A=g,q=b,R=0;R<80;R++){var N=_m(q0(Sm(s,Am(R,a,c,g),t[K5[R]+r],F5(R)),$5[R]),b);s=b,b=g,g=q0(c,10),c=a,a=N,N=_m(q0(Sm(w,Am(79-R,_,S,A),t[z5[R]+r],U5(R)),H5[R]),q),w=q,q=A,A=q0(S,10),S=_,_=N}N=Wa(this.h[1],c,A),this.h[1]=Wa(this.h[2],g,q),this.h[2]=Wa(this.h[3],b,w),this.h[3]=Wa(this.h[4],s,_),this.h[4]=Wa(this.h[0],a,S),this.h[0]=N};ei.prototype._digest=function(t){return t==="hex"?rn.toHex32(this.h,"little"):rn.split32(this.h,"little")};function Am(i,t,r,s){return i<=15?t^r^s:i<=31?t&r|~t&s:i<=47?(t|~r)^s:i<=63?t&s|r&~s:t^(r|~s)}function F5(i){return i<=15?0:i<=31?1518500249:i<=47?1859775393:i<=63?2400959708:2840853838}function U5(i){return i<=15?1352829926:i<=31?1548603684:i<=47?1836072691:i<=63?2053994217:0}var K5=[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],z5=[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],$5=[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],H5=[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]});var Im=I((tA,qm)=>{"use strict";var G5=qr(),Z5=ur();function Jn(i,t,r){if(!(this instanceof Jn))return new Jn(i,t,r);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(G5.toArray(t,r))}qm.exports=Jn;Jn.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),Z5(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};Jn.prototype.update=function(t,r){return this.inner.update(t,r),this};Jn.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var I0=I(Rm=>{"use strict";var He=Rm;He.utils=qr();He.common=Gn();He.sha=xm();He.ripemd=km();He.hmac=Im();He.sha1=He.sha.sha1;He.sha256=He.sha.sha256;He.sha224=He.sha.sha224;He.sha384=He.sha.sha384;He.sha512=He.sha.sha512;He.ripemd160=He.ripemd.ripemd160});var Pm=I((rA,Tm)=>{"use strict";Tm.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var R0=I(Nm=>{"use strict";var Sh=Nm,Pi=I0(),_h=ph(),W5=lr(),Cm=W5.assert;function Dm(i){i.type==="short"?this.curve=new _h.short(i):i.type==="edwards"?this.curve=new _h.edwards(i):this.curve=new _h.mont(i),this.g=this.curve.g,this.n=this.curve.n,this.hash=i.hash,Cm(this.g.validate(),"Invalid curve"),Cm(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Sh.PresetCurve=Dm;function Ci(i,t){Object.defineProperty(Sh,i,{configurable:!0,enumerable:!0,get:function(){var r=new Dm(t);return Object.defineProperty(Sh,i,{configurable:!0,enumerable:!0,value:r}),r}})}Ci("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:Pi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ci("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:Pi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ci("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:Pi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ci("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:Pi.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"]});Ci("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:Pi.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"]});Ci("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Pi.sha256,gRed:!1,g:["9"]});Ci("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:Pi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Ah;try{Ah=Pm()}catch{Ah=void 0}Ci("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:Pi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Ah]})});var Fm=I((nA,Om)=>{"use strict";var V5=I0(),nn=dh(),Lm=ur();function Di(i){if(!(this instanceof Di))return new Di(i);this.hash=i.hash,this.predResist=!!i.predResist,this.outLen=this.hash.outSize,this.minEntropy=i.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=nn.toArray(i.entropy,i.entropyEnc||"hex"),r=nn.toArray(i.nonce,i.nonceEnc||"hex"),s=nn.toArray(i.pers,i.persEnc||"hex");Lm(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,s)}Om.exports=Di;Di.prototype._init=function(t,r,s){var a=t.concat(r).concat(s);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c<this.V.length;c++)this.K[c]=0,this.V[c]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};Di.prototype._hmac=function(){return new V5.hmac(this.hash,this.K)};Di.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Di.prototype.reseed=function(t,r,s,a){typeof r!="string"&&(a=s,s=r,r=null),t=nn.toArray(t,r),s=nn.toArray(s,a),Lm(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(s||[])),this._reseed=1};Di.prototype.generate=function(t,r,s,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(a=s,s=r,r=null),s&&(s=nn.toArray(s,a||"hex"),this._update(s));for(var c=[];c.length<t;)this.V=this._hmac().update(this.V).digest(),c=c.concat(this.V);var g=c.slice(0,t);return this._update(s),this._reseed++,nn.encode(g,r)}});var Km=I((aA,Um)=>{"use strict";var j5=Vr(),J5=lr(),Bh=J5.assert;function tr(i,t){this.ec=i,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}Um.exports=tr;tr.fromPublic=function(t,r,s){return r instanceof tr?r:new tr(t,{pub:r,pubEnc:s})};tr.fromPrivate=function(t,r,s){return r instanceof tr?r:new tr(t,{priv:r,privEnc:s})};tr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};tr.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};tr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};tr.prototype._importPrivate=function(t,r){this.priv=new j5(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};tr.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?Bh(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Bh(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};tr.prototype.derive=function(t){return t.validate()||Bh(t.validate(),"public point not validated"),t.mul(this.priv).getX()};tr.prototype.sign=function(t,r,s){return this.ec.sign(t,this,r,s)};tr.prototype.verify=function(t,r,s){return this.ec.verify(t,r,this,void 0,s)};tr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var Hm=I((fA,$m)=>{"use strict";var T0=Vr(),qh=lr(),X5=qh.assert;function P0(i,t){if(i instanceof P0)return i;this._importDER(i,t)||(X5(i.r&&i.s,"Signature without r or s"),this.r=new T0(i.r,16),this.s=new T0(i.s,16),i.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=i.recoveryParam)}$m.exports=P0;function Y5(){this.place=0}function Eh(i,t){var r=i[t.place++];if(!(r&128))return r;var s=r&15;if(s===0||s>4||i[t.place]===0)return!1;for(var a=0,c=0,g=t.place;c<s;c++,g++)a<<=8,a|=i[g],a>>>=0;return a<=127?!1:(t.place=g,a)}function zm(i){for(var t=0,r=i.length-1;!i[t]&&!(i[t+1]&128)&&t<r;)t++;return t===0?i:i.slice(t)}P0.prototype._importDER=function(t,r){t=qh.toArray(t,r);var s=new Y5;if(t[s.place++]!==48)return!1;var a=Eh(t,s);if(a===!1||a+s.place!==t.length||t[s.place++]!==2)return!1;var c=Eh(t,s);if(c===!1||(t[s.place]&128)!==0)return!1;var g=t.slice(s.place,c+s.place);if(s.place+=c,t[s.place++]!==2)return!1;var b=Eh(t,s);if(b===!1||t.length!==b+s.place||(t[s.place]&128)!==0)return!1;var w=t.slice(s.place,b+s.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(w[0]===0)if(w[1]&128)w=w.slice(1);else return!1;return this.r=new T0(g),this.s=new T0(w),this.recoveryParam=null,!0};function kh(i,t){if(t<128){i.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(i.push(r|128);--r;)i.push(t>>>(r<<3)&255);i.push(t)}P0.prototype.toDER=function(t){var r=this.r.toArray(),s=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),s[0]&128&&(s=[0].concat(s)),r=zm(r),s=zm(s);!s[0]&&!(s[1]&128);)s=s.slice(1);var a=[2];kh(a,r.length),a=a.concat(r),a.push(2),kh(a,s.length);var c=a.concat(s),g=[48];return kh(g,c.length),g=g.concat(c),qh.encode(g,t)}});var Wm=I((oA,Zm)=>{"use strict";var Tr=Vr(),Gm=Fm(),Q5=lr(),Ih=R0(),tx=r0(),an=Q5.assert,Rh=Km(),C0=Hm();function xr(i){if(!(this instanceof xr))return new xr(i);typeof i=="string"&&(an(Object.prototype.hasOwnProperty.call(Ih,i),"Unknown curve "+i),i=Ih[i]),i instanceof Ih.PresetCurve&&(i={curve:i}),this.curve=i.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=i.curve.g,this.g.precompute(i.curve.n.bitLength()+1),this.hash=i.hash||i.curve.hash}Zm.exports=xr;xr.prototype.keyPair=function(t){return new Rh(this,t)};xr.prototype.keyFromPrivate=function(t,r){return Rh.fromPrivate(this,t,r)};xr.prototype.keyFromPublic=function(t,r){return Rh.fromPublic(this,t,r)};xr.prototype.genKeyPair=function(t){t||(t={});for(var r=new Gm({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||tx(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),s=this.n.byteLength(),a=this.n.sub(new Tr(2));;){var c=new Tr(r.generate(s));if(!(c.cmp(a)>0))return c.iaddn(1),this.keyFromPrivate(c)}};xr.prototype._truncateToN=function(t,r,s){var a;if(Tr.isBN(t)||typeof t=="number")t=new Tr(t,16),a=t.byteLength();else if(typeof t=="object")a=t.length,t=new Tr(t,16);else{var c=t.toString();a=c.length+1>>>1,t=new Tr(c,16)}typeof s!="number"&&(s=a*8);var g=s-this.n.bitLength();return g>0&&(t=t.ushrn(g)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};xr.prototype.sign=function(t,r,s,a){if(typeof s=="object"&&(a=s,s=null),a||(a={}),typeof t!="string"&&typeof t!="number"&&!Tr.isBN(t)){an(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),an(t.length>>>0===t.length);for(var c=0;c<t.length;c++)an((t[c]&255)===t[c])}r=this.keyFromPrivate(r,s),t=this._truncateToN(t,!1,a.msgBitLength),an(!t.isNeg(),"Can not sign a negative message");var g=this.n.byteLength(),b=r.getPrivate().toArray("be",g),w=t.toArray("be",g);an(new Tr(w).eq(t),"Can not sign message");for(var _=new Gm({hash:this.hash,entropy:b,nonce:w,pers:a.pers,persEnc:a.persEnc||"utf8"}),S=this.n.sub(new Tr(1)),A=0;;A++){var q=a.k?a.k(A):new Tr(_.generate(this.n.byteLength()));if(q=this._truncateToN(q,!0),!(q.cmpn(1)<=0||q.cmp(S)>=0)){var R=this.g.mul(q);if(!R.isInfinity()){var N=R.getX(),bt=N.umod(this.n);if(bt.cmpn(0)!==0){var _t=q.invm(this.n).mul(bt.mul(r.getPrivate()).iadd(t));if(_t=_t.umod(this.n),_t.cmpn(0)!==0){var gt=(R.getY().isOdd()?1:0)|(N.cmp(bt)!==0?2:0);return a.canonical&&_t.cmp(this.nh)>0&&(_t=this.n.sub(_t),gt^=1),new C0({r:bt,s:_t,recoveryParam:gt})}}}}}};xr.prototype.verify=function(t,r,s,a,c){c||(c={}),t=this._truncateToN(t,!1,c.msgBitLength),s=this.keyFromPublic(s,a),r=new C0(r,"hex");var g=r.r,b=r.s;if(g.cmpn(1)<0||g.cmp(this.n)>=0||b.cmpn(1)<0||b.cmp(this.n)>=0)return!1;var w=b.invm(this.n),_=w.mul(t).umod(this.n),S=w.mul(g).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(_,s.getPublic(),S),A.isInfinity()?!1:A.eqXToP(g)):(A=this.g.mulAdd(_,s.getPublic(),S),A.isInfinity()?!1:A.getX().umod(this.n).cmp(g)===0)};xr.prototype.recoverPubKey=function(i,t,r,s){an((3&r)===r,"The recovery param is more than two bits"),t=new C0(t,s);var a=this.n,c=new Tr(i),g=t.r,b=t.s,w=r&1,_=r>>1;if(g.cmp(this.curve.p.umod(this.curve.n))>=0&&_)throw new Error("Unable to find sencond key candinate");_?g=this.curve.pointFromX(g.add(this.curve.n),w):g=this.curve.pointFromX(g,w);var S=t.r.invm(a),A=a.sub(c).mul(S).umod(a),q=b.mul(S).umod(a);return this.g.mulAdd(A,g,q)};xr.prototype.getKeyRecoveryParam=function(i,t,r,s){if(t=new C0(t,s),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(i,t,a)}catch{continue}if(c.eq(r))return a}throw new Error("Unable to find valid recovery factor")}});var Xm=I((sA,Jm)=>{"use strict";var Va=lr(),jm=Va.assert,Vm=Va.parseBytes,Xn=Va.cachedProperty;function Ue(i,t){this.eddsa=i,this._secret=Vm(t.secret),i.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Vm(t.pub)}Ue.fromPublic=function(t,r){return r instanceof Ue?r:new Ue(t,{pub:r})};Ue.fromSecret=function(t,r){return r instanceof Ue?r:new Ue(t,{secret:r})};Ue.prototype.secret=function(){return this._secret};Xn(Ue,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Xn(Ue,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Xn(Ue,"privBytes",function(){var t=this.eddsa,r=this.hash(),s=t.encodingLength-1,a=r.slice(0,t.encodingLength);return a[0]&=248,a[s]&=127,a[s]|=64,a});Xn(Ue,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Xn(Ue,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Xn(Ue,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Ue.prototype.sign=function(t){return jm(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};Ue.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};Ue.prototype.getSecret=function(t){return jm(this._secret,"KeyPair is public only"),Va.encode(this.secret(),t)};Ue.prototype.getPublic=function(t){return Va.encode(this.pubBytes(),t)};Jm.exports=Ue});var t2=I((hA,Qm)=>{"use strict";var ex=Vr(),D0=lr(),Ym=D0.assert,N0=D0.cachedProperty,rx=D0.parseBytes;function fn(i,t){this.eddsa=i,typeof t!="object"&&(t=rx(t)),Array.isArray(t)&&(Ym(t.length===i.encodingLength*2,"Signature has invalid size"),t={R:t.slice(0,i.encodingLength),S:t.slice(i.encodingLength)}),Ym(t.R&&t.S,"Signature without R or S"),i.isPoint(t.R)&&(this._R=t.R),t.S instanceof ex&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}N0(fn,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});N0(fn,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});N0(fn,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});N0(fn,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});fn.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};fn.prototype.toHex=function(){return D0.encode(this.toBytes(),"hex").toUpperCase()};Qm.exports=fn});var a2=I((uA,n2)=>{"use strict";var ix=I0(),nx=R0(),Yn=lr(),ax=Yn.assert,r2=Yn.parseBytes,i2=Xm(),e2=t2();function or(i){if(ax(i==="ed25519","only tested with ed25519 so far"),!(this instanceof or))return new or(i);i=nx[i].curve,this.curve=i,this.g=i.g,this.g.precompute(i.n.bitLength()+1),this.pointClass=i.point().constructor,this.encodingLength=Math.ceil(i.n.bitLength()/8),this.hash=ix.sha512}n2.exports=or;or.prototype.sign=function(t,r){t=r2(t);var s=this.keyFromSecret(r),a=this.hashInt(s.messagePrefix(),t),c=this.g.mul(a),g=this.encodePoint(c),b=this.hashInt(g,s.pubBytes(),t).mul(s.priv()),w=a.add(b).umod(this.curve.n);return this.makeSignature({R:c,S:w,Rencoded:g})};or.prototype.verify=function(t,r,s){if(t=r2(t),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var a=this.keyFromPublic(s),c=this.hashInt(r.Rencoded(),a.pubBytes(),t),g=this.g.mul(r.S()),b=r.R().add(a.pub().mul(c));return b.eq(g)};or.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return Yn.intFromLE(t.digest()).umod(this.curve.n)};or.prototype.keyFromPublic=function(t){return i2.fromPublic(this,t)};or.prototype.keyFromSecret=function(t){return i2.fromSecret(this,t)};or.prototype.makeSignature=function(t){return t instanceof e2?t:new e2(this,t)};or.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};or.prototype.decodePoint=function(t){t=Yn.parseBytes(t);var r=t.length-1,s=t.slice(0,r).concat(t[r]&-129),a=(t[r]&128)!==0,c=Yn.intFromLE(s);return this.curve.pointFromY(c,a)};or.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};or.prototype.decodeInt=function(t){return Yn.intFromLE(t)};or.prototype.isPoint=function(t){return t instanceof this.pointClass}});var L0=I(f2=>{"use strict";var on=f2;on.version=Lv().version;on.utils=lr();on.rand=r0();on.curve=ph();on.curves=R0();on.ec=Wm();on.eddsa=a2()});var s2=I((o2,Th)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof Th>"u"||Th,o2)});var l2=I(u2=>{"use strict";var h2=ta(),fx=Rt(),ox=u2;ox.define=function(t,r){return new Qn(t,r)};function Qn(i,t){this.name=i,this.body=t,this.decoders={},this.encoders={}}Qn.prototype._createNamed=function(t){var r;try{r=ty("vm").runInThisContext("(function "+this.name+`(entity) {
3
- this._initNamed(entity);
4
- })`)}catch{r=function(a){this._initNamed(a)}}return fx(r,t),r.prototype._initNamed=function(a){t.call(this,a)},new r(this)};Qn.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(h2.decoders[t])),this.decoders[t]};Qn.prototype.decode=function(t,r,s){return this._getDecoder(r).decode(t,s)};Qn.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(h2.encoders[t])),this.encoders[t]};Qn.prototype.encode=function(t,r,s){return this._getEncoder(r).encode(t,s)}});var c2=I(d2=>{"use strict";var sx=Rt();function _r(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}d2.Reporter=_r;_r.prototype.isError=function(t){return t instanceof ea};_r.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}};_r.prototype.restore=function(t){var r=this._reporterState;r.obj=t.obj,r.path=r.path.slice(0,t.pathLen)};_r.prototype.enterKey=function(t){return this._reporterState.path.push(t)};_r.prototype.exitKey=function(t){var r=this._reporterState;r.path=r.path.slice(0,t-1)};_r.prototype.leaveKey=function(t,r,s){var a=this._reporterState;this.exitKey(t),a.obj!==null&&(a.obj[r]=s)};_r.prototype.path=function(){return this._reporterState.path.join("/")};_r.prototype.enterObject=function(){var t=this._reporterState,r=t.obj;return t.obj={},r};_r.prototype.leaveObject=function(t){var r=this._reporterState,s=r.obj;return r.obj=t,s};_r.prototype.error=function(t){var r,s=this._reporterState,a=t instanceof ea;if(a?r=t:r=new ea(s.path.map(function(c){return"["+JSON.stringify(c)+"]"}).join(""),t.message||t,t.stack),!s.options.partial)throw r;return a||s.errors.push(r),r};_r.prototype.wrapResult=function(t){var r=this._reporterState;return r.options.partial?{result:this.isError(t)?null:t,errors:r.errors}:t};function ea(i,t){this.path=i,this.rethrow(t)}sx(ea,Error);ea.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ea),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}});var Ch=I(Ph=>{"use strict";var hx=Rt(),F0=ra().Reporter,ja=ai().Buffer;function ri(i,t){if(F0.call(this,t),!ja.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}hx(ri,F0);Ph.DecoderBuffer=ri;ri.prototype.save=function(){return{offset:this.offset,reporter:F0.prototype.save.call(this)}};ri.prototype.restore=function(t){var r=new ri(this.base);return r.offset=t.offset,r.length=this.offset,this.offset=t.offset,F0.prototype.restore.call(this,t.reporter),r};ri.prototype.isEmpty=function(){return this.offset===this.length};ri.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")};ri.prototype.skip=function(t,r){if(!(this.offset+t<=this.length))return this.error(r||"DecoderBuffer overrun");var s=new ri(this.base);return s._reporterState=this._reporterState,s.offset=this.offset,s.length=this.offset+t,this.offset+=t,s};ri.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)};function O0(i,t){if(Array.isArray(i))this.length=0,this.value=i.map(function(r){return r instanceof O0||(r=new O0(r,t)),this.length+=r.length,r},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return t.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=ja.byteLength(i);else if(ja.isBuffer(i))this.value=i,this.length=i.length;else return t.error("Unsupported type: "+typeof i)}Ph.EncoderBuffer=O0;O0.prototype.join=function(t,r){return t||(t=new ja(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(s){s.join(t,r),r+=s.length}):(typeof this.value=="number"?t[r]=this.value:typeof this.value=="string"?t.write(this.value,r):ja.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}});var m2=I((vA,v2)=>{"use strict";var ux=ra().Reporter,lx=ra().EncoderBuffer,dx=ra().DecoderBuffer,ir=ur(),p2=["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"],cx=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(p2),px=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Gt(i,t){var r={};this._baseState=r,r.enc=i,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}v2.exports=Gt;var vx=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Gt.prototype.clone=function(){var t=this._baseState,r={};vx.forEach(function(a){r[a]=t[a]});var s=new this.constructor(r.parent);return s._baseState=r,s};Gt.prototype._wrap=function(){var t=this._baseState;cx.forEach(function(r){this[r]=function(){var a=new this.constructor(this);return t.children.push(a),a[r].apply(a,arguments)}},this)};Gt.prototype._init=function(t){var r=this._baseState;ir(r.parent===null),t.call(this),r.children=r.children.filter(function(s){return s._baseState.parent===this},this),ir.equal(r.children.length,1,"Root node can have only one child")};Gt.prototype._useArgs=function(t){var r=this._baseState,s=t.filter(function(a){return a instanceof this.constructor},this);t=t.filter(function(a){return!(a instanceof this.constructor)},this),s.length!==0&&(ir(r.children===null),r.children=s,s.forEach(function(a){a._baseState.parent=this},this)),t.length!==0&&(ir(r.args===null),r.args=t,r.reverseArgs=t.map(function(a){if(typeof a!="object"||a.constructor!==Object)return a;var c={};return Object.keys(a).forEach(function(g){g==(g|0)&&(g|=0);var b=a[g];c[b]=g}),c}))};px.forEach(function(i){Gt.prototype[i]=function(){var r=this._baseState;throw new Error(i+" not implemented for encoding: "+r.enc)}});p2.forEach(function(i){Gt.prototype[i]=function(){var r=this._baseState,s=Array.prototype.slice.call(arguments);return ir(r.tag===null),r.tag=i,this._useArgs(s),this}});Gt.prototype.use=function(t){ir(t);var r=this._baseState;return ir(r.use===null),r.use=t,this};Gt.prototype.optional=function(){var t=this._baseState;return t.optional=!0,this};Gt.prototype.def=function(t){var r=this._baseState;return ir(r.default===null),r.default=t,r.optional=!0,this};Gt.prototype.explicit=function(t){var r=this._baseState;return ir(r.explicit===null&&r.implicit===null),r.explicit=t,this};Gt.prototype.implicit=function(t){var r=this._baseState;return ir(r.explicit===null&&r.implicit===null),r.implicit=t,this};Gt.prototype.obj=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return t.obj=!0,r.length!==0&&this._useArgs(r),this};Gt.prototype.key=function(t){var r=this._baseState;return ir(r.key===null),r.key=t,this};Gt.prototype.any=function(){var t=this._baseState;return t.any=!0,this};Gt.prototype.choice=function(t){var r=this._baseState;return ir(r.choice===null),r.choice=t,this._useArgs(Object.keys(t).map(function(s){return t[s]})),this};Gt.prototype.contains=function(t){var r=this._baseState;return ir(r.use===null),r.contains=t,this};Gt.prototype._decode=function(t,r){var s=this._baseState;if(s.parent===null)return t.wrapResult(s.children[0]._decode(t,r));var a=s.default,c=!0,g=null;if(s.key!==null&&(g=t.enterKey(s.key)),s.optional){var b=null;if(s.explicit!==null?b=s.explicit:s.implicit!==null?b=s.implicit:s.tag!==null&&(b=s.tag),b===null&&!s.any){var w=t.save();try{s.choice===null?this._decodeGeneric(s.tag,t,r):this._decodeChoice(t,r),c=!0}catch{c=!1}t.restore(w)}else if(c=this._peekTag(t,b,s.any),t.isError(c))return c}var _;if(s.obj&&c&&(_=t.enterObject()),c){if(s.explicit!==null){var S=this._decodeTag(t,s.explicit);if(t.isError(S))return S;t=S}var A=t.offset;if(s.use===null&&s.choice===null){if(s.any)var w=t.save();var q=this._decodeTag(t,s.implicit!==null?s.implicit:s.tag,s.any);if(t.isError(q))return q;s.any?a=t.raw(w):t=q}if(r&&r.track&&s.tag!==null&&r.track(t.path(),A,t.length,"tagged"),r&&r.track&&s.tag!==null&&r.track(t.path(),t.offset,t.length,"content"),s.any?a=a:s.choice===null?a=this._decodeGeneric(s.tag,t,r):a=this._decodeChoice(t,r),t.isError(a))return a;if(!s.any&&s.choice===null&&s.children!==null&&s.children.forEach(function(bt){bt._decode(t,r)}),s.contains&&(s.tag==="octstr"||s.tag==="bitstr")){var R=new dx(a);a=this._getUse(s.contains,t._reporterState.obj)._decode(R,r)}}return s.obj&&c&&(a=t.leaveObject(_)),s.key!==null&&(a!==null||c===!0)?t.leaveKey(g,s.key,a):g!==null&&t.exitKey(g),a};Gt.prototype._decodeGeneric=function(t,r,s){var a=this._baseState;return t==="seq"||t==="set"?null:t==="seqof"||t==="setof"?this._decodeList(r,t,a.args[0],s):/str$/.test(t)?this._decodeStr(r,t,s):t==="objid"&&a.args?this._decodeObjid(r,a.args[0],a.args[1],s):t==="objid"?this._decodeObjid(r,null,null,s):t==="gentime"||t==="utctime"?this._decodeTime(r,t,s):t==="null_"?this._decodeNull(r,s):t==="bool"?this._decodeBool(r,s):t==="objDesc"?this._decodeStr(r,t,s):t==="int"||t==="enum"?this._decodeInt(r,a.args&&a.args[0],s):a.use!==null?this._getUse(a.use,r._reporterState.obj)._decode(r,s):r.error("unknown tag: "+t)};Gt.prototype._getUse=function(t,r){var s=this._baseState;return s.useDecoder=this._use(t,r),ir(s.useDecoder._baseState.parent===null),s.useDecoder=s.useDecoder._baseState.children[0],s.implicit!==s.useDecoder._baseState.implicit&&(s.useDecoder=s.useDecoder.clone(),s.useDecoder._baseState.implicit=s.implicit),s.useDecoder};Gt.prototype._decodeChoice=function(t,r){var s=this._baseState,a=null,c=!1;return Object.keys(s.choice).some(function(g){var b=t.save(),w=s.choice[g];try{var _=w._decode(t,r);if(t.isError(_))return!1;a={type:g,value:_},c=!0}catch{return t.restore(b),!1}return!0},this),c?a:t.error("Choice not matched")};Gt.prototype._createEncoderBuffer=function(t){return new lx(t,this.reporter)};Gt.prototype._encode=function(t,r,s){var a=this._baseState;if(!(a.default!==null&&a.default===t)){var c=this._encodeValue(t,r,s);if(c!==void 0&&!this._skipDefault(c,r,s))return c}};Gt.prototype._encodeValue=function(t,r,s){var a=this._baseState;if(a.parent===null)return a.children[0]._encode(t,r||new ux);var w=null;if(this.reporter=r,a.optional&&t===void 0)if(a.default!==null)t=a.default;else return;var c=null,g=!1;if(a.any)w=this._createEncoderBuffer(t);else if(a.choice)w=this._encodeChoice(t,r);else if(a.contains)c=this._getUse(a.contains,s)._encode(t,r),g=!0;else if(a.children)c=a.children.map(function(A){if(A._baseState.tag==="null_")return A._encode(null,r,t);if(A._baseState.key===null)return r.error("Child should have a key");var q=r.enterKey(A._baseState.key);if(typeof t!="object")return r.error("Child expected, but input is not object");var R=A._encode(t[A._baseState.key],r,t);return r.leaveKey(q),R},this).filter(function(A){return A}),c=this._createEncoderBuffer(c);else if(a.tag==="seqof"||a.tag==="setof"){if(!(a.args&&a.args.length===1))return r.error("Too many args for : "+a.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");var b=this.clone();b._baseState.implicit=null,c=this._createEncoderBuffer(t.map(function(A){var q=this._baseState;return this._getUse(q.args[0],t)._encode(A,r)},b))}else a.use!==null?w=this._getUse(a.use,s)._encode(t,r):(c=this._encodePrimitive(a.tag,t),g=!0);var w;if(!a.any&&a.choice===null){var _=a.implicit!==null?a.implicit:a.tag,S=a.implicit===null?"universal":"context";_===null?a.use===null&&r.error("Tag could be omitted only for .use()"):a.use===null&&(w=this._encodeComposite(_,g,S,c))}return a.explicit!==null&&(w=this._encodeComposite(a.explicit,!1,"context",w)),w};Gt.prototype._encodeChoice=function(t,r){var s=this._baseState,a=s.choice[t.type];return a||ir(!1,t.type+" not found in "+JSON.stringify(Object.keys(s.choice))),a._encode(t.value,r)};Gt.prototype._encodePrimitive=function(t,r){var s=this._baseState;if(/str$/.test(t))return this._encodeStr(r,t);if(t==="objid"&&s.args)return this._encodeObjid(r,s.reverseArgs[0],s.args[1]);if(t==="objid")return this._encodeObjid(r,null,null);if(t==="gentime"||t==="utctime")return this._encodeTime(r,t);if(t==="null_")return this._encodeNull();if(t==="int"||t==="enum")return this._encodeInt(r,s.args&&s.reverseArgs[0]);if(t==="bool")return this._encodeBool(r);if(t==="objDesc")return this._encodeStr(r,t);throw new Error("Unsupported tag: "+t)};Gt.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)};Gt.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}});var ra=I(g2=>{"use strict";var U0=g2;U0.Reporter=c2().Reporter;U0.DecoderBuffer=Ch().DecoderBuffer;U0.EncoderBuffer=Ch().EncoderBuffer;U0.Node=m2()});var b2=I(sn=>{"use strict";var y2=Dh();sn.tagClass={0:"universal",1:"application",2:"context",3:"private"};sn.tagClassByName=y2._reverse(sn.tagClass);sn.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"};sn.tagByName=y2._reverse(sn.tag)});var Dh=I(M2=>{"use strict";var w2=M2;w2._reverse=function(t){var r={};return Object.keys(t).forEach(function(s){(s|0)==s&&(s=s|0);var a=t[s];r[a]=s}),r};w2.der=b2()});var Oh=I((bA,A2)=>{"use strict";var mx=Rt(),Nh=ta(),K0=Nh.base,gx=Nh.bignum,x2=Nh.constants.der;function _2(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new dr,this.tree._init(i.body)}A2.exports=_2;_2.prototype.decode=function(t,r){return t instanceof K0.DecoderBuffer||(t=new K0.DecoderBuffer(t,r)),this.tree._decode(t,r)};function dr(i){K0.Node.call(this,"der",i)}mx(dr,K0.Node);dr.prototype._peekTag=function(t,r,s){if(t.isEmpty())return!1;var a=t.save(),c=Lh(t,'Failed to peek tag: "'+r+'"');return t.isError(c)?c:(t.restore(a),c.tag===r||c.tagStr===r||c.tagStr+"of"===r||s)};dr.prototype._decodeTag=function(t,r,s){var a=Lh(t,'Failed to decode tag of "'+r+'"');if(t.isError(a))return a;var c=S2(t,a.primitive,'Failed to get length of "'+r+'"');if(t.isError(c))return c;if(!s&&a.tag!==r&&a.tagStr!==r&&a.tagStr+"of"!==r)return t.error('Failed to match tag: "'+r+'"');if(a.primitive||c!==null)return t.skip(c,'Failed to match body of: "'+r+'"');var g=t.save(),b=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(b)?b:(c=t.offset-g.offset,t.restore(g),t.skip(c,'Failed to match body of: "'+r+'"'))};dr.prototype._skipUntilEnd=function(t,r){for(;;){var s=Lh(t,r);if(t.isError(s))return s;var a=S2(t,s.primitive,r);if(t.isError(a))return a;var c;if(s.primitive||a!==null?c=t.skip(a):c=this._skipUntilEnd(t,r),t.isError(c))return c;if(s.tagStr==="end")break}};dr.prototype._decodeList=function(t,r,s,a){for(var c=[];!t.isEmpty();){var g=this._peekTag(t,"end");if(t.isError(g))return g;var b=s.decode(t,"der",a);if(t.isError(b)&&g)break;c.push(b)}return c};dr.prototype._decodeStr=function(t,r){if(r==="bitstr"){var s=t.readUInt8();return t.isError(s)?s:{unused:s,data:t.raw()}}else if(r==="bmpstr"){var a=t.raw();if(a.length%2===1)return t.error("Decoding of string type: bmpstr length mismatch");for(var c="",g=0;g<a.length/2;g++)c+=String.fromCharCode(a.readUInt16BE(g*2));return c}else if(r==="numstr"){var b=t.raw().toString("ascii");return this._isNumstr(b)?b:t.error("Decoding of string type: numstr unsupported characters")}else{if(r==="octstr")return t.raw();if(r==="objDesc")return t.raw();if(r==="printstr"){var w=t.raw().toString("ascii");return this._isPrintstr(w)?w:t.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(r)?t.raw().toString():t.error("Decoding of string type: "+r+" unsupported")}};dr.prototype._decodeObjid=function(t,r,s){for(var a,c=[],g=0;!t.isEmpty();){var b=t.readUInt8();g<<=7,g|=b&127,(b&128)===0&&(c.push(g),g=0)}b&128&&c.push(g);var w=c[0]/40|0,_=c[0]%40;if(s?a=c:a=[w,_].concat(c.slice(1)),r){var S=r[a.join(" ")];S===void 0&&(S=r[a.join(".")]),S!==void 0&&(a=S)}return a};dr.prototype._decodeTime=function(t,r){var s=t.raw().toString();if(r==="gentime")var a=s.slice(0,4)|0,c=s.slice(4,6)|0,g=s.slice(6,8)|0,b=s.slice(8,10)|0,w=s.slice(10,12)|0,_=s.slice(12,14)|0;else if(r==="utctime"){var a=s.slice(0,2)|0,c=s.slice(2,4)|0,g=s.slice(4,6)|0,b=s.slice(6,8)|0,w=s.slice(8,10)|0,_=s.slice(10,12)|0;a<70?a=2e3+a:a=1900+a}else return t.error("Decoding "+r+" time is not supported yet");return Date.UTC(a,c-1,g,b,w,_,0)};dr.prototype._decodeNull=function(t){return null};dr.prototype._decodeBool=function(t){var r=t.readUInt8();return t.isError(r)?r:r!==0};dr.prototype._decodeInt=function(t,r){var s=t.raw(),a=new gx(s);return r&&(a=r[a.toString(10)]||a),a};dr.prototype._use=function(t,r){return typeof t=="function"&&(t=t(r)),t._getDecoder("der").tree};function Lh(i,t){var r=i.readUInt8(t);if(i.isError(r))return r;var s=x2.tagClass[r>>6],a=(r&32)===0;if((r&31)===31){var c=r;for(r=0;(c&128)===128;){if(c=i.readUInt8(t),i.isError(c))return c;r<<=7,r|=c&127}}else r&=31;var g=x2.tag[r];return{cls:s,primitive:a,tag:r,tagStr:g}}function S2(i,t,r){var s=i.readUInt8(r);if(i.isError(s))return s;if(!t&&s===128)return null;if((s&128)===0)return s;var a=s&127;if(a>4)return i.error("length octect is too long");s=0;for(var c=0;c<a;c++){s<<=8;var g=i.readUInt8(r);if(i.isError(g))return g;s|=g}return s}});var E2=I((wA,B2)=>{"use strict";var yx=Rt(),bx=ai().Buffer,Fh=Oh();function Uh(i){Fh.call(this,i),this.enc="pem"}yx(Uh,Fh);B2.exports=Uh;Uh.prototype.decode=function(t,r){for(var s=t.toString().split(/[\r\n]+/g),a=r.label.toUpperCase(),c=/^-----(BEGIN|END) ([^-]+)-----$/,g=-1,b=-1,w=0;w<s.length;w++){var _=s[w].match(c);if(_!==null&&_[2]===a)if(g===-1){if(_[1]!=="BEGIN")break;g=w}else{if(_[1]!=="END")break;b=w;break}}if(g===-1||b===-1)throw new Error("PEM section not found for: "+a);var S=s.slice(g+1,b).join("");S.replace(/[^a-z0-9\+\/=]+/gi,"");var A=new bx(S,"base64");return Fh.prototype.decode.call(this,A,r)}});var I2=I(q2=>{"use strict";var k2=q2;k2.der=Oh();k2.pem=E2()});var zh=I((xA,C2)=>{"use strict";var wx=Rt(),Mi=ai().Buffer,R2=ta(),T2=R2.base,Kh=R2.constants.der;function P2(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new Pr,this.tree._init(i.body)}C2.exports=P2;P2.prototype.encode=function(t,r){return this.tree._encode(t,r).join()};function Pr(i){T2.Node.call(this,"der",i)}wx(Pr,T2.Node);Pr.prototype._encodeComposite=function(t,r,s,a){var c=Mx(t,r,s,this.reporter);if(a.length<128){var w=new Mi(2);return w[0]=c,w[1]=a.length,this._createEncoderBuffer([w,a])}for(var g=1,b=a.length;b>=256;b>>=8)g++;var w=new Mi(2+g);w[0]=c,w[1]=128|g;for(var b=1+g,_=a.length;_>0;b--,_>>=8)w[b]=_&255;return this._createEncoderBuffer([w,a])};Pr.prototype._encodeStr=function(t,r){if(r==="bitstr")return this._createEncoderBuffer([t.unused|0,t.data]);if(r==="bmpstr"){for(var s=new Mi(t.length*2),a=0;a<t.length;a++)s.writeUInt16BE(t.charCodeAt(a),a*2);return this._createEncoderBuffer(s)}else return r==="numstr"?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):r==="printstr"?this._isPrintstr(t)?this._createEncoderBuffer(t):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(r)?this._createEncoderBuffer(t):r==="objDesc"?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+r+" unsupported")};Pr.prototype._encodeObjid=function(t,r,s){if(typeof t=="string"){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=r[t].split(/[\s\.]+/g);for(var a=0;a<t.length;a++)t[a]|=0}else if(Array.isArray(t)){t=t.slice();for(var a=0;a<t.length;a++)t[a]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!s){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,t[0]*40+t[1])}for(var c=0,a=0;a<t.length;a++){var g=t[a];for(c++;g>=128;g>>=7)c++}for(var b=new Mi(c),w=b.length-1,a=t.length-1;a>=0;a--){var g=t[a];for(b[w--]=g&127;(g>>=7)>0;)b[w--]=128|g&127}return this._createEncoderBuffer(b)};function Sr(i){return i<10?"0"+i:i}Pr.prototype._encodeTime=function(t,r){var s,a=new Date(t);return r==="gentime"?s=[Sr(a.getFullYear()),Sr(a.getUTCMonth()+1),Sr(a.getUTCDate()),Sr(a.getUTCHours()),Sr(a.getUTCMinutes()),Sr(a.getUTCSeconds()),"Z"].join(""):r==="utctime"?s=[Sr(a.getFullYear()%100),Sr(a.getUTCMonth()+1),Sr(a.getUTCDate()),Sr(a.getUTCHours()),Sr(a.getUTCMinutes()),Sr(a.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(s,"octstr")};Pr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Pr.prototype._encodeInt=function(t,r){if(typeof t=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=r[t]}if(typeof t!="number"&&!Mi.isBuffer(t)){var s=t.toArray();!t.sign&&s[0]&128&&s.unshift(0),t=new Mi(s)}if(Mi.isBuffer(t)){var a=t.length;t.length===0&&a++;var g=new Mi(a);return t.copy(g),t.length===0&&(g[0]=0),this._createEncoderBuffer(g)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,c=t;c>=256;c>>=8)a++;for(var g=new Array(a),c=g.length-1;c>=0;c--)g[c]=t&255,t>>=8;return g[0]&128&&g.unshift(0),this._createEncoderBuffer(new Mi(g))};Pr.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)};Pr.prototype._use=function(t,r){return typeof t=="function"&&(t=t(r)),t._getEncoder("der").tree};Pr.prototype._skipDefault=function(t,r,s){var a=this._baseState,c;if(a.default===null)return!1;var g=t.join();if(a.defaultBuffer===void 0&&(a.defaultBuffer=this._encodeValue(a.default,r,s).join()),g.length!==a.defaultBuffer.length)return!1;for(c=0;c<g.length;c++)if(g[c]!==a.defaultBuffer[c])return!1;return!0};function Mx(i,t,r,s){var a;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),Kh.tagByName.hasOwnProperty(i))a=Kh.tagByName[i];else if(typeof i=="number"&&(i|0)===i)a=i;else return s.error("Unknown tag: "+i);return a>=31?s.error("Multi-octet tag encoding unsupported"):(t||(a|=32),a|=Kh.tagClassByName[r||"universal"]<<6,a)}});var N2=I((_A,D2)=>{"use strict";var xx=Rt(),$h=zh();function Hh(i){$h.call(this,i),this.enc="pem"}xx(Hh,$h);D2.exports=Hh;Hh.prototype.encode=function(t,r){for(var s=$h.prototype.encode.call(this,t),a=s.toString("base64"),c=["-----BEGIN "+r.label+"-----"],g=0;g<a.length;g+=64)c.push(a.slice(g,g+64));return c.push("-----END "+r.label+"-----"),c.join(`
5
- `)}});var F2=I(O2=>{"use strict";var L2=O2;L2.der=zh();L2.pem=N2()});var ta=I(U2=>{"use strict";var ia=U2;ia.bignum=s2();ia.define=l2().define;ia.base=ra();ia.constants=Dh();ia.decoders=I2();ia.encoders=F2()});var H2=I((BA,$2)=>{"use strict";var Cr=ta(),K2=Cr.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),_x=Cr.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Gh=Cr.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Sx=Cr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Gh),this.key("subjectPublicKey").bitstr())}),Ax=Cr.define("RelativeDistinguishedName",function(){this.setof(_x)}),Bx=Cr.define("RDNSequence",function(){this.seqof(Ax)}),z2=Cr.define("Name",function(){this.choice({rdnSequence:this.use(Bx)})}),Ex=Cr.define("Validity",function(){this.seq().obj(this.key("notBefore").use(K2),this.key("notAfter").use(K2))}),kx=Cr.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),qx=Cr.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Gh),this.key("issuer").use(z2),this.key("validity").use(Ex),this.key("subject").use(z2),this.key("subjectPublicKeyInfo").use(Sx),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(kx).optional())}),Ix=Cr.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(qx),this.key("signatureAlgorithm").use(Gh),this.key("signatureValue").bitstr())});$2.exports=Ix});var Z2=I(Nr=>{"use strict";var Dr=ta();Nr.certificate=H2();var Rx=Dr.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())});Nr.RSAPrivateKey=Rx;var Tx=Dr.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Nr.RSAPublicKey=Tx;var G2=Dr.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())}),Px=Dr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(G2),this.key("subjectPublicKey").bitstr())});Nr.PublicKey=Px;var Cx=Dr.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(G2),this.key("subjectPrivateKey").octstr())});Nr.PrivateKey=Cx;var Dx=Dr.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())});Nr.EncryptedPrivateKey=Dx;var Nx=Dr.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())});Nr.DSAPrivateKey=Nx;Nr.DSAparam=Dr.define("DSAparam",function(){this.int()});var Lx=Dr.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),Ox=Dr.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(Lx),this.key("publicKey").optional().explicit(1).bitstr())});Nr.ECPrivateKey=Ox;Nr.signature=Dr.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})});var W2=I((kA,Fx)=>{Fx.exports={"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 j2=I((qA,V2)=>{"use strict";var Ux=/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,Kx=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,zx=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,$x=Ca(),Hx=e0(),z0=It().Buffer;V2.exports=function(i,t){var r=i.toString(),s=r.match(Ux),a;if(s){var g="aes"+s[1],b=z0.from(s[2],"hex"),w=z0.from(s[3].replace(/[\r\n]/g,""),"base64"),_=$x(t,b.slice(0,8),parseInt(s[1],10)).key,S=[],A=Hx.createDecipheriv(g,_,b);S.push(A.update(w)),S.push(A.final()),a=z0.concat(S)}else{var c=r.match(zx);a=z0.from(c[2].replace(/[\r\n]/g,""),"base64")}var q=r.match(Kx)[1];return{tag:q,data:a}}});var Ja=I((IA,X2)=>{"use strict";var sr=Z2(),Gx=W2(),Zx=j2(),Wx=e0(),Vx=us(),Zh=It().Buffer;function jx(i,t){var r=i.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(i.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=Gx[i.algorithm.decrypt.cipher.algo.join(".")],c=i.algorithm.decrypt.cipher.iv,g=i.subjectPrivateKey,b=parseInt(a.split("-")[1],10)/8,w=Vx.pbkdf2Sync(t,r,s,b,"sha1"),_=Wx.createDecipheriv(a,w,c),S=[];return S.push(_.update(g)),S.push(_.final()),Zh.concat(S)}function J2(i){var t;typeof i=="object"&&!Zh.isBuffer(i)&&(t=i.passphrase,i=i.key),typeof i=="string"&&(i=Zh.from(i));var r=Zx(i,t),s=r.tag,a=r.data,c,g;switch(s){case"CERTIFICATE":g=sr.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(g||(g=sr.PublicKey.decode(a,"der")),c=g.algorithm.algorithm.join("."),c){case"1.2.840.113549.1.1.1":return sr.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=sr.DSAparam.decode(g.subjectPublicKey.data,"der"),{type:"dsa",data:g.algorithm.params};default:throw new Error("unknown key id "+c)}case"ENCRYPTED PRIVATE KEY":a=sr.EncryptedPrivateKey.decode(a,"der"),a=jx(a,t);case"PRIVATE KEY":switch(g=sr.PrivateKey.decode(a,"der"),c=g.algorithm.algorithm.join("."),c){case"1.2.840.113549.1.1.1":return sr.RSAPrivateKey.decode(g.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:g.algorithm.curve,privateKey:sr.ECPrivateKey.decode(g.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return g.algorithm.params.priv_key=sr.DSAparam.decode(g.subjectPrivateKey,"der"),{type:"dsa",params:g.algorithm.params};default:throw new Error("unknown key id "+c)}case"RSA PUBLIC KEY":return sr.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return sr.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:sr.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return a=sr.ECPrivateKey.decode(a,"der"),{curve:a.parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+s)}}J2.signature=sr.signature;X2.exports=J2});var Wh=I((RA,Jx)=>{Jx.exports={"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 tg=I((TA,H0)=>{"use strict";var er=It().Buffer,hn=Co(),Xx=w0(),Yx=L0().ec,$0=b0(),Qx=Ja(),t7=Wh(),e7=1;function r7(i,t,r,s,a){var c=Qx(t);if(c.curve){if(s!=="ecdsa"&&s!=="ecdsa/rsa")throw new Error("wrong private key type");return i7(i,c)}else if(c.type==="dsa"){if(s!=="dsa")throw new Error("wrong private key type");return n7(i,c,r)}if(s!=="rsa"&&s!=="ecdsa/rsa")throw new Error("wrong private key type");if(t.padding!==void 0&&t.padding!==e7)throw new Error("illegal or unsupported padding mode");i=er.concat([a,i]);for(var g=c.modulus.byteLength(),b=[0,1];i.length+b.length+1<g;)b.push(255);b.push(0);for(var w=-1;++w<i.length;)b.push(i[w]);var _=Xx(b,c);return _}function i7(i,t){var r=t7[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var s=new Yx(r),a=s.keyFromPrivate(t.privateKey),c=a.sign(i);return er.from(c.toDER())}function n7(i,t,r){for(var s=t.params.priv_key,a=t.params.p,c=t.params.q,g=t.params.g,b=new $0(0),w,_=Vh(i,c).mod(c),S=!1,A=Y2(s,c,i,r);S===!1;)w=Q2(c,A,r),b=o7(g,w,a,c),S=w.invm(c).imul(_.add(s.mul(b))).mod(c),S.cmpn(0)===0&&(S=!1,b=new $0(0));return a7(b,S)}function a7(i,t){i=i.toArray(),t=t.toArray(),i[0]&128&&(i=[0].concat(i)),t[0]&128&&(t=[0].concat(t));var r=i.length+t.length+4,s=[48,r,2,i.length];return s=s.concat(i,[2,t.length],t),er.from(s)}function Y2(i,t,r,s){if(i=er.from(i.toArray()),i.length<t.byteLength()){var a=er.alloc(t.byteLength()-i.length);i=er.concat([a,i])}var c=r.length,g=f7(r,t),b=er.alloc(c);b.fill(1);var w=er.alloc(c);return w=hn(s,w).update(b).update(er.from([0])).update(i).update(g).digest(),b=hn(s,w).update(b).digest(),w=hn(s,w).update(b).update(er.from([1])).update(i).update(g).digest(),b=hn(s,w).update(b).digest(),{k:w,v:b}}function Vh(i,t){var r=new $0(i),s=(i.length<<3)-t.bitLength();return s>0&&r.ishrn(s),r}function f7(i,t){i=Vh(i,t),i=i.mod(t);var r=er.from(i.toArray());if(r.length<t.byteLength()){var s=er.alloc(t.byteLength()-r.length);r=er.concat([s,r])}return r}function Q2(i,t,r){var s,a;do{for(s=er.alloc(0);s.length*8<i.bitLength();)t.v=hn(r,t.k).update(t.v).digest(),s=er.concat([s,t.v]);a=Vh(s,i),t.k=hn(r,t.k).update(t.v).update(er.from([0])).digest(),t.v=hn(r,t.k).update(t.v).digest()}while(a.cmp(i)!==-1);return a}function o7(i,t,r,s){return i.toRed($0.mont(r)).redPow(t).fromRed().mod(s)}H0.exports=r7;H0.exports.getKey=Y2;H0.exports.makeKey=Q2});var ng=I((PA,ig)=>{"use strict";var jh=It().Buffer,Xa=b0(),s7=L0().ec,rg=Ja(),h7=Wh();function u7(i,t,r,s,a){var c=rg(r);if(c.type==="ec"){if(s!=="ecdsa"&&s!=="ecdsa/rsa")throw new Error("wrong public key type");return l7(i,t,c)}else if(c.type==="dsa"){if(s!=="dsa")throw new Error("wrong public key type");return d7(i,t,c)}if(s!=="rsa"&&s!=="ecdsa/rsa")throw new Error("wrong public key type");t=jh.concat([a,t]);for(var g=c.modulus.byteLength(),b=[1],w=0;t.length+b.length+2<g;)b.push(255),w+=1;b.push(0);for(var _=-1;++_<t.length;)b.push(t[_]);b=jh.from(b);var S=Xa.mont(c.modulus);i=new Xa(i).toRed(S),i=i.redPow(new Xa(c.publicExponent)),i=jh.from(i.fromRed().toArray());var A=w<8?1:0;for(g=Math.min(i.length,b.length),i.length!==b.length&&(A=1),_=-1;++_<g;)A|=i[_]^b[_];return A===0}function l7(i,t,r){var s=h7[r.data.algorithm.curve.join(".")];if(!s)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var a=new s7(s),c=r.data.subjectPrivateKey.data;return a.verify(t,i,c)}function d7(i,t,r){var s=r.data.p,a=r.data.q,c=r.data.g,g=r.data.pub_key,b=rg.signature.decode(i,"der"),w=b.s,_=b.r;eg(w,a),eg(_,a);var S=Xa.mont(s),A=w.invm(a),q=c.toRed(S).redPow(new Xa(t).mul(A).mod(a)).fromRed().mul(g.toRed(S).redPow(_.mul(A).mod(a)).fromRed()).mod(s).mod(a);return q.cmp(_)===0}function eg(i,t){if(i.cmpn(0)<=0)throw new Error("invalid sig");if(i.cmp(t)>=0)throw new Error("invalid sig")}ig.exports=u7});var ug=I((CA,hg)=>{"use strict";var G0=It().Buffer,og=bn(),Z0=Tv(),sg=Rt(),c7=tg(),p7=ng(),un=Do();Object.keys(un).forEach(function(i){un[i].id=G0.from(un[i].id,"hex"),un[i.toLowerCase()]=un[i]});function Ya(i){Z0.Writable.call(this);var t=un[i];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=og(t.hash),this._tag=t.id,this._signType=t.sign}sg(Ya,Z0.Writable);Ya.prototype._write=function(t,r,s){this._hash.update(t),s()};Ya.prototype.update=function(t,r){return this._hash.update(typeof t=="string"?G0.from(t,r):t),this};Ya.prototype.sign=function(t,r){this.end();var s=this._hash.digest(),a=c7(s,t,this._hashType,this._signType,this._tag);return r?a.toString(r):a};function Qa(i){Z0.Writable.call(this);var t=un[i];if(!t)throw new Error("Unknown message digest");this._hash=og(t.hash),this._tag=t.id,this._signType=t.sign}sg(Qa,Z0.Writable);Qa.prototype._write=function(t,r,s){this._hash.update(t),s()};Qa.prototype.update=function(t,r){return this._hash.update(typeof t=="string"?G0.from(t,r):t),this};Qa.prototype.verify=function(t,r,s){var a=typeof r=="string"?G0.from(r,s):r;this.end();var c=this._hash.digest();return p7(a,c,t,this._signType,this._tag)};function ag(i){return new Ya(i)}function fg(i){return new Qa(i)}hg.exports={Sign:ag,Verify:fg,createSign:ag,createVerify:fg}});var dg=I((lg,Jh)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof Jh>"u"||Jh,lg)});var pg=I((DA,cg)=>{"use strict";var v7=L0(),m7=dg();cg.exports=function(t){return new ln(t)};var cr={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}};cr.p224=cr.secp224r1;cr.p256=cr.secp256r1=cr.prime256v1;cr.p192=cr.secp192r1=cr.prime192v1;cr.p384=cr.secp384r1;cr.p521=cr.secp521r1;function ln(i){this.curveType=cr[i],this.curveType||(this.curveType={name:i}),this.curve=new v7.ec(this.curveType.name),this.keys=void 0}ln.prototype.generateKeys=function(i,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(i,t)};ln.prototype.computeSecret=function(i,t,r){t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t));var s=this.curve.keyFromPublic(i).getPublic(),a=s.mul(this.keys.getPrivate()).getX();return Xh(a,r,this.curveType.byteLength)};ln.prototype.getPublicKey=function(i,t){var r=this.keys.getPublic(t==="compressed",!0);return t==="hybrid"&&(r[r.length-1]%2?r[0]=7:r[0]=6),Xh(r,i)};ln.prototype.getPrivateKey=function(i){return Xh(this.keys.getPrivate(),i)};ln.prototype.setPublicKey=function(i,t){return t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t)),this.keys._importPublic(i),this};ln.prototype.setPrivateKey=function(i,t){t=t||"utf8",Buffer.isBuffer(i)||(i=new Buffer(i,t));var r=new m7(i);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function Xh(i,t,r){Array.isArray(i)||(i=i.toArray());var s=new Buffer(i);if(r&&s.length<r){var a=new Buffer(r-s.length);a.fill(0),s=Buffer.concat([a,s])}return t?s.toString(t):s}});var Qh=I((NA,vg)=>{"use strict";var g7=bn(),Yh=It().Buffer;vg.exports=function(i,t){for(var r=Yh.alloc(0),s=0,a;r.length<t;)a=y7(s++),r=Yh.concat([r,g7("sha1").update(i).update(a).digest()]);return r.slice(0,t)};function y7(i){var t=Yh.allocUnsafe(4);return t.writeUInt32BE(i,0),t}});var tu=I((LA,mg)=>{"use strict";mg.exports=function(t,r){for(var s=t.length,a=-1;++a<s;)t[a]^=r[a];return t}});var W0=I((gg,eu)=>{"use strict";(function(i,t){"use strict";function r(v,e){if(!v)throw new Error(e||"Assertion failed")}function s(v,e){v.super_=e;var f=function(){};f.prototype=e.prototype,v.prototype=new f,v.prototype.constructor=v}function a(v,e,f){if(a.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((e==="le"||e==="be")&&(f=e,e=10),this._init(v||0,e||10,f||"be"))}typeof i=="object"?i.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=qi().Buffer}catch{}a.isBN=function(e){return e instanceof a?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,f){return e.cmp(f)>0?e:f},a.min=function(e,f){return e.cmp(f)<0?e:f},a.prototype._init=function(e,f,h){if(typeof e=="number")return this._initNumber(e,f,h);if(typeof e=="object")return this._initArray(e,f,h);f==="hex"&&(f=16),r(f===(f|0)&&f>=2&&f<=36),e=e.toString().replace(/\s+/g,"");var o=0;e[0]==="-"&&(o++,this.negative=1),o<e.length&&(f===16?this._parseHex(e,o,h):(this._parseBase(e,f,o),h==="le"&&this._initArray(this.toArray(),f,h)))},a.prototype._initNumber=function(e,f,h){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},a.prototype._initArray=function(e,f,h){if(r(typeof e.length=="number"),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u,p,m=0;if(h==="be")for(o=e.length-1,u=0;o>=0;o-=3)p=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);else if(h==="le")for(o=0,u=0;o<e.length;o+=3)p=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[u]|=p<<m&67108863,this.words[u+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,u++);return this.strip()};function g(v,e){var f=v.charCodeAt(e);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function b(v,e,f){var h=g(v,f);return f-1>=e&&(h|=g(v,f-1)<<4),h}a.prototype._parseHex=function(e,f,h){this.length=Math.ceil((e.length-f)/6),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var u=0,p=0,m;if(h==="be")for(o=e.length-1;o>=f;o-=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8;else{var l=e.length-f;for(o=l%2===0?f+1:f;o<e.length;o+=2)m=b(e,f,o)<<u,this.words[p]|=m&67108863,u>=18?(u-=18,p+=1,this.words[p]|=m>>>26):u+=8}this.strip()};function w(v,e,f,h){for(var o=0,u=Math.min(v.length,f),p=e;p<u;p++){var m=v.charCodeAt(p)-48;o*=h,m>=49?o+=m-49+10:m>=17?o+=m-17+10:o+=m}return o}a.prototype._parseBase=function(e,f,h){this.words=[0],this.length=1;for(var o=0,u=1;u<=67108863;u*=f)o++;o--,u=u/f|0;for(var p=e.length-h,m=p%o,l=Math.min(p,p-m)+h,n=0,d=h;d<l;d+=o)n=w(e,d,d+o,f),this.imuln(u),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n);if(m!==0){var M=1;for(n=w(e,d,e.length,f),d=0;d<m;d++)M*=f;this.imuln(M),this.words[0]+n<67108864?this.words[0]+=n:this._iaddn(n)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var f=0;f<this.length;f++)e.words[f]=this.words[f];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","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"],S=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,f){e=e||10,f=f|0||1;var h;if(e===16||e==="hex"){h="";for(var o=0,u=0,p=0;p<this.length;p++){var m=this.words[p],l=((m<<o|u)&16777215).toString(16);u=m>>>24-o&16777215,o+=2,o>=26&&(o-=26,p--),u!==0||p!==this.length-1?h=_[6-l.length]+l+h:h=l+h}for(u!==0&&(h=u.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(e===(e|0)&&e>=2&&e<=36){var n=S[e],d=A[e];h="";var M=this.clone();for(M.negative=0;!M.isZero();){var y=M.modn(d).toString(e);M=M.idivn(d),M.isZero()?h=y+h:h=_[n-y.length]+y+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,f){return r(typeof c<"u"),this.toArrayLike(c,e,f)},a.prototype.toArray=function(e,f){return this.toArrayLike(Array,e,f)},a.prototype.toArrayLike=function(e,f,h){var o=this.byteLength(),u=h||Math.max(1,o);r(o<=u,"byte array longer than desired length"),r(u>0,"Requested array length <= 0"),this.strip();var p=f==="le",m=new e(u),l,n,d=this.clone();if(p){for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[n]=l;for(;n<u;n++)m[n]=0}else{for(n=0;n<u-o;n++)m[n]=0;for(n=0;!d.isZero();n++)l=d.andln(255),d.iushrn(8),m[u-n-1]=l}return m},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var f=e,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},a.prototype._zeroBits=function(e){if(e===0)return 26;var f=e,h=0;return(f&8191)===0&&(h+=13,f>>>=13),(f&127)===0&&(h+=7,f>>>=7),(f&15)===0&&(h+=4,f>>>=4),(f&3)===0&&(h+=2,f>>>=2),(f&1)===0&&h++,h},a.prototype.bitLength=function(){var e=this.words[this.length-1],f=this._countBits(e);return(this.length-1)*26+f};function q(v){for(var e=new Array(v.bitLength()),f=0;f<e.length;f++){var h=f/26|0,o=f%26;e[f]=(v.words[h]&1<<o)>>>o}return e}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(e+=h,h!==26)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return this.negative!==0?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var f=0;f<e.length;f++)this.words[f]=this.words[f]|e.words[f];return this.strip()},a.prototype.ior=function(e){return r((this.negative|e.negative)===0),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var f;this.length>e.length?f=e:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&e.words[h];return this.length=f.length,this.strip()},a.prototype.iand=function(e){return r((this.negative|e.negative)===0),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var f,h;this.length>e.length?(f=this,h=e):(f=e,h=this);for(var o=0;o<h.length;o++)this.words[o]=f.words[o]^h.words[o];if(this!==f)for(;o<f.length;o++)this.words[o]=f.words[o];return this.length=f.length,this.strip()},a.prototype.ixor=function(e){return r((this.negative|e.negative)===0),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r(typeof e=="number"&&e>=0);var f=Math.ceil(e/26)|0,h=e%26;this._expand(f),h>0&&f--;for(var o=0;o<f;o++)this.words[o]=~this.words[o]&67108863;return h>0&&(this.words[o]=~this.words[o]&67108863>>26-h),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,f){r(typeof e=="number"&&e>=0);var h=e/26|0,o=e%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<o:this.words[h]=this.words[h]&~(1<<o),this.strip()},a.prototype.iadd=function(e){var f;if(this.negative!==0&&e.negative===0)return this.negative=0,f=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,f=this.isub(e),e.negative=1,f._normSign();var h,o;this.length>e.length?(h=this,o=e):(h=e,o=this);for(var u=0,p=0;p<o.length;p++)f=(h.words[p]|0)+(o.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;for(;u!==0&&p<h.length;p++)f=(h.words[p]|0)+u,this.words[p]=f&67108863,u=f>>>26;if(this.length=h.length,u!==0)this.words[this.length]=u,this.length++;else if(h!==this)for(;p<h.length;p++)this.words[p]=h.words[p];return this},a.prototype.add=function(e){var f;return e.negative!==0&&this.negative===0?(e.negative=0,f=this.sub(e),e.negative^=1,f):e.negative===0&&this.negative!==0?(this.negative=0,f=e.sub(this),this.negative=1,f):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var f=this.iadd(e);return e.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var h=this.cmp(e);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var o,u;h>0?(o=this,u=e):(o=e,u=this);for(var p=0,m=0;m<u.length;m++)f=(o.words[m]|0)-(u.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;for(;p!==0&&m<o.length;m++)f=(o.words[m]|0)+p,p=f>>26,this.words[m]=f&67108863;if(p===0&&m<o.length&&o!==this)for(;m<o.length;m++)this.words[m]=o.words[m];return this.length=Math.max(this.length,m),o!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};function R(v,e,f){f.negative=e.negative^v.negative;var h=v.length+e.length|0;f.length=h,h=h-1|0;var o=v.words[0]|0,u=e.words[0]|0,p=o*u,m=p&67108863,l=p/67108864|0;f.words[0]=m;for(var n=1;n<h;n++){for(var d=l>>>26,M=l&67108863,y=Math.min(n,e.length-1),x=Math.max(0,n-v.length+1);x<=y;x++){var B=n-x|0;o=v.words[B]|0,u=e.words[x]|0,p=o*u+M,d+=p/67108864|0,M=p&67108863}f.words[n]=M|0,l=d|0}return l!==0?f.words[n]=l|0:f.length--,f.strip()}var N=function(e,f,h){var o=e.words,u=f.words,p=h.words,m=0,l,n,d,M=o[0]|0,y=M&8191,x=M>>>13,B=o[1]|0,E=B&8191,k=B>>>13,wt=o[2]|0,T=wt&8191,P=wt>>>13,ue=o[3]|0,D=ue&8191,L=ue>>>13,me=o[4]|0,F=me&8191,U=me>>>13,ge=o[5]|0,K=ge&8191,z=ge>>>13,ye=o[6]|0,$=ye&8191,H=ye>>>13,be=o[7]|0,G=be&8191,Z=be>>>13,we=o[8]|0,W=we&8191,V=we>>>13,Me=o[9]|0,j=Me&8191,J=Me>>>13,xe=u[0]|0,X=xe&8191,Y=xe>>>13,_e=u[1]|0,Q=_e&8191,tt=_e>>>13,Se=u[2]|0,et=Se&8191,rt=Se>>>13,Ae=u[3]|0,it=Ae&8191,nt=Ae>>>13,Be=u[4]|0,at=Be&8191,ft=Be>>>13,Ee=u[5]|0,ot=Ee&8191,st=Ee>>>13,ke=u[6]|0,ht=ke&8191,ut=ke>>>13,qe=u[7]|0,lt=qe&8191,dt=qe>>>13,Ie=u[8]|0,ct=Ie&8191,pt=Ie>>>13,Re=u[9]|0,vt=Re&8191,mt=Re>>>13;h.negative=e.negative^f.negative,h.length=19,l=Math.imul(y,X),n=Math.imul(y,Y),n=n+Math.imul(x,X)|0,d=Math.imul(x,Y);var le=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(E,X),n=Math.imul(E,Y),n=n+Math.imul(k,X)|0,d=Math.imul(k,Y),l=l+Math.imul(y,Q)|0,n=n+Math.imul(y,tt)|0,n=n+Math.imul(x,Q)|0,d=d+Math.imul(x,tt)|0;var Et=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,l=Math.imul(T,X),n=Math.imul(T,Y),n=n+Math.imul(P,X)|0,d=Math.imul(P,Y),l=l+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(k,Q)|0,d=d+Math.imul(k,tt)|0,l=l+Math.imul(y,et)|0,n=n+Math.imul(y,rt)|0,n=n+Math.imul(x,et)|0,d=d+Math.imul(x,rt)|0;var kt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,l=Math.imul(D,X),n=Math.imul(D,Y),n=n+Math.imul(L,X)|0,d=Math.imul(L,Y),l=l+Math.imul(T,Q)|0,n=n+Math.imul(T,tt)|0,n=n+Math.imul(P,Q)|0,d=d+Math.imul(P,tt)|0,l=l+Math.imul(E,et)|0,n=n+Math.imul(E,rt)|0,n=n+Math.imul(k,et)|0,d=d+Math.imul(k,rt)|0,l=l+Math.imul(y,it)|0,n=n+Math.imul(y,nt)|0,n=n+Math.imul(x,it)|0,d=d+Math.imul(x,nt)|0;var Wt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,l=Math.imul(F,X),n=Math.imul(F,Y),n=n+Math.imul(U,X)|0,d=Math.imul(U,Y),l=l+Math.imul(D,Q)|0,n=n+Math.imul(D,tt)|0,n=n+Math.imul(L,Q)|0,d=d+Math.imul(L,tt)|0,l=l+Math.imul(T,et)|0,n=n+Math.imul(T,rt)|0,n=n+Math.imul(P,et)|0,d=d+Math.imul(P,rt)|0,l=l+Math.imul(E,it)|0,n=n+Math.imul(E,nt)|0,n=n+Math.imul(k,it)|0,d=d+Math.imul(k,nt)|0,l=l+Math.imul(y,at)|0,n=n+Math.imul(y,ft)|0,n=n+Math.imul(x,at)|0,d=d+Math.imul(x,ft)|0;var Vt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,l=Math.imul(K,X),n=Math.imul(K,Y),n=n+Math.imul(z,X)|0,d=Math.imul(z,Y),l=l+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,n=n+Math.imul(U,Q)|0,d=d+Math.imul(U,tt)|0,l=l+Math.imul(D,et)|0,n=n+Math.imul(D,rt)|0,n=n+Math.imul(L,et)|0,d=d+Math.imul(L,rt)|0,l=l+Math.imul(T,it)|0,n=n+Math.imul(T,nt)|0,n=n+Math.imul(P,it)|0,d=d+Math.imul(P,nt)|0,l=l+Math.imul(E,at)|0,n=n+Math.imul(E,ft)|0,n=n+Math.imul(k,at)|0,d=d+Math.imul(k,ft)|0,l=l+Math.imul(y,ot)|0,n=n+Math.imul(y,st)|0,n=n+Math.imul(x,ot)|0,d=d+Math.imul(x,st)|0;var jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul($,X),n=Math.imul($,Y),n=n+Math.imul(H,X)|0,d=Math.imul(H,Y),l=l+Math.imul(K,Q)|0,n=n+Math.imul(K,tt)|0,n=n+Math.imul(z,Q)|0,d=d+Math.imul(z,tt)|0,l=l+Math.imul(F,et)|0,n=n+Math.imul(F,rt)|0,n=n+Math.imul(U,et)|0,d=d+Math.imul(U,rt)|0,l=l+Math.imul(D,it)|0,n=n+Math.imul(D,nt)|0,n=n+Math.imul(L,it)|0,d=d+Math.imul(L,nt)|0,l=l+Math.imul(T,at)|0,n=n+Math.imul(T,ft)|0,n=n+Math.imul(P,at)|0,d=d+Math.imul(P,ft)|0,l=l+Math.imul(E,ot)|0,n=n+Math.imul(E,st)|0,n=n+Math.imul(k,ot)|0,d=d+Math.imul(k,st)|0,l=l+Math.imul(y,ht)|0,n=n+Math.imul(y,ut)|0,n=n+Math.imul(x,ht)|0,d=d+Math.imul(x,ut)|0;var Jt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,l=Math.imul(G,X),n=Math.imul(G,Y),n=n+Math.imul(Z,X)|0,d=Math.imul(Z,Y),l=l+Math.imul($,Q)|0,n=n+Math.imul($,tt)|0,n=n+Math.imul(H,Q)|0,d=d+Math.imul(H,tt)|0,l=l+Math.imul(K,et)|0,n=n+Math.imul(K,rt)|0,n=n+Math.imul(z,et)|0,d=d+Math.imul(z,rt)|0,l=l+Math.imul(F,it)|0,n=n+Math.imul(F,nt)|0,n=n+Math.imul(U,it)|0,d=d+Math.imul(U,nt)|0,l=l+Math.imul(D,at)|0,n=n+Math.imul(D,ft)|0,n=n+Math.imul(L,at)|0,d=d+Math.imul(L,ft)|0,l=l+Math.imul(T,ot)|0,n=n+Math.imul(T,st)|0,n=n+Math.imul(P,ot)|0,d=d+Math.imul(P,st)|0,l=l+Math.imul(E,ht)|0,n=n+Math.imul(E,ut)|0,n=n+Math.imul(k,ht)|0,d=d+Math.imul(k,ut)|0,l=l+Math.imul(y,lt)|0,n=n+Math.imul(y,dt)|0,n=n+Math.imul(x,lt)|0,d=d+Math.imul(x,dt)|0;var Xt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,l=Math.imul(W,X),n=Math.imul(W,Y),n=n+Math.imul(V,X)|0,d=Math.imul(V,Y),l=l+Math.imul(G,Q)|0,n=n+Math.imul(G,tt)|0,n=n+Math.imul(Z,Q)|0,d=d+Math.imul(Z,tt)|0,l=l+Math.imul($,et)|0,n=n+Math.imul($,rt)|0,n=n+Math.imul(H,et)|0,d=d+Math.imul(H,rt)|0,l=l+Math.imul(K,it)|0,n=n+Math.imul(K,nt)|0,n=n+Math.imul(z,it)|0,d=d+Math.imul(z,nt)|0,l=l+Math.imul(F,at)|0,n=n+Math.imul(F,ft)|0,n=n+Math.imul(U,at)|0,d=d+Math.imul(U,ft)|0,l=l+Math.imul(D,ot)|0,n=n+Math.imul(D,st)|0,n=n+Math.imul(L,ot)|0,d=d+Math.imul(L,st)|0,l=l+Math.imul(T,ht)|0,n=n+Math.imul(T,ut)|0,n=n+Math.imul(P,ht)|0,d=d+Math.imul(P,ut)|0,l=l+Math.imul(E,lt)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(k,lt)|0,d=d+Math.imul(k,dt)|0,l=l+Math.imul(y,ct)|0,n=n+Math.imul(y,pt)|0,n=n+Math.imul(x,ct)|0,d=d+Math.imul(x,pt)|0;var Yt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(J,X)|0,d=Math.imul(J,Y),l=l+Math.imul(W,Q)|0,n=n+Math.imul(W,tt)|0,n=n+Math.imul(V,Q)|0,d=d+Math.imul(V,tt)|0,l=l+Math.imul(G,et)|0,n=n+Math.imul(G,rt)|0,n=n+Math.imul(Z,et)|0,d=d+Math.imul(Z,rt)|0,l=l+Math.imul($,it)|0,n=n+Math.imul($,nt)|0,n=n+Math.imul(H,it)|0,d=d+Math.imul(H,nt)|0,l=l+Math.imul(K,at)|0,n=n+Math.imul(K,ft)|0,n=n+Math.imul(z,at)|0,d=d+Math.imul(z,ft)|0,l=l+Math.imul(F,ot)|0,n=n+Math.imul(F,st)|0,n=n+Math.imul(U,ot)|0,d=d+Math.imul(U,st)|0,l=l+Math.imul(D,ht)|0,n=n+Math.imul(D,ut)|0,n=n+Math.imul(L,ht)|0,d=d+Math.imul(L,ut)|0,l=l+Math.imul(T,lt)|0,n=n+Math.imul(T,dt)|0,n=n+Math.imul(P,lt)|0,d=d+Math.imul(P,dt)|0,l=l+Math.imul(E,ct)|0,n=n+Math.imul(E,pt)|0,n=n+Math.imul(k,ct)|0,d=d+Math.imul(k,pt)|0,l=l+Math.imul(y,vt)|0,n=n+Math.imul(y,mt)|0,n=n+Math.imul(x,vt)|0,d=d+Math.imul(x,mt)|0;var Qt=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(j,Q),n=Math.imul(j,tt),n=n+Math.imul(J,Q)|0,d=Math.imul(J,tt),l=l+Math.imul(W,et)|0,n=n+Math.imul(W,rt)|0,n=n+Math.imul(V,et)|0,d=d+Math.imul(V,rt)|0,l=l+Math.imul(G,it)|0,n=n+Math.imul(G,nt)|0,n=n+Math.imul(Z,it)|0,d=d+Math.imul(Z,nt)|0,l=l+Math.imul($,at)|0,n=n+Math.imul($,ft)|0,n=n+Math.imul(H,at)|0,d=d+Math.imul(H,ft)|0,l=l+Math.imul(K,ot)|0,n=n+Math.imul(K,st)|0,n=n+Math.imul(z,ot)|0,d=d+Math.imul(z,st)|0,l=l+Math.imul(F,ht)|0,n=n+Math.imul(F,ut)|0,n=n+Math.imul(U,ht)|0,d=d+Math.imul(U,ut)|0,l=l+Math.imul(D,lt)|0,n=n+Math.imul(D,dt)|0,n=n+Math.imul(L,lt)|0,d=d+Math.imul(L,dt)|0,l=l+Math.imul(T,ct)|0,n=n+Math.imul(T,pt)|0,n=n+Math.imul(P,ct)|0,d=d+Math.imul(P,pt)|0,l=l+Math.imul(E,vt)|0,n=n+Math.imul(E,mt)|0,n=n+Math.imul(k,vt)|0,d=d+Math.imul(k,mt)|0;var te=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(j,et),n=Math.imul(j,rt),n=n+Math.imul(J,et)|0,d=Math.imul(J,rt),l=l+Math.imul(W,it)|0,n=n+Math.imul(W,nt)|0,n=n+Math.imul(V,it)|0,d=d+Math.imul(V,nt)|0,l=l+Math.imul(G,at)|0,n=n+Math.imul(G,ft)|0,n=n+Math.imul(Z,at)|0,d=d+Math.imul(Z,ft)|0,l=l+Math.imul($,ot)|0,n=n+Math.imul($,st)|0,n=n+Math.imul(H,ot)|0,d=d+Math.imul(H,st)|0,l=l+Math.imul(K,ht)|0,n=n+Math.imul(K,ut)|0,n=n+Math.imul(z,ht)|0,d=d+Math.imul(z,ut)|0,l=l+Math.imul(F,lt)|0,n=n+Math.imul(F,dt)|0,n=n+Math.imul(U,lt)|0,d=d+Math.imul(U,dt)|0,l=l+Math.imul(D,ct)|0,n=n+Math.imul(D,pt)|0,n=n+Math.imul(L,ct)|0,d=d+Math.imul(L,pt)|0,l=l+Math.imul(T,vt)|0,n=n+Math.imul(T,mt)|0,n=n+Math.imul(P,vt)|0,d=d+Math.imul(P,mt)|0;var ee=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(j,it),n=Math.imul(j,nt),n=n+Math.imul(J,it)|0,d=Math.imul(J,nt),l=l+Math.imul(W,at)|0,n=n+Math.imul(W,ft)|0,n=n+Math.imul(V,at)|0,d=d+Math.imul(V,ft)|0,l=l+Math.imul(G,ot)|0,n=n+Math.imul(G,st)|0,n=n+Math.imul(Z,ot)|0,d=d+Math.imul(Z,st)|0,l=l+Math.imul($,ht)|0,n=n+Math.imul($,ut)|0,n=n+Math.imul(H,ht)|0,d=d+Math.imul(H,ut)|0,l=l+Math.imul(K,lt)|0,n=n+Math.imul(K,dt)|0,n=n+Math.imul(z,lt)|0,d=d+Math.imul(z,dt)|0,l=l+Math.imul(F,ct)|0,n=n+Math.imul(F,pt)|0,n=n+Math.imul(U,ct)|0,d=d+Math.imul(U,pt)|0,l=l+Math.imul(D,vt)|0,n=n+Math.imul(D,mt)|0,n=n+Math.imul(L,vt)|0,d=d+Math.imul(L,mt)|0;var re=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(j,at),n=Math.imul(j,ft),n=n+Math.imul(J,at)|0,d=Math.imul(J,ft),l=l+Math.imul(W,ot)|0,n=n+Math.imul(W,st)|0,n=n+Math.imul(V,ot)|0,d=d+Math.imul(V,st)|0,l=l+Math.imul(G,ht)|0,n=n+Math.imul(G,ut)|0,n=n+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ut)|0,l=l+Math.imul($,lt)|0,n=n+Math.imul($,dt)|0,n=n+Math.imul(H,lt)|0,d=d+Math.imul(H,dt)|0,l=l+Math.imul(K,ct)|0,n=n+Math.imul(K,pt)|0,n=n+Math.imul(z,ct)|0,d=d+Math.imul(z,pt)|0,l=l+Math.imul(F,vt)|0,n=n+Math.imul(F,mt)|0,n=n+Math.imul(U,vt)|0,d=d+Math.imul(U,mt)|0;var ie=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(j,ot),n=Math.imul(j,st),n=n+Math.imul(J,ot)|0,d=Math.imul(J,st),l=l+Math.imul(W,ht)|0,n=n+Math.imul(W,ut)|0,n=n+Math.imul(V,ht)|0,d=d+Math.imul(V,ut)|0,l=l+Math.imul(G,lt)|0,n=n+Math.imul(G,dt)|0,n=n+Math.imul(Z,lt)|0,d=d+Math.imul(Z,dt)|0,l=l+Math.imul($,ct)|0,n=n+Math.imul($,pt)|0,n=n+Math.imul(H,ct)|0,d=d+Math.imul(H,pt)|0,l=l+Math.imul(K,vt)|0,n=n+Math.imul(K,mt)|0,n=n+Math.imul(z,vt)|0,d=d+Math.imul(z,mt)|0;var ne=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(j,ht),n=Math.imul(j,ut),n=n+Math.imul(J,ht)|0,d=Math.imul(J,ut),l=l+Math.imul(W,lt)|0,n=n+Math.imul(W,dt)|0,n=n+Math.imul(V,lt)|0,d=d+Math.imul(V,dt)|0,l=l+Math.imul(G,ct)|0,n=n+Math.imul(G,pt)|0,n=n+Math.imul(Z,ct)|0,d=d+Math.imul(Z,pt)|0,l=l+Math.imul($,vt)|0,n=n+Math.imul($,mt)|0,n=n+Math.imul(H,vt)|0,d=d+Math.imul(H,mt)|0;var ae=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(j,lt),n=Math.imul(j,dt),n=n+Math.imul(J,lt)|0,d=Math.imul(J,dt),l=l+Math.imul(W,ct)|0,n=n+Math.imul(W,pt)|0,n=n+Math.imul(V,ct)|0,d=d+Math.imul(V,pt)|0,l=l+Math.imul(G,vt)|0,n=n+Math.imul(G,mt)|0,n=n+Math.imul(Z,vt)|0,d=d+Math.imul(Z,mt)|0;var fe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(j,ct),n=Math.imul(j,pt),n=n+Math.imul(J,ct)|0,d=Math.imul(J,pt),l=l+Math.imul(W,vt)|0,n=n+Math.imul(W,mt)|0,n=n+Math.imul(V,vt)|0,d=d+Math.imul(V,mt)|0;var oe=(m+l|0)+((n&8191)<<13)|0;m=(d+(n>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(j,vt),n=Math.imul(j,mt),n=n+Math.imul(J,vt)|0,d=Math.imul(J,mt);var se=(m+l|0)+((n&8191)<<13)|0;return m=(d+(n>>>13)|0)+(se>>>26)|0,se&=67108863,p[0]=le,p[1]=Et,p[2]=kt,p[3]=Wt,p[4]=Vt,p[5]=jt,p[6]=Jt,p[7]=Xt,p[8]=Yt,p[9]=Qt,p[10]=te,p[11]=ee,p[12]=re,p[13]=ie,p[14]=ne,p[15]=ae,p[16]=fe,p[17]=oe,p[18]=se,m!==0&&(p[19]=m,h.length++),h};Math.imul||(N=R);function bt(v,e,f){f.negative=e.negative^v.negative,f.length=v.length+e.length;for(var h=0,o=0,u=0;u<f.length-1;u++){var p=o;o=0;for(var m=h&67108863,l=Math.min(u,e.length-1),n=Math.max(0,u-v.length+1);n<=l;n++){var d=u-n,M=v.words[d]|0,y=e.words[n]|0,x=M*y,B=x&67108863;p=p+(x/67108864|0)|0,B=B+m|0,m=B&67108863,p=p+(B>>>26)|0,o+=p>>>26,p&=67108863}f.words[u]=m,h=p,p=o}return h!==0?f.words[u]=h:f.length--,f.strip()}function _t(v,e,f){var h=new gt;return h.mulp(v,e,f)}a.prototype.mulTo=function(e,f){var h,o=this.length+e.length;return this.length===10&&e.length===10?h=N(this,e,f):o<63?h=R(this,e,f):o<1024?h=bt(this,e,f):h=_t(this,e,f),h};function gt(v,e){this.x=v,this.y=e}gt.prototype.makeRBT=function(e){for(var f=new Array(e),h=a.prototype._countBits(e)-1,o=0;o<e;o++)f[o]=this.revBin(o,h,e);return f},gt.prototype.revBin=function(e,f,h){if(e===0||e===h-1)return e;for(var o=0,u=0;u<f;u++)o|=(e&1)<<f-u-1,e>>=1;return o},gt.prototype.permute=function(e,f,h,o,u,p){for(var m=0;m<p;m++)o[m]=f[e[m]],u[m]=h[e[m]]},gt.prototype.transform=function(e,f,h,o,u,p){this.permute(p,e,f,h,o,u);for(var m=1;m<u;m<<=1)for(var l=m<<1,n=Math.cos(2*Math.PI/l),d=Math.sin(2*Math.PI/l),M=0;M<u;M+=l)for(var y=n,x=d,B=0;B<m;B++){var E=h[M+B],k=o[M+B],wt=h[M+B+m],T=o[M+B+m],P=y*wt-x*T;T=y*T+x*wt,wt=P,h[M+B]=E+wt,o[M+B]=k+T,h[M+B+m]=E-wt,o[M+B+m]=k-T,B!==l&&(P=n*y-d*x,x=n*x+d*y,y=P)}},gt.prototype.guessLen13b=function(e,f){var h=Math.max(f,e)|1,o=h&1,u=0;for(h=h/2|0;h;h=h>>>1)u++;return 1<<u+1+o},gt.prototype.conjugate=function(e,f,h){if(!(h<=1))for(var o=0;o<h/2;o++){var u=e[o];e[o]=e[h-o-1],e[h-o-1]=u,u=f[o],f[o]=-f[h-o-1],f[h-o-1]=-u}},gt.prototype.normalize13b=function(e,f){for(var h=0,o=0;o<f/2;o++){var u=Math.round(e[2*o+1]/f)*8192+Math.round(e[2*o]/f)+h;e[o]=u&67108863,u<67108864?h=0:h=u/67108864|0}return e},gt.prototype.convert13b=function(e,f,h,o){for(var u=0,p=0;p<f;p++)u=u+(e[p]|0),h[2*p]=u&8191,u=u>>>13,h[2*p+1]=u&8191,u=u>>>13;for(p=2*f;p<o;++p)h[p]=0;r(u===0),r((u&-8192)===0)},gt.prototype.stub=function(e){for(var f=new Array(e),h=0;h<e;h++)f[h]=0;return f},gt.prototype.mulp=function(e,f,h){var o=2*this.guessLen13b(e.length,f.length),u=this.makeRBT(o),p=this.stub(o),m=new Array(o),l=new Array(o),n=new Array(o),d=new Array(o),M=new Array(o),y=new Array(o),x=h.words;x.length=o,this.convert13b(e.words,e.length,m,o),this.convert13b(f.words,f.length,d,o),this.transform(m,p,l,n,o,u),this.transform(d,p,M,y,o,u);for(var B=0;B<o;B++){var E=l[B]*M[B]-n[B]*y[B];n[B]=l[B]*y[B]+n[B]*M[B],l[B]=E}return this.conjugate(l,n,o),this.transform(l,n,x,p,o,u),this.conjugate(x,p,o),this.normalize13b(x,o),h.negative=e.negative^f.negative,h.length=e.length+f.length,h.strip()},a.prototype.mul=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),this.mulTo(e,f)},a.prototype.mulf=function(e){var f=new a(null);return f.words=new Array(this.length+e.length),_t(this,e,f)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r(typeof e=="number"),r(e<67108864);for(var f=0,h=0;h<this.length;h++){var o=(this.words[h]|0)*e,u=(o&67108863)+(f&67108863);f>>=26,f+=o/67108864|0,f+=u>>>26,this.words[h]=u&67108863}return f!==0&&(this.words[h]=f,this.length++),this.length=e===0?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var f=q(e);if(f.length===0)return new a(1);for(var h=this,o=0;o<f.length&&f[o]===0;o++,h=h.sqr());if(++o<f.length)for(var u=h.sqr();o<f.length;o++,u=u.sqr())f[o]!==0&&(h=h.mul(u));return h},a.prototype.iushln=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=67108863>>>26-f<<26-f,u;if(f!==0){var p=0;for(u=0;u<this.length;u++){var m=this.words[u]&o,l=(this.words[u]|0)-m<<f;this.words[u]=l|p,p=m>>>26-f}p&&(this.words[u]=p,this.length++)}if(h!==0){for(u=this.length-1;u>=0;u--)this.words[u+h]=this.words[u];for(u=0;u<h;u++)this.words[u]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(e){return r(this.negative===0),this.iushln(e)},a.prototype.iushrn=function(e,f,h){r(typeof e=="number"&&e>=0);var o;f?o=(f-f%26)/26:o=0;var u=e%26,p=Math.min((e-u)/26,this.length),m=67108863^67108863>>>u<<u,l=h;if(o-=p,o=Math.max(0,o),l){for(var n=0;n<p;n++)l.words[n]=this.words[n];l.length=p}if(p!==0)if(this.length>p)for(this.length-=p,n=0;n<this.length;n++)this.words[n]=this.words[n+p];else this.words[0]=0,this.length=1;var d=0;for(n=this.length-1;n>=0&&(d!==0||n>=o);n--){var M=this.words[n]|0;this.words[n]=d<<26-u|M>>>u,d=M&m}return l&&d!==0&&(l.words[l.length++]=d),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,f,h){return r(this.negative===0),this.iushrn(e,f,h)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return!1;var u=this.words[h];return!!(u&o)},a.prototype.imaskn=function(e){r(typeof e=="number"&&e>=0);var f=e%26,h=(e-f)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var o=67108863^67108863>>>f<<f;this.words[this.length-1]&=o}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r(typeof e=="number"),r(e<67108864),e<0?this.isubn(-e):this.negative!==0?this.length===1&&(this.words[0]|0)<e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},a.prototype.isubn=function(e){if(r(typeof e=="number"),r(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,f,h){var o=e.length+h,u;this._expand(o);var p,m=0;for(u=0;u<e.length;u++){p=(this.words[u+h]|0)+m;var l=(e.words[u]|0)*f;p-=l&67108863,m=(p>>26)-(l/67108864|0),this.words[u+h]=p&67108863}for(;u<this.length-h;u++)p=(this.words[u+h]|0)+m,m=p>>26,this.words[u+h]=p&67108863;if(m===0)return this.strip();for(r(m===-1),m=0,u=0;u<this.length;u++)p=-(this.words[u]|0)+m,m=p>>26,this.words[u]=p&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,f){var h=this.length-e.length,o=this.clone(),u=e,p=u.words[u.length-1]|0,m=this._countBits(p);h=26-m,h!==0&&(u=u.ushln(h),o.iushln(h),p=u.words[u.length-1]|0);var l=o.length-u.length,n;if(f!=="mod"){n=new a(null),n.length=l+1,n.words=new Array(n.length);for(var d=0;d<n.length;d++)n.words[d]=0}var M=o.clone()._ishlnsubmul(u,1,l);M.negative===0&&(o=M,n&&(n.words[l]=1));for(var y=l-1;y>=0;y--){var x=(o.words[u.length+y]|0)*67108864+(o.words[u.length+y-1]|0);for(x=Math.min(x/p|0,67108863),o._ishlnsubmul(u,x,y);o.negative!==0;)x--,o.negative=0,o._ishlnsubmul(u,1,y),o.isZero()||(o.negative^=1);n&&(n.words[y]=x)}return n&&n.strip(),o.strip(),f!=="div"&&h!==0&&o.iushrn(h),{div:n||null,mod:o}},a.prototype.divmod=function(e,f,h){if(r(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var o,u,p;return this.negative!==0&&e.negative===0?(p=this.neg().divmod(e,f),f!=="mod"&&(o=p.div.neg()),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.iadd(e)),{div:o,mod:u}):this.negative===0&&e.negative!==0?(p=this.divmod(e.neg(),f),f!=="mod"&&(o=p.div.neg()),{div:o,mod:p.mod}):(this.negative&e.negative)!==0?(p=this.neg().divmod(e.neg(),f),f!=="div"&&(u=p.mod.neg(),h&&u.negative!==0&&u.isub(e)),{div:p.div,mod:u}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:e.length===1?f==="div"?{div:this.divn(e.words[0]),mod:null}:f==="mod"?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,f)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var f=this.divmod(e);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(e):f.mod,o=e.ushrn(1),u=e.andln(1),p=h.cmp(o);return p<0||u===1&&p===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var f=(1<<26)%e,h=0,o=this.length-1;o>=0;o--)h=(f*h+(this.words[o]|0))%e;return h},a.prototype.idivn=function(e){r(e<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var o=(this.words[h]|0)+f*67108864;this.words[h]=o/e|0,f=o%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=new a(0),m=new a(1),l=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++l;for(var n=h.clone(),d=f.clone();!f.isZero();){for(var M=0,y=1;(f.words[0]&y)===0&&M<26;++M,y<<=1);if(M>0)for(f.iushrn(M);M-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(n),u.isub(d)),o.iushrn(1),u.iushrn(1);for(var x=0,B=1;(h.words[0]&B)===0&&x<26;++x,B<<=1);if(x>0)for(h.iushrn(x);x-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(n),m.isub(d)),p.iushrn(1),m.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(p),u.isub(m)):(h.isub(f),p.isub(o),m.isub(u))}return{a:p,b:m,gcd:h.iushln(l)}},a.prototype._invmp=function(e){r(e.negative===0),r(!e.isZero());var f=this,h=e.clone();f.negative!==0?f=f.umod(e):f=f.clone();for(var o=new a(1),u=new a(0),p=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var m=0,l=1;(f.words[0]&l)===0&&m<26;++m,l<<=1);if(m>0)for(f.iushrn(m);m-- >0;)o.isOdd()&&o.iadd(p),o.iushrn(1);for(var n=0,d=1;(h.words[0]&d)===0&&n<26;++n,d<<=1);if(n>0)for(h.iushrn(n);n-- >0;)u.isOdd()&&u.iadd(p),u.iushrn(1);f.cmp(h)>=0?(f.isub(h),o.isub(u)):(h.isub(f),u.isub(o))}var M;return f.cmpn(1)===0?M=o:M=u,M.cmpn(0)<0&&M.iadd(e),M},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var f=this.clone(),h=e.clone();f.negative=0,h.negative=0;for(var o=0;f.isEven()&&h.isEven();o++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var u=f.cmp(h);if(u<0){var p=f;f=h,h=p}else if(u===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(o)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r(typeof e=="number");var f=e%26,h=(e-f)/26,o=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=o,this;for(var u=o,p=h;u!==0&&p<this.length;p++){var m=this.words[p]|0;m+=u,u=m>>>26,m&=67108863,this.words[p]=m}return u!==0&&(this.words[p]=u,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(e){var f=e<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(e=-e),r(e<=67108863,"Number is too big");var o=this.words[0]|0;h=o===e?0:o<e?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var f=this.ucmp(e);return this.negative!==0?-f|0:f},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var o=this.words[h]|0,u=e.words[h]|0;if(o!==u){o<u?f=-1:o>u&&(f=1);break}}return f},a.prototype.gtn=function(e){return this.cmpn(e)===1},a.prototype.gt=function(e){return this.cmp(e)===1},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return this.cmpn(e)===-1},a.prototype.lt=function(e){return this.cmp(e)===-1},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return this.cmpn(e)===0},a.prototype.eq=function(e){return this.cmp(e)===0},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var xt={k256:null,p224:null,p192:null,p25519:null};function Mt(v,e){this.name=v,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Mt.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},Mt.prototype.ireduce=function(e){var f=e,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var o=h<this.n?-1:f.ucmp(this.p);return o===0?(f.words[0]=0,f.length=1):o>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},Mt.prototype.split=function(e,f){e.iushrn(this.n,0,f)},Mt.prototype.imulK=function(e){return e.imul(this.k)};function At(){Mt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(At,Mt),At.prototype.split=function(e,f){for(var h=4194303,o=Math.min(e.length,9),u=0;u<o;u++)f.words[u]=e.words[u];if(f.length=o,e.length<=9){e.words[0]=0,e.length=1;return}var p=e.words[9];for(f.words[f.length++]=p&h,u=10;u<e.length;u++){var m=e.words[u]|0;e.words[u-10]=(m&h)<<4|p>>>22,p=m}p>>>=22,e.words[u-10]=p,p===0&&e.length>10?e.length-=10:e.length-=9},At.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var f=0,h=0;h<e.length;h++){var o=e.words[h]|0;f+=o*977,e.words[h]=f&67108863,f=o*64+(f/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function Tt(){Mt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Tt,Mt);function Bt(){Mt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Bt,Mt);function Pt(){Mt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(Pt,Mt),Pt.prototype.imulK=function(e){for(var f=0,h=0;h<e.length;h++){var o=(e.words[h]|0)*19+f,u=o&67108863;o>>>=26,e.words[h]=u,f=o}return f!==0&&(e.words[e.length++]=f),e},a._prime=function(e){if(xt[e])return xt[e];var f;if(e==="k256")f=new At;else if(e==="p224")f=new Tt;else if(e==="p192")f=new Bt;else if(e==="p25519")f=new Pt;else throw new Error("Unknown prime "+e);return xt[e]=f,f};function O(v){if(typeof v=="string"){var e=a._prime(v);this.m=e.p,this.prime=e}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}O.prototype._verify1=function(e){r(e.negative===0,"red works only with positives"),r(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,f){r((e.negative|f.negative)===0,"red works only with positives"),r(e.red&&e.red===f.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,f){this._verify2(e,f);var h=e.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},O.prototype.iadd=function(e,f){this._verify2(e,f);var h=e.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},O.prototype.sub=function(e,f){this._verify2(e,f);var h=e.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},O.prototype.isub=function(e,f){this._verify2(e,f);var h=e.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},O.prototype.shl=function(e,f){return this._verify1(e),this.imod(e.ushln(f))},O.prototype.imul=function(e,f){return this._verify2(e,f),this.imod(e.imul(f))},O.prototype.mul=function(e,f){return this._verify2(e,f),this.imod(e.mul(f))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var f=this.m.andln(3);if(r(f%2===1),f===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(e,h)}for(var o=this.m.subn(1),u=0;!o.isZero()&&o.andln(1)===0;)u++,o.iushrn(1);r(!o.isZero());var p=new a(1).toRed(this),m=p.redNeg(),l=this.m.subn(1).iushrn(1),n=this.m.bitLength();for(n=new a(2*n*n).toRed(this);this.pow(n,l).cmp(m)!==0;)n.redIAdd(m);for(var d=this.pow(n,o),M=this.pow(e,o.addn(1).iushrn(1)),y=this.pow(e,o),x=u;y.cmp(p)!==0;){for(var B=y,E=0;B.cmp(p)!==0;E++)B=B.redSqr();r(E<x);var k=this.pow(d,new a(1).iushln(x-E-1));M=M.redMul(k),d=k.redSqr(),y=y.redMul(d),x=E}return M},O.prototype.invm=function(e){var f=e._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},O.prototype.pow=function(e,f){if(f.isZero())return new a(1).toRed(this);if(f.cmpn(1)===0)return e.clone();var h=4,o=new Array(1<<h);o[0]=new a(1).toRed(this),o[1]=e;for(var u=2;u<o.length;u++)o[u]=this.mul(o[u-1],e);var p=o[0],m=0,l=0,n=f.bitLength()%26;for(n===0&&(n=26),u=f.length-1;u>=0;u--){for(var d=f.words[u],M=n-1;M>=0;M--){var y=d>>M&1;if(p!==o[0]&&(p=this.sqr(p)),y===0&&m===0){l=0;continue}m<<=1,m|=y,l++,!(l!==h&&(u!==0||M!==0))&&(p=this.mul(p,o[m]),l=0,m=0)}n=26}return p},O.prototype.convertTo=function(e){var f=e.umod(this.m);return f===e?f.clone():f},O.prototype.convertFrom=function(e){var f=e.clone();return f.red=null,f},a.mont=function(e){return new St(e)};function St(v){O.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(St,O),St.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},St.prototype.convertFrom=function(e){var f=this.imod(e.mul(this.rinv));return f.red=null,f},St.prototype.imul=function(e,f){if(e.isZero()||f.isZero())return e.words[0]=0,e.length=1,e;var h=e.imul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.mul=function(e,f){if(e.isZero()||f.isZero())return new a(0)._forceRed(this);var h=e.mul(f),o=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=h.isub(o).iushrn(this.shift),p=u;return u.cmp(this.m)>=0?p=u.isub(this.m):u.cmpn(0)<0&&(p=u.iadd(this.m)),p._forceRed(this)},St.prototype.invm=function(e){var f=this.imod(e._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof eu>"u"||eu,gg)});var ru=I((OA,bg)=>{"use strict";var yg=W0(),b7=It().Buffer;function w7(i,t){return b7.from(i.toRed(yg.mont(t.modulus)).redPow(new yg(t.publicExponent)).fromRed().toArray())}bg.exports=w7});var _g=I((FA,xg)=>{"use strict";var M7=Ja(),iu=Ui(),x7=bn(),wg=Qh(),Mg=tu(),nu=W0(),_7=ru(),S7=w0(),Lr=It().Buffer;xg.exports=function(t,r,s){var a;t.padding?a=t.padding:s?a=1:a=4;var c=M7(t),g;if(a===4)g=A7(c,r);else if(a===1)g=B7(c,r,s);else if(a===3){if(g=new nu(r),g.cmp(c.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return s?S7(g,c):_7(g,c)};function A7(i,t){var r=i.modulus.byteLength(),s=t.length,a=x7("sha1").update(Lr.alloc(0)).digest(),c=a.length,g=2*c;if(s>r-g-2)throw new Error("message too long");var b=Lr.alloc(r-s-g-2),w=r-c-1,_=iu(c),S=Mg(Lr.concat([a,b,Lr.alloc(1,1),t],w),wg(_,w)),A=Mg(_,wg(S,c));return new nu(Lr.concat([Lr.alloc(1),A,S],r))}function B7(i,t,r){var s=t.length,a=i.modulus.byteLength();if(s>a-11)throw new Error("message too long");var c;return r?c=Lr.alloc(a-s-3,255):c=E7(a-s-3),new nu(Lr.concat([Lr.from([0,r?1:2]),c,Lr.alloc(1),t],a))}function E7(i){for(var t=Lr.allocUnsafe(i),r=0,s=iu(i*2),a=0,c;r<i;)a===s.length&&(s=iu(i*2),a=0),c=s[a++],c&&(t[r++]=c);return t}});var kg=I((UA,Eg)=>{"use strict";var k7=Ja(),Sg=Qh(),Ag=tu(),Bg=W0(),q7=w0(),I7=bn(),R7=ru(),tf=It().Buffer;Eg.exports=function(t,r,s){var a;t.padding?a=t.padding:s?a=1:a=4;var c=k7(t),g=c.modulus.byteLength();if(r.length>g||new Bg(r).cmp(c.modulus)>=0)throw new Error("decryption error");var b;s?b=R7(new Bg(r),c):b=q7(r,c);var w=tf.alloc(g-b.length);if(b=tf.concat([w,b],g),a===4)return T7(c,b);if(a===1)return P7(c,b,s);if(a===3)return b;throw new Error("unknown padding")};function T7(i,t){var r=i.modulus.byteLength(),s=I7("sha1").update(tf.alloc(0)).digest(),a=s.length;if(t[0]!==0)throw new Error("decryption error");var c=t.slice(1,a+1),g=t.slice(a+1),b=Ag(c,Sg(g,a)),w=Ag(g,Sg(b,r-a-1));if(C7(s,w.slice(0,a)))throw new Error("decryption error");for(var _=a;w[_]===0;)_++;if(w[_++]!==1)throw new Error("decryption error");return w.slice(_)}function P7(i,t,r){for(var s=t.slice(0,2),a=2,c=0;t[a++]!==0;)if(a>=t.length){c++;break}var g=t.slice(2,a-1);if((s.toString("hex")!=="0002"&&!r||s.toString("hex")!=="0001"&&r)&&c++,g.length<8&&c++,c)throw new Error("decryption error");return t.slice(a)}function C7(i,t){i=tf.from(i),t=tf.from(t);var r=0,s=i.length;i.length!==t.length&&(r++,s=Math.min(i.length,t.length));for(var a=-1;++a<s;)r+=i[a]^t[a];return r}});var qg=I(dn=>{"use strict";dn.publicEncrypt=_g();dn.privateDecrypt=kg();dn.privateEncrypt=function(t,r){return dn.publicEncrypt(t,r,!0)};dn.publicDecrypt=function(t,r){return dn.privateDecrypt(t,r,!0)}});var Fg=I(ef=>{"use strict";function Ig(){throw new Error(`secure random number generation not supported by this browser
6
- use chrome, FireFox or Internet Explorer 11`)}var Tg=It(),Rg=Ui(),Pg=Tg.Buffer,Cg=Tg.kMaxLength,au=global.crypto||global.msCrypto,Dg=Math.pow(2,32)-1;function Ng(i,t){if(typeof i!="number"||i!==i)throw new TypeError("offset must be a number");if(i>Dg||i<0)throw new TypeError("offset must be a uint32");if(i>Cg||i>t)throw new RangeError("offset out of range")}function Lg(i,t,r){if(typeof i!="number"||i!==i)throw new TypeError("size must be a number");if(i>Dg||i<0)throw new TypeError("size must be a uint32");if(i+t>r||i>Cg)throw new RangeError("buffer too small")}au&&au.getRandomValues||!process.browser?(ef.randomFill=D7,ef.randomFillSync=N7):(ef.randomFill=Ig,ef.randomFillSync=Ig);function D7(i,t,r,s){if(!Pg.isBuffer(i)&&!(i instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof t=="function")s=t,t=0,r=i.length;else if(typeof r=="function")s=r,r=i.length-t;else if(typeof s!="function")throw new TypeError('"cb" argument must be a function');return Ng(t,i.length),Lg(r,t,i.length),Og(i,t,r,s)}function Og(i,t,r,s){if(process.browser){var a=i.buffer,c=new Uint8Array(a,t,r);if(au.getRandomValues(c),s){process.nextTick(function(){s(null,i)});return}return i}if(s){Rg(r,function(b,w){if(b)return s(b);w.copy(i,t),s(null,i)});return}var g=Rg(r);return g.copy(i,t),i}function N7(i,t,r){if(typeof t>"u"&&(t=0),!Pg.isBuffer(i)&&!(i instanceof global.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return Ng(t,i.length),r===void 0&&(r=i.length-t),Lg(r,t,i.length),Og(i,t,r)}});var Ds=I(Ct=>{"use strict";Ct.randomBytes=Ct.rng=Ct.pseudoRandomBytes=Ct.prng=Ui();Ct.createHash=Ct.Hash=bn();Ct.createHmac=Ct.Hmac=Co();var L7=Rl(),O7=Object.keys(L7),F7=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(O7);Ct.getHashes=function(){return F7};var Ug=us();Ct.pbkdf2=Ug.pbkdf2;Ct.pbkdf2Sync=Ug.pbkdf2Sync;var ii=yp();Ct.Cipher=ii.Cipher;Ct.createCipher=ii.createCipher;Ct.Cipheriv=ii.Cipheriv;Ct.createCipheriv=ii.createCipheriv;Ct.Decipher=ii.Decipher;Ct.createDecipher=ii.createDecipher;Ct.Decipheriv=ii.Decipheriv;Ct.createDecipheriv=ii.createDecipheriv;Ct.getCiphers=ii.getCiphers;Ct.listCiphers=ii.listCiphers;var rf=Pp();Ct.DiffieHellmanGroup=rf.DiffieHellmanGroup;Ct.createDiffieHellmanGroup=rf.createDiffieHellmanGroup;Ct.getDiffieHellman=rf.getDiffieHellman;Ct.createDiffieHellman=rf.createDiffieHellman;Ct.DiffieHellman=rf.DiffieHellman;var V0=ug();Ct.createSign=V0.createSign;Ct.Sign=V0.Sign;Ct.createVerify=V0.createVerify;Ct.Verify=V0.Verify;Ct.createECDH=pg();var j0=qg();Ct.publicEncrypt=j0.publicEncrypt;Ct.privateEncrypt=j0.privateEncrypt;Ct.publicDecrypt=j0.publicDecrypt;Ct.privateDecrypt=j0.privateDecrypt;var Kg=Fg();Ct.randomFill=Kg.randomFill;Ct.randomFillSync=Kg.randomFillSync;Ct.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
7
- we accept pull requests
8
- https://github.com/browserify/crypto-browserify`)};Ct.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}});import oa from"bignumber.js";var qt=class i extends Error{constructor(r,s,a){super(r);this.code=s;this.details=a;this.name="GSwapSDKError"}static noSignerError(){return new i("This method requires a signer. Please provide a signer to the GSwap constructor.","NO_SIGNER")}static async fromErrorResponse(r,s){let a=await s.text(),c=(()=>{try{return JSON.parse(a)}catch{return}})(),g=typeof c=="object"&&c&&"error"in c&&typeof c.error=="object"&&c.error&&"ErrorKey"in c.error&&typeof c.error.ErrorKey=="string"?c.error.ErrorKey:void 0,b=typeof c=="object"&&c&&"error"in c&&typeof c.error=="object"&&c.error&&"Message"in c.error&&typeof c.error.Message=="string"?c.error.Message:void 0;return g&&b?new i(`GalaChain Error ${g} from ${r}: ${b}`,g,{message:b,errorKey:g,status:s.status,body:c,url:r}):new i(`Unexpected HTTP Error ${s.status} from ${r}`,"HTTP_ERROR",{status:s.status,body:c??a,url:r})}static incorrectTokenOrderingError(r,s){return new i("Token ordering is incorrect. token0 should sort below token1.","INCORRECT_TOKEN_ORDERING",{specifiedToken0:r,specifiedToken1:s})}static transactionWaitTimeoutError(r){return new i("Transaction wait timed out.","TRANSACTION_WAIT_TIMEOUT",{txId:r})}static transactionWaitFailedError(r,s){let a="transactionId"in s&&typeof s.transactionId=="string"?s.transactionId:void 0,{transactionId:c,...g}=s;return new i("Transaction wait failed.","TRANSACTION_WAIT_FAILED",{txId:r,transactionHash:a,...g})}static socketConnectionRequiredError(){return new i("This method requires a socket connection. Did you call connectSocket()?","SOCKET_CONNECTION_REQUIRED")}static noPoolAvailableError(r,s,a){let c=a!==void 0?`No pool available for the specified token pair at fee tier ${a}`:"No pools available for the specified token pair";return new i(c,"NO_POOL_AVAILABLE",{tokenIn:r,tokenOut:s,fee:a})}};function $t(i,t,r=!1){let s=oa(i);if(!s.isFinite())throw new qt(`Invalid ${t}: must be a finite number`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:t,value:i,reason:"not_finite"});if(!r&&s.isZero())throw new qt(`Invalid ${t}: must be positive`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:t,value:i,reason:"zero_not_allowed"});if(s.isNegative())throw new qt(`Invalid ${t}: must be ${r?"non-negative":"positive"}`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:t,value:i,reason:"negative"})}function hu(i,t,r){let s=oa(i),a=oa(t),c=oa(r);if(c=c.isFinite()?c:oa(1e18),!s.isFinite()||!a.isFinite()||!c.isFinite()||!s.isPositive()||!a.isPositive()||!c.isPositive())throw new qt("Invalid price values: all prices must be finite and positive","VALIDATION_ERROR",{type:"INVALID_PRICE_VALUES",spotPrice:i,lowerPrice:t,upperPrice:r});if(a.isGreaterThan(c))throw new qt("Invalid price range: lower price must be less than or equal to upper price","VALIDATION_ERROR",{type:"INVALID_PRICE_RANGE",lowerPrice:t,upperPrice:r})}function oo(i,t){if(i<0||!Number.isInteger(i))throw new qt(`Invalid ${t}: must be a non-negative integer`,"VALIDATION_ERROR",{type:"INVALID_TOKEN_DECIMALS",parameterName:t,value:i})}function sa(i,t){if(!Number.isInteger(i)||!Number.isInteger(t))throw new qt("Invalid tick values: ticks must be integers","VALIDATION_ERROR",{type:"INVALID_TICK_VALUES",tickLower:i,tickUpper:t});if(i>=t)throw new qt("Invalid tick range: tickLower must be less than tickUpper","VALIDATION_ERROR",{type:"INVALID_TICK_RANGE",tickLower:i,tickUpper:t});if(i<-886800||t>886800)throw new qt("Invalid tick range: ticks must be between -886800 and 886800","VALIDATION_ERROR",{type:"INVALID_TICK_BOUNDS",tickLower:i,tickUpper:t,minTick:-886800,maxTick:886800})}function Or(i){if(!Number.isInteger(i)||i<0)throw new qt("Invalid fee: must be a non-negative integer","VALIDATION_ERROR",{type:"INVALID_FEE",value:i})}function af(i){if(!Number.isInteger(i)||i<=0)throw new qt("Invalid tick spacing: must be a positive integer","VALIDATION_ERROR",{type:"INVALID_TICK_SPACING",value:i})}function Fr(i){if(i===void 0)throw new qt("Invalid wallet address: No wallet address provided","VALIDATION_ERROR",{type:"MISSING_WALLET_ADDRESS",hint:"Either provide a wallet address to the function you are calling, or set one when instantiating GSwapSDK"});if(!i||typeof i!="string"||i.trim().length===0)throw new qt("Invalid wallet address: must be a non-empty string","VALIDATION_ERROR",{type:"INVALID_WALLET_ADDRESS",value:i})}var ff=class{constructor(t,r){this.dexBackendBaseUrl=t;this.httpClient=r}async getUserAssets(t,r=1,s=10){if(Fr(t),!Number.isInteger(r)||r<1)throw new Error("Invalid page: must be a positive integer");if(!Number.isInteger(s)||s<1||s>100)throw new Error("Invalid limit: must be an integer between 1 and 100");let a=await this.httpClient.sendGetRequest(this.dexBackendBaseUrl,"/user/assets","",{address:t,page:r.toString(),limit:s.toString()});return{tokens:a.data.token.map(c=>({...c,decimals:parseInt(c.decimals,10)}))||[],count:a.data.count||0}}};var $g=su(Ds(),1);import U7 from"debug";var xi=U7("GSWAP_SDK");var zg=su(o0(),1);import{io as K7}from"socket.io-client";var fu=class extends zg.EventEmitter{},J0=class extends fu{constructor(r){super();Dt(this,"socket",null);Dt(this,"bundlerUrl");this.bundlerUrl=r}connect(){return new Promise((r,s)=>{if(this.socket?.connected){r();return}this.socket=K7(this.bundlerUrl,{transports:["websocket"],autoConnect:!0}),this.socket.on("connect",()=>{console.log("Connected to bundler socket:",this.bundlerUrl),this.emit("connect"),r()}),this.socket.on("connect_error",a=>{console.error("Failed to connect to bundler socket:",a),this.emit("error",a),s(a)}),this.socket.on("disconnect",a=>{console.log("Disconnected from bundler socket:",a),this.emit("disconnect",a)}),this.socket.onAny((a,...c)=>{if(typeof a=="string"){let[g]=c;this.emit("transaction",a,{...g,transactionHash:g.data?.transactionId})}})})}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.socket?.connected??!1}};var nf=class{constructor(){Dt(this,"enabled",!1);Dt(this,"promiseInfoForTxId",new Map)}setEnabled(t){if(this.enabled=t,!t){for(let[r,s]of this.promiseInfoForTxId.entries())clearTimeout(s.timeoutId),s.reject(qt.transactionWaitFailedError(r,{message:"Transaction waiter disabled"}));this.promiseInfoForTxId.clear()}}registerTxId(t,r){if(this.promiseInfoForTxId.has(t))throw new qt("Transaction ID is already registered","TRANSACTION_ID_ALREADY_REGISTERED",{txId:t});if(!this.enabled)return;let s,a,c=new Promise((b,w)=>{s=b,a=w}),g=setTimeout(()=>{let b=this.promiseInfoForTxId.get(t);b&&(b.waited?b.reject(qt.transactionWaitTimeoutError(t)):b.resolve({txId:t,transactionHash:t,Data:{}}),this.promiseInfoForTxId.delete(t))},r);this.promiseInfoForTxId.set(t,{promise:c,resolve:s,reject:a,timeoutId:g,waited:!1})}wait(t){let r=this.promiseInfoForTxId.get(t);if(!r)throw new qt("Transaction ID is not registered for waiting","TRANSACTION_ID_NOT_REGISTERED",{txId:t});return r.waited=!0,r.promise}notifySuccess(t,r){let s=this.promiseInfoForTxId.get(t);s&&(clearTimeout(s.timeoutId),s.resolve({txId:t,transactionHash:r.transactionId,Data:r.Data}),this.promiseInfoForTxId.delete(t))}notifyFailure(t,r){let s=this.promiseInfoForTxId.get(t);s&&(clearTimeout(s.timeoutId),s.waited?s.reject(qt.transactionWaitFailedError(t,r)):s.resolve({txId:t,transactionHash:t,Data:{}}),this.promiseInfoForTxId.delete(t))}};var na=class na{constructor(){Dt(this,"globalSocketClient");Dt(this,"globalWaitHelper",new nf);Dt(this,"connectionPromise")}async connectEventSocket(t){if(this.connectionPromise)return this.connectionPromise;if(this.globalSocketClient?.isConnected())return this.globalSocketClient;let r=t??"https://bundle-backend-prod1.defi.gala.com";return this.connectionPromise=(async()=>{let s=new na.tradeEventEmitterConstructor(r);return await s.connect(),this.globalWaitHelper||(this.globalWaitHelper=new nf),s.on("transaction",this.internalHandleSocketMessage.bind(this)),s})(),this.globalSocketClient=await this.connectionPromise,this.connectionPromise=void 0,this.globalWaitHelper.setEnabled(!0),this.globalSocketClient}disconnectEventSocket(){this.globalSocketClient&&(this.globalSocketClient.off("transaction",this.internalHandleSocketMessage.bind(this)),this.globalSocketClient.disconnect(),this.globalSocketClient=void 0,this.globalWaitHelper.setEnabled(!1))}eventSocketConnected(){return this.globalSocketClient?.isConnected()??!1}registerTxId(t,r){this.globalWaitHelper.registerTxId(t,r)}async wait(t){if(!this.eventSocketConnected())throw qt.socketConnectionRequiredError();return this.globalWaitHelper.wait(t)}internalHandleSocketMessage(t,r){r.status==="PROCESSED"?this.globalWaitHelper.notifySuccess(t,r.data):r.status==="FAILED"?this.globalWaitHelper.notifyFailure(t,r.data):xi(`Unknown response status for transaction ${t}:`,r.status)}};Dt(na,"instance",new na),Dt(na,"tradeEventEmitterConstructor",J0);var cn=na;var X0=class{constructor(t,r,s,a){this.transactionId=t;this.message=r;this.error=s;this.waitDelegate=a}wait(){return this.waitDelegate()}};function z7(){return globalThis.crypto?globalThis.crypto.randomUUID():$g.default.randomUUID()}var Y0=class{constructor(t,r,s,a,c){this.bundlerBaseUrl=t;this.bundlingAPIBasePath=r;this.transactionWaitTimeoutMs=s;this.signer=a;this.httpClient=c}async signObject(t,r){if(!this.signer)throw qt.noSignerError();let s={...r,uniqueKey:r.uniqueKey??`galaswap - operation - ${z7()}`};return xi("Signing object for method",t,s),this.signer.signObject(t,s)}async sendBundlerRequest(t,r,s){if(!this.hasSigner())throw qt.noSignerError();let a={method:t,signedDto:await this.signObject(t,r),stringsInstructions:s};xi("Sending bundler request",t,a);let c=await this.httpClient.sendPostRequest(this.bundlerBaseUrl,this.bundlingAPIBasePath,"",a);return xi("Received bundler response",t,c),cn.instance.registerTxId(c.data,this.transactionWaitTimeoutMs),new X0(c.data,c.message,c.error,()=>cn.instance.wait(c.data))}hasSigner(){return this.signer!==void 0}};var aa=class{constructor(t=fetch){this.httpRequestor=t}async sendRequest(t,r,s,a,c){let g=`${r}${s}${a}`;xi(`Sending request to ${g} with body:`,c);let b=await this.httpRequestor(g,{method:t,headers:{"Content-Type":"application/json","User-Agent":"GalaChain-SDK/0.0"},...c?{body:JSON.stringify(c)}:{}});if(!b.ok)throw await qt.fromErrorResponse(g,b);let w=await b.json();return xi(`Response from ${r}${s}${a}:`,w),w}async sendPostRequest(t,r,s,a){return this.sendRequest("POST",t,r,s,a)}async sendGetRequest(t,r,s,a){let c=a?new URLSearchParams(a):void 0,g=c?`${s}?${c.toString()}`:s;return this.sendRequest("GET",t,r,g,void 0)}};import hr from"bignumber.js";function rr(i,t="|"){return typeof i=="string"?i:`${i.collection}${t}${i.category}${t}${i.type}${t}${i.additionalKey}`}function ve(i){if(typeof i=="object")return{collection:i.collection,category:i.category,type:i.type,additionalKey:i.additionalKey};let[t,r,s,a]=i.split("|");if(!t||!r||!s||!a)throw new qt("Invalid token class key","INVALID_TOKEN_CLASS_KEY",{tokenClassKey:i});return{collection:t,category:r,type:s,additionalKey:a}}function $7(i,t){return rr(i).localeCompare(rr(t))}function pr(i,t,r,s,a){let c=$7(i,t)<0;if(c)return{token0:i,token1:t,zeroForOne:c,token0Attributes:s,token1Attributes:a};if(r)throw qt.incorrectTokenOrderingError(i,t);return{token0:t,token1:i,zeroForOne:c,token0Attributes:a,token1Attributes:s}}var Q0=class{constructor(t,r,s){this.gatewayBaseUrl=t;this.dexContractBasePath=r;this.httpClient=s}async getPoolData(t,r,s){Or(s);let a=ve(t),c=ve(r),g=pr(a,c,!1),w=(await this.httpClient.sendPostRequest(this.gatewayBaseUrl,this.dexContractBasePath,"/GetPoolData",{token0:g.token0,token1:g.token1,fee:s})).Data;return{bitmap:w.bitmap,fee:w.fee,feeGrowthGlobal0:hr(w.feeGrowthGlobal0),feeGrowthGlobal1:hr(w.feeGrowthGlobal1),grossPoolLiquidity:hr(w.grossPoolLiquidity),liquidity:hr(w.liquidity),maxLiquidityPerTick:hr(w.maxLiquidityPerTick),protocolFees:w.protocolFees,protocolFeesToken0:hr(w.protocolFeesToken0),protocolFeesToken1:hr(w.protocolFeesToken1),sqrtPrice:hr(w.sqrtPrice),tickSpacing:w.tickSpacing,token0:w.token0,token0ClassKey:w.token0ClassKey,token1:w.token1,token1ClassKey:w.token1ClassKey}}calculateTicksForPrice(t,r){$t(t,"price",!0),af(r);let s=hr(t).toNumber();if(s===0)return-886800;if(s===1/0)return 886800;let a=Math.round(Math.log(s)/Math.log(1.0001)),c=Math.floor(a/r)*r;return Math.min(Math.max(c,-886800),886800)}calculatePriceForTicks(t){if(t===-886800)return hr("0");if(t===886800)return hr(1/0);{let r=Math.pow(1.0001,t);return hr(r)}}calculateSpotPrice(t,r,s){$t(s,"poolSqrtPrice");let a=pr(t,r,!1),c=hr(s).pow(2);return a.zeroForOne?c:hr(1).div(c)}};import Zt from"bignumber.js";var to=class{constructor(t,r,s,a,c,g){this.gatewayBaseUrl=t;this.dexContractBasePath=r;this.options=g;Dt(this,"httpClient");Dt(this,"bundlerService");Dt(this,"poolService");this.httpClient=c,this.bundlerService=s,this.poolService=a}async getUserPositions(t,r,s){let a=await this.sendUserPositionsRequest("/GetUserPositions",{user:t,limit:r,bookmark:s});return{bookmark:a.nextBookMark,positions:a.positions}}async getPosition(t,r){return await this.sendPositionRequest("/GetPositions",{owner:t,token0:ve(r.token0ClassKey),token1:ve(r.token1ClassKey),fee:r.fee,tickLower:r.tickLower,tickUpper:r.tickUpper})}async estimateRemoveLiquidity(t){Fr(t.ownerAddress),Or(t.fee),sa(t.tickLower,t.tickUpper),$t(t.amount,"amount");let r=ve(t.token0),s=ve(t.token1),a=pr(r,s,!1),c=await this.httpClient.sendPostRequest(this.gatewayBaseUrl,this.dexContractBasePath,"/GetRemoveLiquidityEstimation",{tickLower:t.tickLower,tickUpper:t.tickUpper,amount:Zt(t.amount).toFixed(),token0:a.token0,token1:a.token1,fee:t.fee,owner:t.ownerAddress,positionId:t.positionId});return{amount0:Zt(c.Data.amount0),amount1:Zt(c.Data.amount1)}}async getPositionById(t,r){let a=(await this.getUserPositions(t)).positions.find(c=>c.positionId===r);if(a)return this.getPosition(t,a)}async addLiquidityByTicks(t){let r=t.walletAddress??this.options?.walletAddress;Fr(r),Or(t.fee),sa(t.tickLower,t.tickUpper),$t(t.amount0Desired,"amount0Desired",!0),$t(t.amount1Desired,"amount1Desired",!0),$t(t.amount0Min,"amount0Min",!0),$t(t.amount1Min,"amount1Min",!0);let s=ve(t.token0),a=ve(t.token1),c=pr(s,a,!0,[t.amount0Desired,t.amount0Min],[t.amount1Desired,t.amount1Min]),g={token0:c.token0,token1:c.token1,fee:t.fee,owner:t.walletAddress,tickLower:t.tickLower,tickUpper:t.tickUpper,amount0Desired:Zt(c.token0Attributes[0]).toFixed(),amount1Desired:Zt(c.token1Attributes[0]).toFixed(),amount0Min:Zt(c.token0Attributes[1]).toFixed(),amount1Min:Zt(c.token1Attributes[1]).toFixed(),positionId:t.positionId,liquidityProvider:t.walletAddress},b=rr(c.token0,"$"),w=rr(c.token1,"$"),_=`$pool$${b}$${w}$${t.fee}`,S=`$userPosition$${t.walletAddress}`,A=`$tokenBalance$${b}$${t.walletAddress}`,q=`$tokenBalance$${w}$${t.walletAddress}`,R=`$tokenBalance$${b}$${_}`,N=`$tokenBalance$${w}$${_}`,bt=[_,S,A,q,R,N];return this.bundlerService.sendBundlerRequest("AddLiquidity",g,bt)}async addLiquidityByPrice(t){let r=t.walletAddress??this.options?.walletAddress;if(Fr(r),Or(t.fee),af(t.tickSpacing),$t(t.minPrice,"minPrice",!0),$t(t.maxPrice,"maxPrice"),$t(t.amount0Desired,"amount0Desired",!0),$t(t.amount1Desired,"amount1Desired",!0),$t(t.amount0Min,"amount0Min",!0),$t(t.amount1Min,"amount1Min",!0),Zt(t.minPrice).isGreaterThan(Zt(t.maxPrice)))throw new Error("Invalid price range: minPrice must be less than or equal to maxPrice");let s=ve(t.token0),a=ve(t.token1),c=pr(s,a,!0,[t.amount0Desired,t.amount0Min],[t.amount1Desired,t.amount1Min]),g=this.poolService.calculateTicksForPrice(t.minPrice,t.tickSpacing),b=this.poolService.calculateTicksForPrice(t.maxPrice,t.tickSpacing),w=c.zeroForOne?g:b*-1,_=c.zeroForOne?b:g*-1,S={token0:c.token0,token1:c.token1,fee:t.fee,owner:t.walletAddress,tickLower:w,tickUpper:_,amount0Desired:c?.token0Attributes?.[0],amount1Desired:c?.token1Attributes?.[0],amount0Min:c?.token0Attributes?.[1],amount1Min:c?.token1Attributes?.[1],positionId:t.positionId},A=rr(c.token0,"$"),q=rr(c.token1,"$"),R=`$pool$${A}$${q}$${t.fee}`,N=`$userPosition$${t.walletAddress}`,bt=`$tokenBalance$${A}$${t.walletAddress}`,_t=`$tokenBalance$${q}$${t.walletAddress}`,gt=`$tokenBalance$${A}$${R}`,xt=`$tokenBalance$${q}$${R}`,Mt=[R,N,bt,_t,gt,xt];return this.bundlerService.sendBundlerRequest("AddLiquidity",S,Mt)}async removeLiquidity(t){let r=t.walletAddress??this.options?.walletAddress;Fr(r),Or(t.fee),sa(t.tickLower,t.tickUpper),$t(t.amount,"amount"),t.amount0Min!==void 0&&$t(t.amount0Min,"amount0Min",!0),t.amount1Min!==void 0&&$t(t.amount1Min,"amount1Min",!0);let s=ve(t.token0),a=ve(t.token1),c=pr(s,a,!0,[t.amount0Min??0],[t.amount1Min??0]),g={token0:c.token0,token1:c.token1,fee:t.fee,tickLower:t.tickLower,tickUpper:t.tickUpper,amount:Zt(t.amount).toFixed(),amount0Min:c?.token0Attributes?.[0]||"0",amount1Min:c?.token1Attributes?.[0]||"0",positionId:t.positionId,recipient:t.walletAddress},b=rr(c.token0,"$"),w=rr(c.token1,"$"),_=`$pool$${b}$${w}$${t.fee}`,S=`$userPosition$${t.walletAddress}`,A=`$tokenBalance$${b}$${t.walletAddress}`,q=`$tokenBalance$${w}$${t.walletAddress}`,R=`$tokenBalance$${b}$${_}`,N=`$tokenBalance$${w}$${_}`,bt=[_,S,A,q,R,N];return this.bundlerService.sendBundlerRequest("RemoveLiquidity",g,bt)}async collectPositionFees(t){let r=t.walletAddress??this.options?.walletAddress;Fr(r),Or(t.fee),sa(t.tickLower,t.tickUpper),$t(t.amount0Requested,"amount0Requested",!0),$t(t.amount1Requested,"amount1Requested",!0);let s=ve(t.token0),a=ve(t.token1),c=pr(s,a,!0,[t.amount0Requested],[t.amount1Requested]),g={token0:c.token0,token1:c.token1,fee:t.fee,amount0Requested:Zt(c.token0Attributes[0]).toFixed(),amount1Requested:Zt(c.token1Attributes[0]).toFixed(),tickLower:t.tickLower,tickUpper:t.tickUpper,positionId:t.positionId,recipient:t.walletAddress},b=rr(c.token0,"$"),w=rr(c.token1,"$"),_=`$pool$${b}$${w}$${t.fee}`,S=`$userPosition$${t.walletAddress}`,A=`$tokenBalance$${b}$${t.walletAddress}`,q=`$tokenBalance$${w}$${t.walletAddress}`,R=`$tokenBalance$${b}$${_}`,N=`$tokenBalance$${w}$${_}`,bt=[_,S,A,q,R,N];return this.bundlerService.sendBundlerRequest("CollectPositionFees",g,bt)}calculateOptimalPositionSize(t,r,s,a,c,g){$t(t,"tokenAmount"),hu(r,s,a),oo(c,"tokenDecimals"),oo(g,"otherTokenDecimals");let b=Zt(t),w=Zt(r),_=Zt(s),S=Zt(a);S=S.isFinite()?S:Zt(1e18);let A=b.times(10**(c-g)).times(w.sqrt()).times(S.sqrt()).div(S.sqrt().minus(w.sqrt())),R=Zt(A).times(w.sqrt().minus(_.sqrt())).div(Zt(10).pow(c-g));return Zt.max(Zt(R.toFixed(g,Zt.ROUND_DOWN)),0)}async sendUserPositionsRequest(t,r){let s=await this.httpClient.sendPostRequest(this.gatewayBaseUrl,this.dexContractBasePath,t,r);return{nextBookMark:s.Data.nextBookMark,positions:s.Data.positions.map(a=>({...a,liquidity:Zt(a.liquidity)}))}}async sendPositionRequest(t,r){let s=await this.httpClient.sendPostRequest(this.gatewayBaseUrl,this.dexContractBasePath,t,r);return{...s.Data,feeGrowthInside0Last:Zt(s.Data.feeGrowthInside0Last),feeGrowthInside1Last:Zt(s.Data.feeGrowthInside1Last),liquidity:Zt(s.Data.liquidity),tokensOwed0:Zt(s.Data.tokensOwed0),tokensOwed1:Zt(s.Data.tokensOwed1)}}};import Ni from"bignumber.js";var Hg=(s=>(s[s.PERCENT_00_05=500]="PERCENT_00_05",s[s.PERCENT_00_30=3e3]="PERCENT_00_30",s[s.PERCENT_01_00=1e4]="PERCENT_01_00",s))(Hg||{});var eo=class{constructor(t,r,s){this.gatewayBaseUrl=t;this.dexContractBasePath=r;Dt(this,"httpClient");this.httpClient=s??new aa}async quoteExactInput(t,r,s,a){if($t(s,"amountIn"),a!==void 0)return await this.getSingleQuoteExactInput(t,r,a,s);let g=[500,3e3,1e4].map(async _=>{try{return await this.getSingleQuoteExactInput(t,r,_,s)}catch(S){if(S instanceof qt&&(S.code==="CONFLICT"||S.code==="OBJECT_NOT_FOUND"))return;throw S}}),w=(await Promise.all(g)).filter(_=>_!==void 0);if(w.length===0)throw qt.noPoolAvailableError(t,r);return w.reduce((_,S)=>S.outTokenAmount.isGreaterThan(_.outTokenAmount)?S:_)}async quoteExactOutput(t,r,s,a){if($t(s,"amountOut"),a!==void 0)return await this.getSingleQuoteExactOutput(t,r,s,a);let g=[500,3e3,1e4].map(async _=>{try{return await this.getSingleQuoteExactOutput(t,r,s,_)}catch(S){if(S instanceof qt&&(S.code==="CONFLICT"||S.code==="OBJECT_NOT_FOUND"))return;throw S}}),w=(await Promise.all(g)).filter(_=>_!==void 0);if(w.length===0)throw qt.noPoolAvailableError(t,r);return w.reduce((_,S)=>S.inTokenAmount.isLessThan(_.inTokenAmount)?S:_)}async getSingleQuote(t,r,s,a,c){let g=ve(t),b=ve(r),w=pr(g,b,!1),_=c?Ni(a).toFixed():Ni(a).multipliedBy(-1).toFixed(),S=await this.sendQuoteRequest("/QuoteExactAmount",{...w,fee:s,amount:_}),A=w.zeroForOne?S.amount0:S.amount1,q=w.zeroForOne?S.amount1:S.amount0,R=S.currentSqrtPrice.pow(2),N=S.newSqrtPrice.pow(2);w.zeroForOne||(R=Ni(1).dividedBy(R),N=Ni(1).dividedBy(N));let bt=N.minus(R).dividedBy(R);return{amount0:S.amount0,amount1:S.amount1,currentPoolSqrtPrice:S.currentSqrtPrice,newPoolSqrtPrice:S.newSqrtPrice,currentPrice:R,newPrice:N,inTokenAmount:A.abs(),outTokenAmount:q.abs(),priceImpact:bt,feeTier:s}}async getSingleQuoteExactInput(t,r,s,a){return this.getSingleQuote(t,r,s,a,!0)}async getSingleQuoteExactOutput(t,r,s,a){return this.getSingleQuote(t,r,a,s,!1)}async sendQuoteRequest(t,r){let a=await this.httpClient.sendPostRequest(this.gatewayBaseUrl,this.dexContractBasePath,t,r);return{amount0:Ni(a.Data.amount0),amount1:Ni(a.Data.amount1),currentSqrtPrice:Ni(a.Data.currentSqrtPrice),newSqrtPrice:Ni(a.Data.newSqrtPrice)}}};import fa from"bignumber.js";var H7="0.000000000000000000094212147",G7="18446050999999999999",ro=class{constructor(t,r){this.bundlerService=t;this.options=r}async swap(t,r,s,a,c){c=c??this.options?.walletAddress,Fr(c),Or(s),"exactIn"in a?($t(a.exactIn,"exactIn"),a.amountOutMinimum!==void 0&&$t(a.amountOutMinimum,"amountOutMinimum",!0)):($t(a.exactOut,"exactOut"),a.amountInMaximum!==void 0&&$t(a.amountInMaximum,"amountInMaximum"));let g=pr(t,r,!1),b=rr(t)===rr(g.token0),w="exactIn"in a?fa(a.exactIn).toFixed():fa(a.exactOut).multipliedBy(-1).toFixed(),_="exactIn"in a?a.amountOutMinimum?.toString()?fa(a.amountOutMinimum).multipliedBy(-1).toFixed():void 0:fa(a.exactOut??0).multipliedBy(-1).toFixed(),S="exactIn"in a?fa(a.exactIn).toFixed():a.amountInMaximum?fa(a.amountInMaximum).toFixed():void 0,A={token0:ve(g.token0),token1:ve(g.token1),fee:s,amount:w,zeroForOne:b,sqrtPriceLimit:g.zeroForOne?H7:G7,recipient:c,amountOutMinimum:_,amountInMaximum:S},q=rr(g.token0,"$"),R=rr(g.token1,"$"),N=`$pool$${q}$${R}$${s}`,bt=`$tokenBalance$${q}$${c}`,_t=`$tokenBalance$${R}$${c}`,gt=`$tokenBalance$${q}$${N}`,xt=`$tokenBalance$${R}$${N}`,Mt=[N,bt,_t,gt,xt];return this.bundlerService.sendBundlerRequest("Swap",A,Mt)}};var ou=class{constructor(t){Dt(this,"gatewayBaseUrl");Dt(this,"dexContractBasePath");Dt(this,"tokenContractBasePath");Dt(this,"bundlerBaseUrl");Dt(this,"bundlingAPIBasePath");Dt(this,"dexBackendBaseUrl");Dt(this,"transactionWaitTimeoutMs");Dt(this,"signer");Dt(this,"quoting");Dt(this,"positions");Dt(this,"swaps");Dt(this,"assets");Dt(this,"httpClient");Dt(this,"httpRequestor");Dt(this,"bundler");Dt(this,"pools");this.gatewayBaseUrl=t?.gatewayBaseUrl?.replace(/\/$/,"")??"https://gateway-mainnet.galachain.com",this.dexContractBasePath=t?.dexContractBasePath??"/api/asset/dexv3-contract",this.tokenContractBasePath=t?.tokenContractBasePath??"/api/asset/token-contract",this.bundlerBaseUrl=t?.bundlerBaseUrl??"https://bundle-backend-prod1.defi.gala.com",this.bundlingAPIBasePath=t?.bundlingAPIBasePath??"/bundle",this.dexBackendBaseUrl=t?.dexBackendBaseUrl??"https://dex-backend-prod1.defi.gala.com",this.signer=t?.signer,this.transactionWaitTimeoutMs=t?.transactionWaitTimeoutMs??3e5,this.httpRequestor=t?.httpRequestor??fetch.bind(globalThis),this.httpClient=new aa(this.httpRequestor),this.bundler=new Y0(this.bundlerBaseUrl,this.bundlingAPIBasePath,this.transactionWaitTimeoutMs,this.signer,this.httpClient),this.pools=new Q0(this.gatewayBaseUrl,this.dexContractBasePath,this.httpClient),this.quoting=new eo(this.gatewayBaseUrl,this.dexContractBasePath,this.httpClient),this.positions=new to(this.gatewayBaseUrl,this.dexContractBasePath,this.bundler,this.pools,this.httpClient,{walletAddress:t?.walletAddress}),this.swaps=new ro(this.bundler,{walletAddress:t?.walletAddress}),this.assets=new ff(this.dexBackendBaseUrl,this.httpClient)}};Dt(ou,"events",cn.instance);import{signatures as Gg}from"@gala-chain/api";import{calculatePersonalSignPrefix as Z7}from"@gala-chain/connect";var Zg=class{constructor(t){Dt(this,"keyBuffer");this.keyBuffer=Gg.normalizePrivateKey(t)}async signObject(t,r){let s=Gg.getSignature(r,this.keyBuffer);return{...r,signature:s}}},Wg=class i{constructor(t){this.walletAddress=t}async signObject(t,r){let s=global.gala;if(!s)throw new qt("Gala wallet is not available. Please ensure the Gala wallet is connected.","GALA_WALLET_NOT_AVAILABLE");let a={name:"ethereum",chainId:1},c=i.generateEIP712Types(t,r),g={domain:a,types:c,Primary_type:t,message:{...r,prefix:Z7(r)}};await s.setAddress(this.walletAddress);let b=await s.request({method:"eth_signTypedData",params:[JSON.stringify(g),this.walletAddress]});return{...r,domain:a,types:c,signature:b}}static generateEIP712Types(t,r){let s={};s[t]=[];function a(c,g,b,w=!1){if(g!==void 0)if(Array.isArray(g)){let _=a(c,g[0],b,!0);w||s[b].push({name:c,type:(_??c)+"[]"})}else if(typeof g=="object"&&g!==null){if(s[c])throw new qt("Name collisions not yet supported in EIP712 type generation","EIP712_NAME_COLLISION",{name:c});s[c]=[],Object.entries(g).forEach(([_,S])=>{a(_,S,c)}),w||s[b].push({name:c,type:c})}else{let _;switch(typeof g){case"string":_="string";break;case"number":_="int256";break;case"boolean":_="bool";break;default:throw new qt(`Unsupported type for EIP712 signing: ${typeof g}`,"EIP712_UNSUPPORTED_TYPE",{type:typeof g,value:g})}if(w)return _;s[b].push({name:c,type:_})}}return Object.entries(r).forEach(([c,g])=>{a(c,g,t)}),s}};export{ff as Assets,Y0 as Bundler,J0 as EventSocketClient,cn as Events,Hg as FEE_TIER,ou as GSwap,qt as GSwapSDKError,Wg as GalaWalletSigner,X0 as PendingTransaction,Q0 as Pools,to as Positions,Zg as PrivateKeySigner,eo as Quoting,ro as Swaps,fu as TradeEventEmitter,$7 as compareTokens,pr as getTokenOrdering,ve as parseTokenClassKey,rr as stringifyTokenClassKey,Or as validateFee,$t as validateNumericAmount,hu as validatePriceValues,sa as validateTickRange,af as validateTickSpacing,oo as validateTokenDecimals,Fr as validateWalletAddress};
9
- /*! Bundled license information:
10
-
11
- ieee754/index.js:
12
- (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
13
-
14
- buffer/index.js:
15
- (*!
16
- * The buffer module from node.js, for the browser.
17
- *
18
- * @author Feross Aboukhadijeh <https://feross.org>
19
- * @license MIT
20
- *)
21
-
22
- safe-buffer/index.js:
23
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
24
- */
1
+ var Ke=Object.defineProperty;var je=(t,e,n)=>e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var d=(t,e,n)=>je(t,typeof e!="symbol"?e+"":e,n);import x from"bignumber.js";var u=class t extends Error{constructor(n,i,r,o,a){super(n);d(this,"code",i);d(this,"details",r);d(this,"chainMessage");d(this,"retryAfterMs");this.name="GSwapSDKError",this.chainMessage=o,this.retryAfterMs=a}static noSignerError(){return new t("This method requires a signer. Please provide a signer to the GSwap constructor.","NO_SIGNER")}static noWalletAddressError(){return new t("Cannot confirm this write: no walletAddress was provided to the GSwap constructor, so the resulting position cannot be looked up to confirm it landed on chain.","NO_WALLET_ADDRESS")}static noPoolAvailableError(n,i,r){return new t("No pool is available for the requested pair.","NO_POOL_AVAILABLE",{tokenIn:n,tokenOut:i,...r===void 0?{}:{fee:r}})}static insufficientLiquidityError(n,i,r){return new t("The selected pool has insufficient liquidity for the requested quote.","INSUFFICIENT_LIQUIDITY",{tokenIn:n,tokenOut:i,...r===void 0?{}:{fee:r}})}static fromGatewayBounce(n,i,r,o){let a={status:r,chainMessage:i};o!==void 0&&(a.retryAfterMs=o);let s=n==="CHAIN_DISPATCH_FAILED"?i:`Gateway rejected ${n}: ${i}`;return new t(s,n,a,i,o)}static fromChainError(n,i,r){return new t(`GalaChain error ${n}: ${i}`,n,{...r,errorKey:n,message:i},i)}static unknownTokenError(n){let i=typeof n=="string"?n:JSON.stringify(n);return new t(`Token ${i} has no trading symbol on the new DEX contract (no gcdex pool includes it yet).`,"UNKNOWN_TOKEN",{token:n})}static confirmationTimeoutError(n,i){return new t("Transaction confirmation timed out; the trade may still apply. Confirm the same uniqueKey again later instead of resubmitting.","CONFIRMATION_TIMEOUT",{uniqueKey:n,...i===void 0?{}:{cause:i}})}static async fromErrorResponse(n,i){let r=await i.text(),o=re(r),a=R(o,"error"),s=p(a,"ErrorKey"),c=p(a,"Message");return s!==void 0&&c!==void 0?new t(`GalaChain Error ${s} from ${n}: ${c}`,s,{message:c,errorKey:s,status:i.status,body:o,url:n},c):new t(`Unexpected HTTP Error ${i.status} from ${n}`,"HTTP_ERROR",{status:i.status,body:o??r,url:n})}};function R(t,e){if(typeof t!="object"||t===null||!(e in t))return;let n=t[e];return typeof n=="object"&&n!==null?n:void 0}function p(t,e){if(typeof t!="object"||t===null||!(e in t))return;let n=t[e];return typeof n=="string"?n:void 0}function re(t){try{return JSON.parse(t)}catch{return}}var He=(r=>(r[r.PERCENT_00_00=0]="PERCENT_00_00",r[r.PERCENT_00_05=500]="PERCENT_00_05",r[r.PERCENT_00_30=3e3]="PERCENT_00_30",r[r.PERCENT_01_00=1e4]="PERCENT_01_00",r))(He||{}),L={0:200,500:10,3e3:60,1e4:200},B=[0,500,3e3,1e4];import M from"bignumber.js";import{Decimal as $e}from"decimal.js";var E=-887272,I=887272,Ve=M.clone({DECIMAL_PLACES:60,ROUNDING_MODE:M.ROUND_DOWN}),oe=$e.clone({precision:60});function le(t){return new M(new oe(1.0001).pow(t/2).toString())}function Bt(t){let e;try{e=new Ve(t)}catch{return Number.NaN}if(!e.isFinite()||e.isLessThanOrEqualTo(0))return Number.NaN;let n=Math.log(e.toNumber()**2)/Math.log(1.0001);if(!Number.isFinite(n))return Number.NaN;let i=Math.min(I,Math.max(E,Math.floor(n)));for(;i<I&&le(i+1).isLessThanOrEqualTo(e);)i+=1;for(;i>E&&le(i).isGreaterThan(e);)i-=1;return i}function se(t){let e=typeof t=="string"?t:typeof t=="number"||M.isBigNumber(t)?t.toString():"NaN",n=new oe(e);if(!n.isFinite()||n.lessThanOrEqualTo(0)||!Number.isFinite(n.toNumber()))return Number.NaN;let i=n.ln().dividedBy(new oe(1.0001).ln()).floor().toNumber();return Number.isFinite(i)?i:Number.NaN}function me(t,e){return fe(e),Math.floor(t/e)*e}function pe(t,e){return fe(e),Math.ceil(t/e)*e}function F(t,e,n){let i=L[n];if(i===void 0)throw new RangeError(`Unsupported fee tier: ${n}`);if(!Number.isInteger(t)||!Number.isInteger(e))throw new RangeError("Ticks must be integers");if(t<E||e>I||t>=e)throw new RangeError(`Tick range must satisfy ${E} <= lower < upper <= ${I}`);if(t%i!==0||e%i!==0)throw new RangeError(`Ticks must be aligned to spacing ${i}`)}function fe(t){if(!Number.isInteger(t)||t<=0)throw new RangeError("Tick spacing must be positive")}function y(t,e,n=!1){if(typeof t=="number")throw new u(`Invalid ${e}: use a decimal string or BigNumber, not a JavaScript number`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:e,value:t,reason:"number_input"});let i;try{i=x(t)}catch{i=x(NaN)}if(!i.isFinite())throw new u(`Invalid ${e}: must be a finite number`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:e,value:t,reason:"not_finite"});if(!n&&i.isZero())throw new u(`Invalid ${e}: must be positive`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:e,value:t,reason:"zero_not_allowed"});if(i.isNegative())throw new u(`Invalid ${e}: must be ${n?"non-negative":"positive"}`,"VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",parameterName:e,value:t,reason:"negative"})}function jt(t,e,n){if([t,e,n].some(s=>typeof s=="number"))throw new u("Invalid price values: use decimal strings or BigNumber values, not JavaScript numbers","VALIDATION_ERROR",{type:"INVALID_NUMERIC_AMOUNT",reason:"number_input"});let i=s=>{try{return x(s)}catch{return x(NaN)}},r=i(t),o=i(e),a=i(n);if(a=a.isFinite()?a:x(1e18),!r.isFinite()||!o.isFinite()||!a.isFinite()||!r.isPositive()||!o.isPositive()||!a.isPositive())throw new u("Invalid price values: all prices must be finite and positive","VALIDATION_ERROR",{type:"INVALID_PRICE_VALUES",spotPrice:t,lowerPrice:e,upperPrice:n});if(o.isGreaterThan(a))throw new u("Invalid price range: lower price must be less than or equal to upper price","VALIDATION_ERROR",{type:"INVALID_PRICE_RANGE",lowerPrice:e,upperPrice:n})}function Ht(t,e){if(t<0||!Number.isInteger(t))throw new u(`Invalid ${e}: must be a non-negative integer`,"VALIDATION_ERROR",{type:"INVALID_TOKEN_DECIMALS",parameterName:e,value:t})}function $t(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new u("Invalid tick values: ticks must be integers","VALIDATION_ERROR",{type:"INVALID_TICK_VALUES",tickLower:t,tickUpper:e});if(t>=e)throw new u("Invalid tick range: tickLower must be less than tickUpper","VALIDATION_ERROR",{type:"INVALID_TICK_RANGE",tickLower:t,tickUpper:e});if(t<E||e>I)throw new u(`Invalid tick range: ticks must be between ${E} and ${I}`,"VALIDATION_ERROR",{type:"INVALID_TICK_BOUNDS",tickLower:t,tickUpper:e,minTick:E,maxTick:I})}function w(t){if(!B.some(e=>Number(e)===t))throw new u("Invalid fee tier: must be one of 0, 500, 3000, or 10000","VALIDATION_ERROR",{type:"INVALID_FEE",value:t})}function Vt(t){if(!Number.isInteger(t)||t<=0)throw new u("Invalid tick spacing: must be a positive integer","VALIDATION_ERROR",{type:"INVALID_TICK_SPACING",value:t})}function ye(t){if(t===void 0)throw new u("Invalid wallet address: No wallet address provided","VALIDATION_ERROR",{type:"MISSING_WALLET_ADDRESS",hint:"Either provide a wallet address to the function you are calling, or set one when instantiating GSwapSDK"});if(!t||typeof t!="string"||t.trim().length===0)throw new u("Invalid wallet address: must be a non-empty string","VALIDATION_ERROR",{type:"INVALID_WALLET_ADDRESS",value:t})}var G=class{constructor(e,n){d(this,"dexBackendBaseUrl",e);d(this,"httpClient",n)}async getUserAssets(e,n=1,i=10){if(ye(e),!Number.isInteger(n)||n<1)throw new u("Invalid page: must be a positive integer","VALIDATION_ERROR",{page:n});if(!Number.isInteger(i)||i<1||i>100)throw new u("Invalid limit: must be an integer between 1 and 100","VALIDATION_ERROR",{limit:i});let r=await this.httpClient.sendGetRequest(this.dexBackendBaseUrl,"/user/assets","",{address:e,page:n.toString(),limit:i.toString()});return We(r)}};function We(t){let e=R(t,"data"),n=e?.token;if(!Array.isArray(n)||!n.every(Qe))throw new u("Backend returned an invalid user assets response.","INVALID_CHAIN_RESPONSE",{data:t});let i=e?.count;return{tokens:n.map(r=>({...r,decimals:parseInt(r.decimals,10)})),count:typeof i=="number"?i:0}}function Qe(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.image=="string"&&typeof e.name=="string"&&typeof e.decimals=="string"&&/^\d+$/u.test(e.decimals)&&typeof e.verify=="boolean"&&typeof e.symbol=="string"&&typeof e.quantity=="string"}async function A(t,e,n,i){let r=new AbortController,o=setTimeout(()=>r.abort(),i),a=n.signal,s=()=>r.abort();a?.addEventListener("abort",s,{once:!0});try{return await t(e,{...n,signal:r.signal})}catch(c){throw r.signal.aborted?new u(`Request timed out after ${i} ms.`,"REQUEST_TIMEOUT",{url:e,timeoutMs:i,cause:c}):c}finally{clearTimeout(o),a?.removeEventListener("abort",s)}}async function N(t){let e=await t.text();return re(e)??e}function v(t,e){let n=t.headers;if(n===void 0)return;if(Je(n)){let r=n.get(e);return r===null||r===""?void 0:r}let i=Object.entries(n).find(([r])=>r.toLowerCase()===e.toLowerCase())?.[1];return i===void 0||i===""?void 0:i}function U(t){let e=v(t,"retry-after");if(e===void 0)return;let n=Number(e);return Number.isFinite(n)&&n>=0?n*1e3:void 0}function K(t,e="x-block-number"){let n=v(t,e);if(n===void 0)return;let i=Number(n);return Number.isInteger(i)&&i>=0?i:void 0}function Je(t){return"get"in t&&typeof t.get=="function"}var q=class{constructor(e){d(this,"method");d(this,"uniqueKey");d(this,"transactionId");d(this,"blockNumber");d(this,"mode");d(this,"result");d(this,"backendBaseUrl");d(this,"requestor");d(this,"requestTimeoutMs");d(this,"positionConfirmation");this.method=e.method,this.uniqueKey=e.uniqueKey,this.transactionId=e.transactionId,this.blockNumber=e.blockNumber??null,this.mode=e.mode,this.result=e.result,this.backendBaseUrl=e.dexBackendBaseUrl.replace(/\/$/u,""),this.requestor=e.httpRequestor,this.requestTimeoutMs=e.requestTimeoutMs??3e4,this.positionConfirmation=e.positionConfirmation}async confirm(e){return this.method==="RequestTrade"?this.confirmApplied(e):this.confirmPosition(e)}async confirmApplied(e){let n=we(e,3e3);await n.waitForRead();let i=`${this.backendBaseUrl}/v1/chain/apply-results/${encodeURIComponent(this.uniqueKey)}?channel=asset&contract=dex-contract`,r;for(;;){let o,a;try{o=await A(this.requestor,i,{method:"GET"},this.requestTimeoutMs),a=await N(o)}catch(s){if(r=s,!await n.waitForRead())break;continue}if(o.status===200)return this.readAppliedResult(o,a,i);if(o.status===404||o.status===429||ze(o.status)){if(o.status===429){let s=U(o);if(s!==void 0){if(!await n.waitForRead(s))break;continue}}}else throw new u(Xe(a),"CONFIRMATION_FAILED",{status:o.status,body:a,url:i});if(!await n.waitForRead())break}throw u.confirmationTimeoutError(this.uniqueKey,r)}readAppliedResult(e,n,i){let r=ke(n),o=r?.Status,a=v(e,"x-apply-transaction-id")??null,s=K(e,"x-apply-block-number")??null;if(o===0)throw u.fromChainError(p(r,"ErrorKey")??"CHAIN_ERROR",p(r,"Message")??"The chain rejected this trade.",{uniqueKey:this.uniqueKey,applyTransactionId:a,blockNumber:s,status:e.status,body:n,url:i});if(o!==1)throw he(e,n,i);let c=Ye(r?.Data);if(c===void 0)throw he(e,n,i);return{uniqueKey:this.uniqueKey,transactionId:a,blockNumber:s,requestTransactionId:this.transactionId,result:c}}async confirmPosition(e){if(this.positionConfirmation===void 0)throw u.noWalletAddressError();let n=we(e,0);for(await n.waitForRead();;){let i=new AbortController,r=setTimeout(()=>i.abort(),this.requestTimeoutMs);try{let o=await this.positionConfirmation(i.signal);if(o.confirmed)return o.position}finally{clearTimeout(r)}if(!await n.waitForRead())break}throw u.confirmationTimeoutError(this.uniqueKey)}};function we(t,e){let n=Math.max(0,t?.timeoutMs??6e4),i=Math.max(500,t?.pollIntervalMs??2e3),r=Math.max(0,t?.initialDelayMs??e),o=Date.now()+n,a=!0,s=0;return{async waitForRead(c){if(a){a=!1;let T=Math.max(0,o-Date.now());return await ge(Math.min(r,T)),!0}let m=Math.min(8e3,i*2**Math.min(s,5));s+=1;let l=c===void 0?Ze(m):c;return Date.now()+l>o?!1:(await ge(l),!0)}}}function Ye(t){let e=ke(t);if(e===void 0||typeof e.token0!="string"||typeof e.token1!="string"||typeof e.fee!="number")return;let n=["sell0Qty","sell1Qty","buy0Qty","buy1Qty","tradingFees","protocolFees","totalFees"];for(let i of n)if(i in e&&typeof e[i]!="string")return;return{token0:e.token0,token1:e.token1,fee:e.fee,...Object.fromEntries(n.flatMap(i=>typeof e[i]=="string"?[[i,e[i]]]:[]))}}function he(t,e,n){return new u("Transaction confirmation returned a malformed body","CONFIRMATION_FAILED",{status:t.status,body:e,url:n})}function ze(t){return t===500||t===502||t===503||t===504}function Xe(t){return p(t,"message")??p(t,"Message")??p(R(t,"error"),"message")??p(R(t,"error"),"Message")??(typeof t=="string"?t:"Transaction confirmation failed")}function ke(t){return typeof t=="object"&&t!==null?t:void 0}function ge(t){return new Promise(e=>setTimeout(e,t))}function Ze(t){return Math.max(0,Math.round(t*(.9+Math.random()*.2)))}var H=class{constructor(e){d(this,"requestor");d(this,"walletAddress");d(this,"chainCallTimeoutMs");d(this,"requestTimeoutMs");d(this,"dexBackendBaseUrl");this.dexBackendBaseUrl=et(e.dexBackendBaseUrl),this.requestor=e.httpRequestor??fetch.bind(globalThis),this.walletAddress=e.walletAddress,this.chainCallTimeoutMs=e.chainCallTimeoutMs??3e4,this.requestTimeoutMs=this.chainCallTimeoutMs}async submit(e,n,i){if(e==="Trade")throw new u("The synchronous Trade method was removed; swaps are queued through RequestTrade.","METHOD_NOT_SUPPORTED",{method:e});let r=`${this.dexBackendBaseUrl}/v1/chain/asset/dex-contract/${e}`,o={"content-type":"application/json"},a=i?.walletAddress??this.walletAddress;a!==void 0&&(o["X-Wallet-Address"]=a);let s;try{s=await A(this.requestor,r,{method:"POST",headers:o,body:JSON.stringify(n)},this.chainCallTimeoutMs)}catch(h){throw h instanceof u&&h.code==="REQUEST_TIMEOUT"?new u("The submission outcome is unknown because the gateway request timed out. Confirm before retrying.","SUBMISSION_OUTCOME_UNKNOWN",{uniqueKey:p(n,"uniqueKey")??"",cause:h}):h}let c=await N(s);if(!s.ok)throw tt(s,c,r);let m=j(c),l=j(m?.data??m?.Data);if(l===void 0)throw _(s,c,r,"Expected a data object.");let T=p(l,"transactionId"),g=p(l,"mode"),te=l.transactionId,P=l.blockNumber,ne='Gateway response must contain data.mode="sync" with data.result, or data.mode="queued".';if(g!=="sync"&&g!=="queued"||"transactionId"in l&&typeof te!="string"||P!=null&&!be(P))throw _(s,c,r,ne);if(e==="RequestTrade"&&g==="sync")throw _(s,c,r,"The gateway executed RequestTrade synchronously, which this SDK refuses; RequestTrade must be queued.");if(e==="RequestTrade"&&g==="queued"){let h=p(n,"uniqueKey");if("uniqueKey"in l&&(typeof l.uniqueKey!="string"||l.uniqueKey!==h))throw _(s,c,r,"Gateway response data.uniqueKey must match the signed RequestTrade uniqueKey.")}else if(g==="queued"||!("result"in l))throw _(s,c,r,ne);if(g==="sync"){let h=j(l.result);if(h!==void 0){let ce=h.Status;if(ce!==void 0&&ce!==1)throw u.fromChainError(p(h,"ErrorKey")??"CHAIN_ERROR",p(h,"Message")??"The chain rejected this write.",{status:s.status,body:c,url:r})}}let Fe=p(n,"uniqueKey")??"",Ge=v(s,"x-transaction-id"),ie=T===void 0||T===""?Ge:T,Ue=P==null?K(s):be(P)?P:void 0;return new q({method:e,uniqueKey:Fe,transactionId:ie===void 0||ie===""?null:ie,blockNumber:Ue??null,mode:g,result:g==="queued"?void 0:l.result,dexBackendBaseUrl:this.dexBackendBaseUrl,httpRequestor:this.requestor,requestTimeoutMs:this.chainCallTimeoutMs,...i?.positionConfirmation===void 0?{}:{positionConfirmation:i.positionConfirmation}})}get httpRequestor(){return this.requestor}};function et(t){return t.replace(/\/$/u,"")}function _(t,e,n,i){return new u(i,"INVALID_GATEWAY_RESPONSE",{status:t.status,body:e,url:n})}function tt(t,e,n){let i=j(e),r=R(e,"error"),o=p(i,"code")??p(r,"code")??p(r,"ErrorKey")??"HTTP_ERROR",a=p(i,"message")??p(r,"message")??p(r,"Message")??(typeof e=="string"?e:`Gateway request failed with HTTP ${t.status}`),s=t.status===429?U(t):void 0;return o==="HTTP_ERROR"?new u(a,o,{status:t.status,body:e,url:n}):u.fromGatewayBounce(o,a,t.status,s)}function j(t){return typeof t=="object"&&t!==null?t:void 0}function be(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0}import nt from"debug";var ae=nt("GSWAP_SDK");var Te="1.0.0-rc.3";var k=class{constructor(e=fetch,n=3e4){d(this,"httpRequestor",e);d(this,"timeoutMs",n)}async sendRequest(e,n,i,r,o,a){let s=`${n}${i}${r}`;ae(`Sending request to ${s} with body:`,o);let c=await A(this.httpRequestor,s,{method:e,headers:{"Content-Type":"application/json","User-Agent":`GalaChain-SDK/${Te}`},...o?{body:JSON.stringify(o)}:{},...a?.signal===void 0?{}:{signal:a.signal}},this.timeoutMs);if(!c.ok)throw await u.fromErrorResponse(s,c);let m=await N(c);return ae(`Response from ${n}${i}${r}:`,m),m}async sendPostRequest(e,n,i,r){return this.sendRequest("POST",e,n,i,r)}async sendGetRequest(e,n,i,r,o){let a=r?new URLSearchParams(r):void 0,s=a?`${i}?${a.toString()}`:i;return this.sendRequest("GET",e,n,s,void 0,o)}};function C(t,e){return t<e?[t,e]:[e,t]}function $(t){if(Array.isArray(t)&&t.length>=2){let e=t[0],n=t[1];if(typeof e=="string"&&typeof n=="string")return{token0:e,token1:n}}if(typeof t=="object"&&t!==null){let e=t,n=e.token0,i=e.token1;if(typeof n=="string"&&typeof i=="string")return{token0:n,token1:i}}throw new u("Unable to order trading symbols.","VALIDATION_ERROR",{value:t})}function S(t){return[t.collection,t.category,t.type,t.additionalKey].join("$")}function O(t){if(typeof t=="object")return{collection:t.collection,category:t.category,type:t.type,additionalKey:t.additionalKey};let e=t.includes("|")?t.split("|"):t.split("$");if(e.length!==4||e.some(a=>a.length===0))throw new u("Invalid token class key: expected four non-empty parts","VALIDATION_ERROR",{tokenClassKey:t});let[n,i,r,o]=e;return{collection:n,category:i,type:r,additionalKey:o}}var W=class{constructor(e,n){d(this,"gateway",e);d(this,"symbols",n);d(this,"http");this.http=new k(e.httpRequestor,e.requestTimeoutMs??3e4)}async getPools(e){let n=await this.http.sendGetRequest(this.gateway.dexBackendBaseUrl,"/v2/trade","/pools",void 0,e?.signal===void 0?void 0:{signal:e.signal});if(!Array.isArray(n.data)||!n.data.every(it))throw new u("Backend returned an invalid pool list.","INVALID_CHAIN_RESPONSE",{data:n.data});return n.data}async getPool(e,n,i){return w(i),this.getBackend("/pool",await this.backendParams(e,n,i))}async getSlot0(e,n,i){return w(i),this.getBackend("/slot0",await this.backendParams(e,n,i))}async getCompositePool(e,n,i){w(i);let r=await V(this.symbols,e),o=await V(this.symbols,n),a=$(C(r,o));return this.getBackend("/composite-pool",{token0:a.token0,token1:a.token1,fee:String(i)})}async backendParams(e,n,i){return{token0:await V(this.symbols,e),token1:await V(this.symbols,n),fee:String(i)}}async getBackend(e,n){try{return(await this.http.sendGetRequest(this.gateway.dexBackendBaseUrl,"/v2/trade",e,n)).data}catch(i){throw i instanceof u?i:new u("Pool request failed.","HTTP_ERROR",{cause:i})}}};async function V(t,e){let n=await t.resolve(e);if(n.symbol.length>0)return n.symbol;throw new u("Token could not be resolved to a trading symbol.","SYMBOL_NOT_FOUND",{token:e})}function it(t){if(typeof t!="object"||t===null)return!1;let e=t,n=["fee","tickSpacing","protocolFees","tradingFees"],i=["token0CompositeKey","token1CompositeKey","creator","price","sqrtPrice","token0Tvl","token1Tvl"],r=["tick","tvlUsd","volume1d","volume7d","volume30d","trades1d","fee24h","apr1d","token0Price","token1Price"];return e.contractVersion==="v2"&&typeof e.token0=="string"&&typeof e.token1=="string"&&typeof e.poolName=="string"&&typeof e.poolRef=="string"&&n.every(o=>Re(e[o]))&&i.every(o=>rt(e[o]))&&r.every(o=>ot(e[o]))}function Re(t){return typeof t=="number"&&Number.isFinite(t)}function rt(t){return t===void 0||typeof t=="string"}function ot(t){return t===void 0||Re(t)}import f from"bignumber.js";var Q=class{constructor(e,n,i,r){d(this,"gateway",e);d(this,"symbols",n);d(this,"signer",i);d(this,"walletAddress",r);d(this,"http");this.http=new k(e.httpRequestor,e.requestTimeoutMs??3e4)}async getUserPositions(e){return(await this.get("/positions",{user:e})).data.map(i=>this.mapPosition(i))}async getPosition(e,n){let i=await this.symbols.orderPair(e.token0,e.token1),r=this.canonicalTicks(e.tickLower,e.tickUpper,i.flipped),o=await this.getNullable("/position",{token0:i.token0.symbol,token1:i.token1.symbol,fee:`${e.fee}`,owner:e.owner,tickLower:`${r.tickLower}`,tickUpper:`${r.tickUpper}`},n);return o===null?null:this.mapPosition(o.data)}async estimateAddLiquidity(e){return y(e.amount,"amount"),(await this.get("/add-liq-estimate",{token0:this.requestToken(e.token0),token1:this.requestToken(e.token1),fee:`${e.fee}`,tickLower:`${e.tickLower}`,tickUpper:`${e.tickUpper}`,amount:new f(e.amount).toFixed(),amountIsToken0:String(e.amountIsToken0)})).data}async estimateRemoveLiquidity(e){return y(e.liquidity,"liquidity"),(await this.get("/remove-liq-estimate",{token0:this.requestToken(e.token0),token1:this.requestToken(e.token1),fee:`${e.fee}`,tickLower:`${e.tickLower}`,tickUpper:`${e.tickUpper}`,liquidity:new f(e.liquidity).toFixed()})).data}async addLiquidityByTicks(e){w(e.fee);let n=await this.symbols.orderPair(e.token0,e.token1),i=this.canonicalTicks(e.tickLower,e.tickUpper,n.flipped);F(i.tickLower,i.tickUpper,e.fee),y(e.amount,"amount");let r=new f(e.amount).toFixed(),o={token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper,uniqueKey:this.uniqueKey(),...n.flipped!==e.amountIsToken0?{depositQuantityToken0:r}:{depositQuantityToken1:r}};return this.submit("AddLiquidity",o,{kind:"add",identity:{token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper}})}async addLiquidityByPrice(e){w(e.fee),this.rejectNumber(e.minPrice,"minPrice"),this.rejectNumber(e.maxPrice,"maxPrice");let n=new f(e.minPrice),i=new f(e.maxPrice);if(!n.isFinite()||!i.isFinite()||n.isLessThanOrEqualTo(0)||i.isLessThanOrEqualTo(0))throw new u("Price bounds must be finite and positive.","VALIDATION_ERROR");if(n.isGreaterThan(i))throw new u("minPrice must be less than or equal to maxPrice.","VALIDATION_ERROR");let r=this.tickSpacing(e.fee),o=me(se(n),r),a=pe(se(i),r);return this.addLiquidityByTicks({token0:e.token0,token1:e.token1,fee:e.fee,tickLower:o,tickUpper:a,amount:e.amount,amountIsToken0:e.amountIsToken0})}async removeLiquidity(e){w(e.fee);let n=await this.symbols.orderPair(e.token0,e.token1),i=this.canonicalTicks(e.tickLower,e.tickUpper,n.flipped);if(F(i.tickLower,i.tickUpper,e.fee),e.amount0!==void 0&&e.amount1!==void 0)throw new u("Provide at most one of amount0 or amount1.","VALIDATION_ERROR");e.amount0!==void 0&&y(e.amount0,"amount0"),e.amount1!==void 0&&y(e.amount1,"amount1");let r=e.amount0!==void 0?n.flipped?{withdrawalQuantityToken1:new f(e.amount0).toFixed()}:{withdrawalQuantityToken0:new f(e.amount0).toFixed()}:e.amount1!==void 0?n.flipped?{withdrawalQuantityToken0:new f(e.amount1).toFixed()}:{withdrawalQuantityToken1:new f(e.amount1).toFixed()}:{},o={token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper,uniqueKey:this.uniqueKey(),...r},a=e.amount0===void 0&&e.amount1===void 0;return this.submit("RemoveLiquidity",o,{kind:a?"removeFull":"removePartial",identity:{token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper}})}async collectPositionFees(e){w(e.fee);let n=await this.symbols.orderPair(e.token0,e.token1),i=this.canonicalTicks(e.tickLower,e.tickUpper,n.flipped);F(i.tickLower,i.tickUpper,e.fee);let r={token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper,uniqueKey:this.uniqueKey()};return this.submit("CollectPositionFees",r,{kind:"collect",identity:{token0:n.token0.symbol,token1:n.token1.symbol,fee:e.fee,tickLower:i.tickLower,tickUpper:i.tickUpper}})}async createPool(e){let n=e.startingPrice!==void 0,i=e.startingSqrtPrice!==void 0;if(n===i)throw new u("Provide exactly one of startingPrice or startingSqrtPrice.","VALIDATION_ERROR");w(e.fee);let[r,o]=await Promise.all([this.resolveCreateToken(e.token0),this.resolveCreateToken(e.token1)]),a=r.symbol>o.symbol,[s,c]=a?[o,r]:[r,o],m=n?e.startingPrice:e.startingSqrtPrice;this.rejectNumber(m,n?"startingPrice":"startingSqrtPrice");let l=new f(m);if(!l.isFinite()||l.isLessThanOrEqualTo(0))throw new u("Starting price must be finite and positive.","VALIDATION_ERROR");let T=a?new f(1).dividedBy(l):l,g={token0Key:s.classKey,token1Key:c.classKey,token0Symbol:s.symbol,token1Symbol:c.symbol,fee:e.fee,uniqueKey:this.uniqueKey(),...n?{startingPrice:T.toFixed()}:{startingSqrtPrice:T.toFixed()},...e.isPrivate===void 0?{}:{isPrivate:e.isPrivate},...e.privateAccess===void 0?{}:{privateAccess:e.privateAccess}},te=await this.submit("CreatePool",g,{kind:"createPool",token0:s.symbol,token1:c.symbol,fee:e.fee});return this.symbols.invalidate?.(),te}async submit(e,n,i){if(this.signer===void 0)throw u.noSignerError();let r=await this.signer.signObject(e,n),o=this.walletAddress===void 0?{}:{walletAddress:this.walletAddress},a=this.walletAddress,s=this.buildPositionConfirmation(i,a),c={...o,...s===void 0?{}:{positionConfirmation:s}};return this.gateway.submit(e,r,c)}buildPositionConfirmation(e,n){if(e===void 0)return;if(e.kind==="createPool"){let{token0:a,token1:s,fee:c}=e;return async m=>await this.getNullable("/pool",{token0:a,token1:s,fee:`${c}`},m)===null?{confirmed:!1}:{confirmed:!0,position:null}}if(n===void 0)return;let{kind:i,identity:r}=e,o;return async a=>{let s=await this.getPosition({...r,owner:n},a);if(o===void 0)return o={liquidity:new f(s?.liquidity??0),fees:new f(s?.fees0??0).plus(new f(s?.fees1??0))},i==="removeFull"&&s===null?{confirmed:!0,position:null}:{confirmed:!1};switch(i){case"add":return s!==null&&new f(s.liquidity).isGreaterThan(o.liquidity)?{confirmed:!0,position:s}:{confirmed:!1};case"removePartial":return s!==null&&new f(s.liquidity).isLessThan(o.liquidity)?{confirmed:!0,position:s}:{confirmed:!1};case"removeFull":return s===null?{confirmed:!0,position:null}:{confirmed:!1};case"collect":{if(s===null)return{confirmed:!1};let c=new f(s.fees0??0).plus(new f(s.fees1??0));return c.isLessThan(o.fees)?{confirmed:!0,position:s}:o.fees.isZero()&&c.isZero()?{confirmed:!0,position:s}:{confirmed:!1}}}}}async get(e,n,i){return this.http.sendGetRequest(this.gateway.dexBackendBaseUrl,"/v2/trade",e,n,i===void 0?void 0:{signal:i})}async getNullable(e,n,i){try{return await this.get(e,n,i)}catch(r){if(this.isNotFound(r))return null;throw r}}isNotFound(e){return!(e instanceof u)||e.details===void 0?!1:e.details.status===404}mapPosition(e){return{token0Symbol:e.token0Symbol,token1Symbol:e.token1Symbol,...e.token0CompositeKey===void 0?{}:{token0CompositeKey:e.token0CompositeKey},...e.token1CompositeKey===void 0?{}:{token1CompositeKey:e.token1CompositeKey},fee:e.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,liquidity:e.liquidity,amount0:e.amount0,amount1:e.amount1,inRange:e.inRange,...e.currentTick===void 0?{}:{currentTick:e.currentTick},...e.sqrtPrice===void 0?{}:{sqrtPrice:e.sqrtPrice},pool:e.poolRef??e.pool??"",owner:e.owner,...e.fees0===void 0?{}:{fees0:e.fees0},...e.fees1===void 0?{}:{fees1:e.fees1}}}requestToken(e){return typeof e=="string"?e:S(e)}canonicalTicks(e,n,i){return i?{tickLower:-n,tickUpper:-e}:{tickLower:e,tickUpper:n}}tickSpacing(e){let n=L[e];if(n===void 0)throw new u(`Unsupported fee tier: ${e}.`,"VALIDATION_ERROR");return n}rejectNumber(e,n){if(typeof e=="number")throw new u(`Invalid ${n}: use a decimal string or BigNumber, not a JavaScript number`,"VALIDATION_ERROR")}uniqueKey(){return`gswap-sdk-${globalThis.crypto.randomUUID()}`}async resolveCreateToken(e){try{let n=typeof e=="object"?S(e):e,i=await this.symbols.resolve(n),r=this.tryParseClassKey(e);return{symbol:i.symbol,classKey:r??O({collection:i.collection,category:i.category,type:i.type,additionalKey:i.additionalKey})}}catch(n){if(!(n instanceof u)||n.code!=="UNKNOWN_TOKEN")throw n;let i;try{i=O(e)}catch{throw n}return{symbol:i.collection,classKey:i}}}tryParseClassKey(e){try{return O(e)}catch{return}}};import D from"bignumber.js";var Y=class{constructor(e,n,i){d(this,"dexBackendBaseUrl",e);d(this,"http",n);d(this,"symbols",i)}async quoteExactInput(e,n,i,r){return y(i,"amountIn"),this.quote(e,n,{amountIn:Se(i)},r)}async quoteExactOutput(e,n,i,r){return y(i,"amountOut"),this.quote(e,n,{amountOut:Se(i)},r)}async quote(e,n,i,r){lt(r);let o=await Pe(this.symbols,e),a=await Pe(this.symbols,n),s={tokenIn:o,tokenOut:a,...i};r!==void 0&&(s.fee=String(r));try{let c=await this.http.sendGetRequest(this.dexBackendBaseUrl,"/v2/trade","/quote",s);return st(c.data)}catch(c){throw ut(c,e,n,r)}}};function st(t){if(!at(t))throw new u("Backend returned an invalid quote.","INVALID_CHAIN_RESPONSE",{data:t});let e=t,n=e.currentPrice!==void 0?new D(e.currentPrice):Ie(e.currentSqrtPrice,e.tokenInIsToken0),i=e.newPrice!==void 0?new D(e.newPrice):Ie(e.newSqrtPrice,e.tokenInIsToken0),r=i.minus(n).dividedBy(n);return{contractVersion:e.contractVersion,fee:e.fee,amountIn:e.amountIn,amountOut:e.amountOut,...e.currentSqrtPrice===void 0?{}:{currentSqrtPrice:e.currentSqrtPrice},...e.newSqrtPrice===void 0?{}:{newSqrtPrice:e.newSqrtPrice},feeTier:e.fee,newTick:e.newTick,tradingFees:e.tradingFees,protocolFees:e.protocolFees,totalFees:e.totalFees,feeTokenSymbol:e.feeTokenSymbol,token0Symbol:e.token0Symbol,token1Symbol:e.token1Symbol,tokenInIsToken0:e.tokenInIsToken0,currentPrice:n,newPrice:i,priceImpact:r}}var Ee=D.clone({DECIMAL_PLACES:60});function Ie(t,e){let n=new Ee(t).pow(2);return e?n:new Ee(1).dividedBy(n)}function at(t){if(typeof t!="object"||t===null)return!1;let e=t,n=["amountIn","amountOut","tradingFees","protocolFees","totalFees","feeTokenSymbol","token0Symbol","token1Symbol"];return e.contractVersion==="v2"&&typeof e.fee=="number"&&Number.isFinite(e.fee)&&n.every(i=>typeof e[i]=="string")&&typeof e.newTick=="number"&&Number.isInteger(e.newTick)&&typeof e.tokenInIsToken0=="boolean"&&J(e.currentSqrtPrice)&&J(e.newSqrtPrice)&&J(e.currentPrice)&&J(e.newPrice)&&(e.currentSqrtPrice!==void 0||e.currentPrice!==void 0)&&(e.newSqrtPrice!==void 0||e.newPrice!==void 0)}function J(t){if(t===void 0)return!0;if(typeof t!="string")return!1;try{let e=new D(t);return e.isFinite()&&e.isGreaterThan(0)}catch{return!1}}function ut(t,e,n,i){if(t instanceof u){let r=dt(t.details),o=ct(t.details)??t.message;return r===404||/no pool|no pools|pool does not exist/iu.test(o)?u.noPoolAvailableError(e,n,i):r===400&&/insufficient liquidity/iu.test(o)?u.insufficientLiquidityError(e,n,i):t}return new u("Quote request failed.","HTTP_ERROR",{cause:t,tokenIn:e,tokenOut:n,fee:i})}function dt(t){let e=t?.status;return typeof e=="number"?e:void 0}function ct(t){let e=t?.message;if(typeof e=="string")return e;let n=t?.body;if(typeof n!="object"||n===null||Array.isArray(n))return;let i=n.message;return typeof i=="string"?i:void 0}function lt(t){if(t!==void 0&&!B.some(e=>Number(e)===Number(t)))throw new u(`Invalid fee tier: ${t}`,"VALIDATION_ERROR",{fee:t})}function Se(t){return new D(t).toFixed()}async function Pe(t,e){let n=await t.resolve(e);if(n.symbol.length>0)return n.symbol;throw new u("Token could not be resolved to a trading symbol.","SYMBOL_NOT_FOUND",{token:e})}var mt=6e4,z=class{constructor(e){d(this,"gateway",e);d(this,"cachedSymbols");d(this,"cachedAt",0);d(this,"refreshInFlight");d(this,"http");this.http=new k(e.httpRequestor,e.requestTimeoutMs)}async list(){return this.cachedSymbols!==void 0&&Date.now()-this.cachedAt<mt?this.cachedSymbols:this.refreshInFlight!==void 0?this.refreshInFlight:(this.refreshInFlight=this.http.sendGetRequest(this.gateway.dexBackendBaseUrl,"/v2/trade","/symbols").then(e=>pt(e.data)).then(e=>(this.cachedSymbols=e,this.cachedAt=Date.now(),e)).finally(()=>{this.refreshInFlight=void 0}),this.refreshInFlight)}invalidate(){this.cachedSymbols=void 0,this.cachedAt=0}async refresh(){return this.invalidate(),this.refreshInFlight=void 0,this.list()}async resolve(e){let n=await this.list(),i=typeof e=="string"?yt(e)?S(O(e)):void 0:S(e),r=n.find(o=>o.symbol===e||i!==void 0&&S(o)===i);if(r===void 0){n=await this.refresh();let o=n.find(a=>a.symbol===e||i!==void 0&&S(a)===i);if(o===void 0)throw u.unknownTokenError(e);return o}return r}async orderPair(e,n){let[i,r]=await Promise.all([this.resolve(e),this.resolve(n)]),[o,a]=C(i.symbol,r.symbol);return{token0:o===i.symbol?i:r,token1:a===r.symbol?r:i,flipped:o!==i.symbol}}};function pt(t){if(!Array.isArray(t)||!t.every(ft))throw new u("Backend returned an invalid symbol list.","INVALID_CHAIN_RESPONSE",{data:t});return t}function ft(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.symbol=="string"&&typeof e.collection=="string"&&typeof e.category=="string"&&typeof e.type=="string"&&typeof e.additionalKey=="string"&&typeof e.decimals=="number"&&Number.isInteger(e.decimals)&&e.decimals>=0}function yt(t){return t.includes("|")||t.includes("$")}import wt from"bignumber.js";var ht=/^[A-Za-z0-9._:-]{1,128}$/u,Z=class{constructor(e,n,i,r){d(this,"gateway",e);d(this,"symbols",n);d(this,"signer",i);d(this,"walletAddress",r)}async swap(e,n,i,r){w(i);let o=await this.buildRequestTradeDto(e,n,i,r);if(this.signer===void 0)throw u.noSignerError();let a=await this.signer.signObject("RequestTrade",o),s=this.walletAddress===void 0?{}:{walletAddress:this.walletAddress};return this.gateway.submit("RequestTrade",a,s)}async confirmSwap(e,n){if(!ht.test(e))throw new u('uniqueKey must be 1-128 characters of A-Z, a-z, 0-9, ".", "_", ":" or "-".',"VALIDATION_ERROR",{uniqueKey:e});return new q({method:"RequestTrade",uniqueKey:e,transactionId:null,mode:"queued",result:void 0,dexBackendBaseUrl:this.gateway.dexBackendBaseUrl,httpRequestor:this.gateway.httpRequestor,requestTimeoutMs:this.gateway.requestTimeoutMs}).confirm({initialDelayMs:0,...n})}async buildRequestTradeDto(e,n,i,r){let o=await Ae(this.symbols,e),a=await Ae(this.symbols,n),s=$(C(o,a)),c=o===s.token0,m={token0:s.token0,token1:s.token1,fee:i,uniqueKey:`gswap-sdk-${globalThis.crypto.randomUUID()}`};if("exactIn"in r){let l=r.exactIn;if(l===void 0)throw new u("exactIn is required for an exact-input swap.","VALIDATION_ERROR");y(l,"exactIn"),m[c?"sell0Qty":"sell1Qty"]=X(l),r.amountOutMinimum!==void 0&&(y(r.amountOutMinimum,"amountOutMinimum",!0),m.amountOutMinimum=X(r.amountOutMinimum))}else{let l=r.exactOut;if(l===void 0)throw new u("exactOut is required for an exact-output swap.","VALIDATION_ERROR");y(l,"exactOut"),m[c?"buy1Qty":"buy0Qty"]=X(l),r.amountInMaximum!==void 0&&(y(r.amountInMaximum,"amountInMaximum",!0),m.amountInMaximum=X(r.amountInMaximum))}return m}};function X(t){return new wt(t).toFixed()}async function Ae(t,e){let n=await t.resolve(e);if(n.symbol.length>0)return n.symbol;throw new u("Token could not be resolved to a trading symbol.","SYMBOL_NOT_FOUND",{token:e})}var Ne={prod:{dexBackendBaseUrl:"https://dex-backend-prod1.defi.gala.com"},stage:{dexBackendBaseUrl:"https://swap-backend.stage.defi.ovh.gala.com"}};var ve=class{constructor(e){d(this,"dexBackendBaseUrl");d(this,"chainCallTimeoutMs");d(this,"signer");d(this,"walletAddress");d(this,"gateway");d(this,"symbols");d(this,"quoting");d(this,"pools");d(this,"positions");d(this,"swaps");d(this,"assets");let n=Ne[e?.env??"prod"];this.dexBackendBaseUrl=gt(e?.dexBackendBaseUrl??n.dexBackendBaseUrl),this.chainCallTimeoutMs=e?.chainCallTimeoutMs??3e4,this.signer=e?.signer,this.walletAddress=e?.walletAddress;let i=new k(e?.httpRequestor,this.chainCallTimeoutMs);this.gateway=new H({dexBackendBaseUrl:this.dexBackendBaseUrl,chainCallTimeoutMs:this.chainCallTimeoutMs,...e?.httpRequestor===void 0?{}:{httpRequestor:e.httpRequestor},...this.walletAddress===void 0?{}:{walletAddress:this.walletAddress}}),this.symbols=new z(this.gateway),this.quoting=new Y(this.dexBackendBaseUrl,i,this.symbols),this.pools=new W(this.gateway,this.symbols),this.positions=new Q(this.gateway,this.symbols,this.signer,this.walletAddress),this.swaps=new Z(this.gateway,this.symbols,this.signer,this.walletAddress),this.assets=new G(this.dexBackendBaseUrl,i)}};function gt(t){return t.replace(/\/$/u,"")}import{serialize as ee,signatures as Ce}from"@gala-chain/api";function kt(t,e){let n={};n[t]=[];function i(o){let a=n[o];if(!a)throw new Error(`Missing EIP-712 type definition for ${o}`);return a}function r(o,a,s,c=!1){if(Array.isArray(a)){let m=a.length>0?r(o,a[0],s,!0):"string";c||i(s).push({name:o,type:(m??o)+"[]"})}else if(typeof a=="object"&&a!==null){if(n[o])throw new Error("Name collisions not yet supported");n[o]=[],Object.entries(a).forEach(([m,l])=>{r(m,l,o)}),c||i(s).push({name:o,type:o})}else{let m;switch(typeof a){case"string":m="string";break;case"number":m="int256";break;case"boolean":m="bool";break;case"bigint":case"symbol":case"undefined":case"function":case"object":throw new Error(`Unsupported type, ${typeof a}, value: ${Object.prototype.toString.call(a)}`)}if(c)return m;i(s).push({name:o,type:m})}}return Object.entries(e).forEach(([o,a])=>{r(o,a,t)}),n}var ue={name:"ethereum",chainId:1},qe=new Set(["RequestTrade","AddLiquidity","RemoveLiquidity","CollectPositionFees"]);function b(t,e){return typeof t[e]=="number"?t[e]:0}function bt(t){return{...t,amount0Desired:b(t,"amount0Desired"),amount0Min:b(t,"amount0Min"),amount1Desired:b(t,"amount1Desired"),amount1Min:b(t,"amount1Min"),positionId:t.positionId??""}}function Tt(t){return{...t,amount:b(t,"amount"),amount0Min:b(t,"amount0Min"),amount1Min:b(t,"amount1Min"),positionId:t.positionId??""}}function Rt(t){return{...t,amount0Requested:b(t,"amount0Requested"),amount1Requested:b(t,"amount1Requested"),positionId:t.positionId??""}}var Et={AddLiquidity:bt,RemoveLiquidity:Tt,CollectPositionFees:Rt};function _e(t,e){let n=Et[t],i=n?n(e):e,r=kt(t,i);return{completedDto:i,types:r}}var It=`Ethereum Signed Message:
2
+ `;function Le(t){let e={...t};delete e.prefix;let n=ee(e);return It+String(new TextEncoder().encode(n).length)}function St(){let e=globalThis.window?.gala;if(!e)throw new u("Gala wallet is not available. Please ensure the Gala wallet is connected.","GALA_WALLET_NOT_AVAILABLE");return e}function Pt(t){if(typeof t!="string")throw new u("Wallet returned an invalid signature.","INVALID_SIGNATURE");if(!/^[0-9a-fA-F]{130}$/u.test(t))throw new u("Wallet returned an invalid native signature.","INVALID_SIGNATURE");return t}function Be(t){if(typeof t!="string"||!/^(?:0x)?[0-9a-fA-F]{130}$/u.test(t))throw new u("Wallet returned an invalid personal-sign signature.","INVALID_SIGNATURE");return t}function Me(t,e){let n=e&&t.startsWith("eth|")?t.slice(4):t;if(!/^0x[0-9a-fA-F]{40}$/u.test(n))throw new u("Wallet address must be the selected Ethereum account in 0x-prefixed form.","VALIDATION_ERROR",{type:"INVALID_WALLET_ADDRESS",value:t});return`0x${n.slice(2).toLowerCase()}`}function At(t){if(t instanceof Error)return t.message;if(typeof t=="string")return t;if(typeof t=="object"&&t!==null&&"message"in t){let e=t.message;return typeof e=="string"?e:""}return""}function Nt(t){return/unsupported|unknown scheme/i.test(At(t))}function de(t,e,n,i){let r=Le(e),o={...e,prefix:r},a=i!==void 0?[ee(o),n,i]:[ee(e),n];return t.request({method:i!==void 0?"gala_signChainDto":"personal_sign",params:a}).then(s=>({...o,signature:Be(s)}))}function vt(t,e,n,i){let{completedDto:r,types:o}=_e(e,n),a=Le(r),s={...r,prefix:a},m={domain:ue,types:{...o,EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"}]},primaryType:e,message:s};return t.request({method:"eth_signTypedData_v4",params:[i,JSON.stringify(m)]}).then(l=>({...s,types:o,domain:ue,signature:Be(l)}))}var Oe=class{constructor(e){d(this,"keyBuffer");this.keyBuffer=Ce.normalizePrivateKey(e)}signObject(e,n){let i=Ce.getSignature(n,this.keyBuffer);return Promise.resolve({...n,signature:i})}},xe=class{constructor(e,n={}){d(this,"walletAddress");d(this,"effectiveScheme");this.walletAddress=Me(e,!0),this.effectiveScheme=n.scheme??"native"}async signObject(e,n){let i=St();if(this.effectiveScheme==="personal-sign")return de(i,n,this.walletAddress,e);try{let r=await i.request({method:"gala_signChainDto",params:[ee(n),this.walletAddress,e,"native"]});return{...n,signature:Pt(r)}}catch(r){if(!Nt(r))throw r;return this.effectiveScheme="personal-sign",de(i,n,this.walletAddress,e)}}},De=class{constructor(e,n,i={}){d(this,"provider",e);d(this,"walletAddress");d(this,"scheme");this.walletAddress=Me(n,!1),this.scheme=i.scheme??"personal-sign"}signObject(e,n){return this.scheme==="eip712"&&qe.has(e)?vt(this.provider,e,n,this.walletAddress):de(this.provider,n,this.walletAddress)}};export{B as ALL_FEE_TIERS,G as Assets,De as BrowserWalletSigner,H as ChainGateway,He as FEE_TIER,I as GC_MAX_TICK,E as GC_MIN_TICK,Ne as GSWAP_ENVIRONMENTS,ve as GSwap,u as GSwapSDKError,xe as GalaWalletSigner,W as Pools,Q as Positions,Oe as PrivateKeySigner,Y as Quoting,q as SubmittedTransaction,Z as Swaps,z as Symbols,L as TICK_SPACING_BY_FEE,me as alignTickDown,pe as alignTickUp,F as assertTickRange,S as compositeKeyOf,R as getObjectProperty,p as getStringProperty,C as orderSymbols,re as parseJson,O as parseTokenClassKey,$ as readOrderedSymbols,Bt as sqrtPriceToTick,se as tickFromPrice,le as tickToSqrtPrice,w as validateFee,y as validateNumericAmount,jt as validatePriceValues,$t as validateTickRange,Vt as validateTickSpacing,Ht as validateTokenDecimals,ye as validateWalletAddress};
25
3
  //# sourceMappingURL=index.js.map