=0;h--){for(var f=o.words[h],$=r-1;$>=0;$--){var I=f>>$&1;v!==s[0]&&(v=this.sqr(v)),0!==I||0!==y?(y<<=1,y|=I,(4==++d||0===h&&0===$)&&(v=this.mul(v,s[y]),d=0,y=0)):d=0}r=26}return v},te.prototype.convertTo=function(n){var o=n.umod(this.m);return o===n?o.clone():o},te.prototype.convertFrom=function(n){var o=n.clone();return o.red=null,o},c.mont=function(n){return new se(n)},O(se,te),se.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},se.prototype.convertFrom=function(n){var o=this.imod(n.mul(this.rinv));return o.red=null,o},se.prototype.imul=function(n,o){if(n.isZero()||o.isZero())return n.words[0]=0,n.length=1,n;var l=n.imul(o),s=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=l.isub(s).iushrn(this.shift),v=h;return h.cmp(this.m)>=0?v=h.isub(this.m):h.cmpn(0)<0&&(v=h.iadd(this.m)),v._forceRed(this)},se.prototype.mul=function(n,o){if(n.isZero()||o.isZero())return new c(0)._forceRed(this);var l=n.mul(o),s=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=l.isub(s).iushrn(this.shift),v=h;return h.cmp(this.m)>=0?v=h.isub(this.m):h.cmpn(0)<0&&(v=h.iadd(this.m)),v._forceRed(this)},se.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ce=E.nmd(Ce),this)},3981:(Ce,ee)=>{"use strict";ee.byteLength=function C(A){var w=D(A),k=w[1];return 3*(w[0]+k)/4-k},ee.toByteArray=function F(A){var w,V,P=D(A),k=P[0],L=P[1],M=new S(function _(A,w,P){return 3*(w+P)/4-P}(0,k,L)),R=0,U=L>0?k-4:k;for(V=0;V>16&255,M[R++]=w>>8&255,M[R++]=255&w;return 2===L&&(w=a[A.charCodeAt(V)]<<2|a[A.charCodeAt(V+1)]>>4,M[R++]=255&w),1===L&&(w=a[A.charCodeAt(V)]<<10|a[A.charCodeAt(V+1)]<<4|a[A.charCodeAt(V+2)]>>2,M[R++]=w>>8&255,M[R++]=255&w),M},ee.fromByteArray=function T(A){for(var w,P=A.length,k=P%3,L=[],M=16383,R=0,U=P-k;RU?U:R+M));return 1===k?L.push(E[(w=A[P-1])>>2]+E[w<<4&63]+"=="):2===k&&L.push(E[(w=(A[P-2]<<8)+A[P-1])>>10]+E[w>>4&63]+E[w<<2&63]+"="),L.join("")};for(var E=[],a=[],S=typeof Uint8Array<"u"?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=0;O<64;++O)E[O]=p[O],a[p.charCodeAt(O)]=O;function D(A){var w=A.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");return-1===P&&(P=w),[P,P===w?0:4-P%4]}function B(A){return E[A>>18&63]+E[A>>12&63]+E[A>>6&63]+E[63&A]}function m(A,w,P){for(var L=[],M=w;M=48&&h<=57?h-48:h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:void p(!1,"Invalid character in "+l)}function _(l,s,h){var v=C(l,h);return h-1>=s&&(v|=C(l,h-1)<<4),v}function F(l,s,h,v){for(var y=0,d=0,r=Math.min(l.length,h),f=s;f=49?$-49+10:$>=17?$-17+10:$,p($>=0&&d0?s:h},c.min=function(s,h){return s.cmp(h)<0?s:h},c.prototype._init=function(s,h,v){if("number"==typeof s)return this._initNumber(s,h,v);if("object"==typeof s)return this._initArray(s,h,v);"hex"===h&&(h=16),p(h===(0|h)&&h>=2&&h<=36);var y=0;"-"===(s=s.toString().replace(/\s+/g,""))[0]&&(y++,this.negative=1),y=0;y-=3)this.words[d]|=(r=s[y]|s[y-1]<<8|s[y-2]<<16)<>>26-f&67108863,(f+=24)>=26&&(f-=26,d++);else if("le"===v)for(y=0,d=0;y>>26-f&67108863,(f+=24)>=26&&(f-=26,d++);return this._strip()},c.prototype._parseHex=function(s,h,v){this.length=Math.ceil((s.length-h)/6),this.words=new Array(this.length);for(var y=0;y=h;y-=2)f=_(s,h,y)<=18?(d-=18,this.words[r+=1]|=f>>>26):d+=8;else for(y=(s.length-h)%2==0?h+1:h;y=18?(d-=18,this.words[r+=1]|=f>>>26):d+=8;this._strip()},c.prototype._parseBase=function(s,h,v){this.words=[0],this.length=1;for(var y=0,d=1;d<=67108863;d*=h)y++;y--,d=d/h|0;for(var r=s.length-v,f=r%y,$=Math.min(r,r-f)+v,I=0,j=v;j<$;j+=y)I=F(s,j,j+y,h),this.imuln(d),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I);if(0!==f){var J=1;for(I=F(s,j,s.length,h),j=0;j1&&0===this.words[this.length-1];)this.length--;return this._normSign()},c.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},typeof Symbol<"u"&&"function"==typeof Symbol.for)try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch{c.prototype.inspect=m}else c.prototype.inspect=m;function m(){return(this.red?""}var T=["","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"],A=[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],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function L(l,s,h){h.negative=s.negative^l.negative;var v=l.length+s.length|0;h.length=v,v=v-1|0;var y=0|l.words[0],d=0|s.words[0],r=y*d,$=r/67108864|0;h.words[0]=67108863&r;for(var I=1;I>>26,J=67108863&$,ie=Math.min(I,s.length-1),xe=Math.max(0,I-l.length+1);xe<=ie;xe++)j+=(r=(y=0|l.words[I-xe|0])*(d=0|s.words[xe])+J)/67108864|0,J=67108863&r;h.words[I]=0|J,$=0|j}return 0!==$?h.words[I]=0|$:h.length--,h._strip()}c.prototype.toString=function(s,h){var v;if(h=0|h||1,16===(s=s||10)||"hex"===s){v="";for(var y=0,d=0,r=0;r>>24-y&16777215,(y+=2)>=26&&(y-=26,r--),v=0!==d||r!==this.length-1?T[6-$.length]+$+v:$+v}for(0!==d&&(v=d.toString(16)+v);v.length%h!=0;)v="0"+v;return 0!==this.negative&&(v="-"+v),v}if(s===(0|s)&&s>=2&&s<=36){var I=A[s],j=w[s];v="";var J=this.clone();for(J.negative=0;!J.isZero();){var ie=J.modrn(j).toString(s);v=(J=J.idivn(j)).isZero()?ie+v:T[I-ie.length]+ie+v}for(this.isZero()&&(v="0"+v);v.length%h!=0;)v="0"+v;return 0!==this.negative&&(v="-"+v),v}p(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var s=this.words[0];return 2===this.length?s+=67108864*this.words[1]:3===this.length&&1===this.words[2]?s+=4503599627370496+67108864*this.words[1]:this.length>2&&p(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-s:s},c.prototype.toJSON=function(){return this.toString(16,2)},D&&(c.prototype.toBuffer=function(s,h){return this.toArrayLike(D,s,h)}),c.prototype.toArray=function(s,h){return this.toArrayLike(Array,s,h)},c.prototype.toArrayLike=function(s,h,v){this._strip();var y=this.byteLength(),d=v||Math.max(1,y);p(y<=d,"byte array longer than desired length"),p(d>0,"Requested array length <= 0");var r=function(s,h){return s.allocUnsafe?s.allocUnsafe(h):new s(h)}(s,d);return this["_toArrayLike"+("le"===h?"LE":"BE")](r,y),r},c.prototype._toArrayLikeLE=function(s,h){for(var v=0,y=0,d=0,r=0;d>8&255),v>16&255),6===r?(v>24&255),y=0,r=0):(y=f>>>24,r+=2)}if(v=0&&(s[v--]=f>>8&255),v>=0&&(s[v--]=f>>16&255),6===r?(v>=0&&(s[v--]=f>>24&255),y=0,r=0):(y=f>>>24,r+=2)}if(v>=0)for(s[v--]=y;v>=0;)s[v--]=0},c.prototype._countBits=Math.clz32?function(s){return 32-Math.clz32(s)}:function(s){var h=s,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},c.prototype._zeroBits=function(s){if(0===s)return 26;var h=s,v=0;return 8191&h||(v+=13,h>>>=13),127&h||(v+=7,h>>>=7),15&h||(v+=4,h>>>=4),3&h||(v+=2,h>>>=2),1&h||v++,v},c.prototype.bitLength=function(){var h=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+h},c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,h=0;hs.length?this.clone().ior(s):s.clone().ior(this)},c.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},c.prototype.iuand=function(s){var h;h=this.length>s.length?s:this;for(var v=0;vs.length?this.clone().iand(s):s.clone().iand(this)},c.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},c.prototype.iuxor=function(s){var h,v;this.length>s.length?(h=this,v=s):(h=s,v=this);for(var y=0;ys.length?this.clone().ixor(s):s.clone().ixor(this)},c.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},c.prototype.inotn=function(s){p("number"==typeof s&&s>=0);var h=0|Math.ceil(s/26),v=s%26;this._expand(h),v>0&&h--;for(var y=0;y0&&(this.words[y]=~this.words[y]&67108863>>26-v),this._strip()},c.prototype.notn=function(s){return this.clone().inotn(s)},c.prototype.setn=function(s,h){p("number"==typeof s&&s>=0);var v=s/26|0,y=s%26;return this._expand(v+1),this.words[v]=h?this.words[v]|1<s.length?(v=this,y=s):(v=s,y=this);for(var d=0,r=0;r>>26;for(;0!==d&&r>>26;if(this.length=v.length,0!==d)this.words[this.length]=d,this.length++;else if(v!==this)for(;rs.length?this.clone().iadd(s):s.clone().iadd(this)},c.prototype.isub=function(s){if(0!==s.negative){s.negative=0;var h=this.iadd(s);return s.negative=1,h._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var y,d,v=this.cmp(s);if(0===v)return this.negative=0,this.length=1,this.words[0]=0,this;v>0?(y=this,d=s):(y=s,d=this);for(var r=0,f=0;f>26,this.words[f]=67108863&h;for(;0!==r&&f>26,this.words[f]=67108863&h;if(0===r&&f>>13,De=0|y[1],Q=8191&De,ae=De>>>13,tt=0|y[2],Oe=8191&tt,pe=tt>>>13,Te=0|y[3],Be=8191&Te,re=Te>>>13,ne=0|y[4],G=8191&ne,ge=ne>>>13,xt=0|y[5],Qe=8191&xt,rt=xt>>>13,rn=0|y[6],mt=8191&rn,ft=rn>>>13,un=0|y[7],At=8191&un,It=un>>>13,Cn=0|y[8],St=8191&Cn,Ft=Cn>>>13,bn=0|y[9],bt=8191&bn,wt=bn>>>13,Dn=0|d[0],Bt=8191&Dn,Lt=Dn>>>13,Kt=0|d[1],Nt=8191&Kt,Ot=Kt>>>13,zn=0|d[2],Vt=8191&zn,He=zn>>>13,_e=0|d[3],Ae=8191&_e,Me=_e>>>13,Ze=0|d[4],je=8191&Ze,it=Ze>>>13,Pe=0|d[5],Se=8191&Pe,ze=Pe>>>13,Et=0|d[6],Je=8191&Et,st=Et>>>13,en=0|d[7],yt=8191&en,vt=en>>>13,Wt=0|d[8],Pt=8191&Wt,Rt=Wt>>>13,On=0|d[9],An=8191&On,Bn=On>>>13;v.negative=s.negative^h.negative,v.length=19;var Mn=(f+($=Math.imul(ie,Bt))|0)+((8191&(I=(I=Math.imul(ie,Lt))+Math.imul(xe,Bt)|0))<<13)|0;f=((j=Math.imul(xe,Lt))+(I>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,$=Math.imul(Q,Bt),I=(I=Math.imul(Q,Lt))+Math.imul(ae,Bt)|0,j=Math.imul(ae,Lt);var Kn=(f+($=$+Math.imul(ie,Nt)|0)|0)+((8191&(I=(I=I+Math.imul(ie,Ot)|0)+Math.imul(xe,Nt)|0))<<13)|0;f=((j=j+Math.imul(xe,Ot)|0)+(I>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,$=Math.imul(Oe,Bt),I=(I=Math.imul(Oe,Lt))+Math.imul(pe,Bt)|0,j=Math.imul(pe,Lt),$=$+Math.imul(Q,Nt)|0,I=(I=I+Math.imul(Q,Ot)|0)+Math.imul(ae,Nt)|0,j=j+Math.imul(ae,Ot)|0;var Ln=(f+($=$+Math.imul(ie,Vt)|0)|0)+((8191&(I=(I=I+Math.imul(ie,He)|0)+Math.imul(xe,Vt)|0))<<13)|0;f=((j=j+Math.imul(xe,He)|0)+(I>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,$=Math.imul(Be,Bt),I=(I=Math.imul(Be,Lt))+Math.imul(re,Bt)|0,j=Math.imul(re,Lt),$=$+Math.imul(Oe,Nt)|0,I=(I=I+Math.imul(Oe,Ot)|0)+Math.imul(pe,Nt)|0,j=j+Math.imul(pe,Ot)|0,$=$+Math.imul(Q,Vt)|0,I=(I=I+Math.imul(Q,He)|0)+Math.imul(ae,Vt)|0,j=j+Math.imul(ae,He)|0;var Fn=(f+($=$+Math.imul(ie,Ae)|0)|0)+((8191&(I=(I=I+Math.imul(ie,Me)|0)+Math.imul(xe,Ae)|0))<<13)|0;f=((j=j+Math.imul(xe,Me)|0)+(I>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,$=Math.imul(G,Bt),I=(I=Math.imul(G,Lt))+Math.imul(ge,Bt)|0,j=Math.imul(ge,Lt),$=$+Math.imul(Be,Nt)|0,I=(I=I+Math.imul(Be,Ot)|0)+Math.imul(re,Nt)|0,j=j+Math.imul(re,Ot)|0,$=$+Math.imul(Oe,Vt)|0,I=(I=I+Math.imul(Oe,He)|0)+Math.imul(pe,Vt)|0,j=j+Math.imul(pe,He)|0,$=$+Math.imul(Q,Ae)|0,I=(I=I+Math.imul(Q,Me)|0)+Math.imul(ae,Ae)|0,j=j+Math.imul(ae,Me)|0;var kn=(f+($=$+Math.imul(ie,je)|0)|0)+((8191&(I=(I=I+Math.imul(ie,it)|0)+Math.imul(xe,je)|0))<<13)|0;f=((j=j+Math.imul(xe,it)|0)+(I>>>13)|0)+(kn>>>26)|0,kn&=67108863,$=Math.imul(Qe,Bt),I=(I=Math.imul(Qe,Lt))+Math.imul(rt,Bt)|0,j=Math.imul(rt,Lt),$=$+Math.imul(G,Nt)|0,I=(I=I+Math.imul(G,Ot)|0)+Math.imul(ge,Nt)|0,j=j+Math.imul(ge,Ot)|0,$=$+Math.imul(Be,Vt)|0,I=(I=I+Math.imul(Be,He)|0)+Math.imul(re,Vt)|0,j=j+Math.imul(re,He)|0,$=$+Math.imul(Oe,Ae)|0,I=(I=I+Math.imul(Oe,Me)|0)+Math.imul(pe,Ae)|0,j=j+Math.imul(pe,Me)|0,$=$+Math.imul(Q,je)|0,I=(I=I+Math.imul(Q,it)|0)+Math.imul(ae,je)|0,j=j+Math.imul(ae,it)|0;var Gn=(f+($=$+Math.imul(ie,Se)|0)|0)+((8191&(I=(I=I+Math.imul(ie,ze)|0)+Math.imul(xe,Se)|0))<<13)|0;f=((j=j+Math.imul(xe,ze)|0)+(I>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,$=Math.imul(mt,Bt),I=(I=Math.imul(mt,Lt))+Math.imul(ft,Bt)|0,j=Math.imul(ft,Lt),$=$+Math.imul(Qe,Nt)|0,I=(I=I+Math.imul(Qe,Ot)|0)+Math.imul(rt,Nt)|0,j=j+Math.imul(rt,Ot)|0,$=$+Math.imul(G,Vt)|0,I=(I=I+Math.imul(G,He)|0)+Math.imul(ge,Vt)|0,j=j+Math.imul(ge,He)|0,$=$+Math.imul(Be,Ae)|0,I=(I=I+Math.imul(Be,Me)|0)+Math.imul(re,Ae)|0,j=j+Math.imul(re,Me)|0,$=$+Math.imul(Oe,je)|0,I=(I=I+Math.imul(Oe,it)|0)+Math.imul(pe,je)|0,j=j+Math.imul(pe,it)|0,$=$+Math.imul(Q,Se)|0,I=(I=I+Math.imul(Q,ze)|0)+Math.imul(ae,Se)|0,j=j+Math.imul(ae,ze)|0;var Xn=(f+($=$+Math.imul(ie,Je)|0)|0)+((8191&(I=(I=I+Math.imul(ie,st)|0)+Math.imul(xe,Je)|0))<<13)|0;f=((j=j+Math.imul(xe,st)|0)+(I>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,$=Math.imul(At,Bt),I=(I=Math.imul(At,Lt))+Math.imul(It,Bt)|0,j=Math.imul(It,Lt),$=$+Math.imul(mt,Nt)|0,I=(I=I+Math.imul(mt,Ot)|0)+Math.imul(ft,Nt)|0,j=j+Math.imul(ft,Ot)|0,$=$+Math.imul(Qe,Vt)|0,I=(I=I+Math.imul(Qe,He)|0)+Math.imul(rt,Vt)|0,j=j+Math.imul(rt,He)|0,$=$+Math.imul(G,Ae)|0,I=(I=I+Math.imul(G,Me)|0)+Math.imul(ge,Ae)|0,j=j+Math.imul(ge,Me)|0,$=$+Math.imul(Be,je)|0,I=(I=I+Math.imul(Be,it)|0)+Math.imul(re,je)|0,j=j+Math.imul(re,it)|0,$=$+Math.imul(Oe,Se)|0,I=(I=I+Math.imul(Oe,ze)|0)+Math.imul(pe,Se)|0,j=j+Math.imul(pe,ze)|0,$=$+Math.imul(Q,Je)|0,I=(I=I+Math.imul(Q,st)|0)+Math.imul(ae,Je)|0,j=j+Math.imul(ae,st)|0;var jn=(f+($=$+Math.imul(ie,yt)|0)|0)+((8191&(I=(I=I+Math.imul(ie,vt)|0)+Math.imul(xe,yt)|0))<<13)|0;f=((j=j+Math.imul(xe,vt)|0)+(I>>>13)|0)+(jn>>>26)|0,jn&=67108863,$=Math.imul(St,Bt),I=(I=Math.imul(St,Lt))+Math.imul(Ft,Bt)|0,j=Math.imul(Ft,Lt),$=$+Math.imul(At,Nt)|0,I=(I=I+Math.imul(At,Ot)|0)+Math.imul(It,Nt)|0,j=j+Math.imul(It,Ot)|0,$=$+Math.imul(mt,Vt)|0,I=(I=I+Math.imul(mt,He)|0)+Math.imul(ft,Vt)|0,j=j+Math.imul(ft,He)|0,$=$+Math.imul(Qe,Ae)|0,I=(I=I+Math.imul(Qe,Me)|0)+Math.imul(rt,Ae)|0,j=j+Math.imul(rt,Me)|0,$=$+Math.imul(G,je)|0,I=(I=I+Math.imul(G,it)|0)+Math.imul(ge,je)|0,j=j+Math.imul(ge,it)|0,$=$+Math.imul(Be,Se)|0,I=(I=I+Math.imul(Be,ze)|0)+Math.imul(re,Se)|0,j=j+Math.imul(re,ze)|0,$=$+Math.imul(Oe,Je)|0,I=(I=I+Math.imul(Oe,st)|0)+Math.imul(pe,Je)|0,j=j+Math.imul(pe,st)|0,$=$+Math.imul(Q,yt)|0,I=(I=I+Math.imul(Q,vt)|0)+Math.imul(ae,yt)|0,j=j+Math.imul(ae,vt)|0;var $e=(f+($=$+Math.imul(ie,Pt)|0)|0)+((8191&(I=(I=I+Math.imul(ie,Rt)|0)+Math.imul(xe,Pt)|0))<<13)|0;f=((j=j+Math.imul(xe,Rt)|0)+(I>>>13)|0)+($e>>>26)|0,$e&=67108863,$=Math.imul(bt,Bt),I=(I=Math.imul(bt,Lt))+Math.imul(wt,Bt)|0,j=Math.imul(wt,Lt),$=$+Math.imul(St,Nt)|0,I=(I=I+Math.imul(St,Ot)|0)+Math.imul(Ft,Nt)|0,j=j+Math.imul(Ft,Ot)|0,$=$+Math.imul(At,Vt)|0,I=(I=I+Math.imul(At,He)|0)+Math.imul(It,Vt)|0,j=j+Math.imul(It,He)|0,$=$+Math.imul(mt,Ae)|0,I=(I=I+Math.imul(mt,Me)|0)+Math.imul(ft,Ae)|0,j=j+Math.imul(ft,Me)|0,$=$+Math.imul(Qe,je)|0,I=(I=I+Math.imul(Qe,it)|0)+Math.imul(rt,je)|0,j=j+Math.imul(rt,it)|0,$=$+Math.imul(G,Se)|0,I=(I=I+Math.imul(G,ze)|0)+Math.imul(ge,Se)|0,j=j+Math.imul(ge,ze)|0,$=$+Math.imul(Be,Je)|0,I=(I=I+Math.imul(Be,st)|0)+Math.imul(re,Je)|0,j=j+Math.imul(re,st)|0,$=$+Math.imul(Oe,yt)|0,I=(I=I+Math.imul(Oe,vt)|0)+Math.imul(pe,yt)|0,j=j+Math.imul(pe,vt)|0,$=$+Math.imul(Q,Pt)|0,I=(I=I+Math.imul(Q,Rt)|0)+Math.imul(ae,Pt)|0,j=j+Math.imul(ae,Rt)|0;var lt=(f+($=$+Math.imul(ie,An)|0)|0)+((8191&(I=(I=I+Math.imul(ie,Bn)|0)+Math.imul(xe,An)|0))<<13)|0;f=((j=j+Math.imul(xe,Bn)|0)+(I>>>13)|0)+(lt>>>26)|0,lt&=67108863,$=Math.imul(bt,Nt),I=(I=Math.imul(bt,Ot))+Math.imul(wt,Nt)|0,j=Math.imul(wt,Ot),$=$+Math.imul(St,Vt)|0,I=(I=I+Math.imul(St,He)|0)+Math.imul(Ft,Vt)|0,j=j+Math.imul(Ft,He)|0,$=$+Math.imul(At,Ae)|0,I=(I=I+Math.imul(At,Me)|0)+Math.imul(It,Ae)|0,j=j+Math.imul(It,Me)|0,$=$+Math.imul(mt,je)|0,I=(I=I+Math.imul(mt,it)|0)+Math.imul(ft,je)|0,j=j+Math.imul(ft,it)|0,$=$+Math.imul(Qe,Se)|0,I=(I=I+Math.imul(Qe,ze)|0)+Math.imul(rt,Se)|0,j=j+Math.imul(rt,ze)|0,$=$+Math.imul(G,Je)|0,I=(I=I+Math.imul(G,st)|0)+Math.imul(ge,Je)|0,j=j+Math.imul(ge,st)|0,$=$+Math.imul(Be,yt)|0,I=(I=I+Math.imul(Be,vt)|0)+Math.imul(re,yt)|0,j=j+Math.imul(re,vt)|0,$=$+Math.imul(Oe,Pt)|0,I=(I=I+Math.imul(Oe,Rt)|0)+Math.imul(pe,Pt)|0,j=j+Math.imul(pe,Rt)|0;var Tt=(f+($=$+Math.imul(Q,An)|0)|0)+((8191&(I=(I=I+Math.imul(Q,Bn)|0)+Math.imul(ae,An)|0))<<13)|0;f=((j=j+Math.imul(ae,Bn)|0)+(I>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,$=Math.imul(bt,Vt),I=(I=Math.imul(bt,He))+Math.imul(wt,Vt)|0,j=Math.imul(wt,He),$=$+Math.imul(St,Ae)|0,I=(I=I+Math.imul(St,Me)|0)+Math.imul(Ft,Ae)|0,j=j+Math.imul(Ft,Me)|0,$=$+Math.imul(At,je)|0,I=(I=I+Math.imul(At,it)|0)+Math.imul(It,je)|0,j=j+Math.imul(It,it)|0,$=$+Math.imul(mt,Se)|0,I=(I=I+Math.imul(mt,ze)|0)+Math.imul(ft,Se)|0,j=j+Math.imul(ft,ze)|0,$=$+Math.imul(Qe,Je)|0,I=(I=I+Math.imul(Qe,st)|0)+Math.imul(rt,Je)|0,j=j+Math.imul(rt,st)|0,$=$+Math.imul(G,yt)|0,I=(I=I+Math.imul(G,vt)|0)+Math.imul(ge,yt)|0,j=j+Math.imul(ge,vt)|0,$=$+Math.imul(Be,Pt)|0,I=(I=I+Math.imul(Be,Rt)|0)+Math.imul(re,Pt)|0,j=j+Math.imul(re,Rt)|0;var Mt=(f+($=$+Math.imul(Oe,An)|0)|0)+((8191&(I=(I=I+Math.imul(Oe,Bn)|0)+Math.imul(pe,An)|0))<<13)|0;f=((j=j+Math.imul(pe,Bn)|0)+(I>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,$=Math.imul(bt,Ae),I=(I=Math.imul(bt,Me))+Math.imul(wt,Ae)|0,j=Math.imul(wt,Me),$=$+Math.imul(St,je)|0,I=(I=I+Math.imul(St,it)|0)+Math.imul(Ft,je)|0,j=j+Math.imul(Ft,it)|0,$=$+Math.imul(At,Se)|0,I=(I=I+Math.imul(At,ze)|0)+Math.imul(It,Se)|0,j=j+Math.imul(It,ze)|0,$=$+Math.imul(mt,Je)|0,I=(I=I+Math.imul(mt,st)|0)+Math.imul(ft,Je)|0,j=j+Math.imul(ft,st)|0,$=$+Math.imul(Qe,yt)|0,I=(I=I+Math.imul(Qe,vt)|0)+Math.imul(rt,yt)|0,j=j+Math.imul(rt,vt)|0,$=$+Math.imul(G,Pt)|0,I=(I=I+Math.imul(G,Rt)|0)+Math.imul(ge,Pt)|0,j=j+Math.imul(ge,Rt)|0;var kt=(f+($=$+Math.imul(Be,An)|0)|0)+((8191&(I=(I=I+Math.imul(Be,Bn)|0)+Math.imul(re,An)|0))<<13)|0;f=((j=j+Math.imul(re,Bn)|0)+(I>>>13)|0)+(kt>>>26)|0,kt&=67108863,$=Math.imul(bt,je),I=(I=Math.imul(bt,it))+Math.imul(wt,je)|0,j=Math.imul(wt,it),$=$+Math.imul(St,Se)|0,I=(I=I+Math.imul(St,ze)|0)+Math.imul(Ft,Se)|0,j=j+Math.imul(Ft,ze)|0,$=$+Math.imul(At,Je)|0,I=(I=I+Math.imul(At,st)|0)+Math.imul(It,Je)|0,j=j+Math.imul(It,st)|0,$=$+Math.imul(mt,yt)|0,I=(I=I+Math.imul(mt,vt)|0)+Math.imul(ft,yt)|0,j=j+Math.imul(ft,vt)|0,$=$+Math.imul(Qe,Pt)|0,I=(I=I+Math.imul(Qe,Rt)|0)+Math.imul(rt,Pt)|0,j=j+Math.imul(rt,Rt)|0;var Zt=(f+($=$+Math.imul(G,An)|0)|0)+((8191&(I=(I=I+Math.imul(G,Bn)|0)+Math.imul(ge,An)|0))<<13)|0;f=((j=j+Math.imul(ge,Bn)|0)+(I>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,$=Math.imul(bt,Se),I=(I=Math.imul(bt,ze))+Math.imul(wt,Se)|0,j=Math.imul(wt,ze),$=$+Math.imul(St,Je)|0,I=(I=I+Math.imul(St,st)|0)+Math.imul(Ft,Je)|0,j=j+Math.imul(Ft,st)|0,$=$+Math.imul(At,yt)|0,I=(I=I+Math.imul(At,vt)|0)+Math.imul(It,yt)|0,j=j+Math.imul(It,vt)|0,$=$+Math.imul(mt,Pt)|0,I=(I=I+Math.imul(mt,Rt)|0)+Math.imul(ft,Pt)|0,j=j+Math.imul(ft,Rt)|0;var qt=(f+($=$+Math.imul(Qe,An)|0)|0)+((8191&(I=(I=I+Math.imul(Qe,Bn)|0)+Math.imul(rt,An)|0))<<13)|0;f=((j=j+Math.imul(rt,Bn)|0)+(I>>>13)|0)+(qt>>>26)|0,qt&=67108863,$=Math.imul(bt,Je),I=(I=Math.imul(bt,st))+Math.imul(wt,Je)|0,j=Math.imul(wt,st),$=$+Math.imul(St,yt)|0,I=(I=I+Math.imul(St,vt)|0)+Math.imul(Ft,yt)|0,j=j+Math.imul(Ft,vt)|0,$=$+Math.imul(At,Pt)|0,I=(I=I+Math.imul(At,Rt)|0)+Math.imul(It,Pt)|0,j=j+Math.imul(It,Rt)|0;var Qt=(f+($=$+Math.imul(mt,An)|0)|0)+((8191&(I=(I=I+Math.imul(mt,Bn)|0)+Math.imul(ft,An)|0))<<13)|0;f=((j=j+Math.imul(ft,Bn)|0)+(I>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,$=Math.imul(bt,yt),I=(I=Math.imul(bt,vt))+Math.imul(wt,yt)|0,j=Math.imul(wt,vt),$=$+Math.imul(St,Pt)|0,I=(I=I+Math.imul(St,Rt)|0)+Math.imul(Ft,Pt)|0,j=j+Math.imul(Ft,Rt)|0;var Tn=(f+($=$+Math.imul(At,An)|0)|0)+((8191&(I=(I=I+Math.imul(At,Bn)|0)+Math.imul(It,An)|0))<<13)|0;f=((j=j+Math.imul(It,Bn)|0)+(I>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,$=Math.imul(bt,Pt),I=(I=Math.imul(bt,Rt))+Math.imul(wt,Pt)|0,j=Math.imul(wt,Rt);var wn=(f+($=$+Math.imul(St,An)|0)|0)+((8191&(I=(I=I+Math.imul(St,Bn)|0)+Math.imul(Ft,An)|0))<<13)|0;f=((j=j+Math.imul(Ft,Bn)|0)+(I>>>13)|0)+(wn>>>26)|0,wn&=67108863;var Wn=(f+($=Math.imul(bt,An))|0)+((8191&(I=(I=Math.imul(bt,Bn))+Math.imul(wt,An)|0))<<13)|0;return f=((j=Math.imul(wt,Bn))+(I>>>13)|0)+(Wn>>>26)|0,Wn&=67108863,r[0]=Mn,r[1]=Kn,r[2]=Ln,r[3]=Fn,r[4]=kn,r[5]=Gn,r[6]=Xn,r[7]=jn,r[8]=$e,r[9]=lt,r[10]=Tt,r[11]=Mt,r[12]=kt,r[13]=Zt,r[14]=qt,r[15]=Qt,r[16]=Tn,r[17]=wn,r[18]=Wn,0!==f&&(r[19]=f,v.length++),v};function R(l,s,h){h.negative=s.negative^l.negative,h.length=l.length+s.length;for(var v=0,y=0,d=0;d>>26)|0)>>>26,r&=67108863}h.words[d]=f,v=r,r=y}return 0!==v?h.words[d]=v:h.length--,h._strip()}function U(l,s,h){return R(l,s,h)}function V(l,s){this.x=l,this.y=s}Math.imul||(M=L),c.prototype.mulTo=function(s,h){var y=this.length+s.length;return 10===this.length&&10===s.length?M(this,s,h):y<63?L(this,s,h):y<1024?R(this,s,h):U(this,s,h)},V.prototype.makeRBT=function(s){for(var h=new Array(s),v=c.prototype._countBits(s)-1,y=0;y>=1;return y},V.prototype.permute=function(s,h,v,y,d,r){for(var f=0;f>>=1)d++;return 1<>>=13),d>>>=13;for(r=2*h;r>=26,v+=d/67108864|0,v+=r>>>26,this.words[y]=67108863&r}return 0!==v&&(this.words[y]=v,this.length++),h?this.ineg():this},c.prototype.muln=function(s){return this.clone().imuln(s)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(s){var h=function k(l){for(var s=new Array(l.bitLength()),h=0;h>>h%26&1;return s}(s);if(0===h.length)return new c(1);for(var v=this,y=0;y=0);var d,h=s%26,v=(s-h)/26,y=67108863>>>26-h<<26-h;if(0!==h){var r=0;for(d=0;d>>26-h}r&&(this.words[d]=r,this.length++)}if(0!==v){for(d=this.length-1;d>=0;d--)this.words[d+v]=this.words[d];for(d=0;d=0),y=h?(h-h%26)/26:0;var d=s%26,r=Math.min((s-d)/26,this.length),f=67108863^67108863>>>d<r)for(this.length-=r,I=0;I=0&&(0!==j||I>=y);I--){var J=0|this.words[I];this.words[I]=j<<26-d|J>>>d,j=J&f}return $&&0!==j&&($.words[$.length++]=j),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},c.prototype.ishrn=function(s,h,v){return p(0===this.negative),this.iushrn(s,h,v)},c.prototype.shln=function(s){return this.clone().ishln(s)},c.prototype.ushln=function(s){return this.clone().iushln(s)},c.prototype.shrn=function(s){return this.clone().ishrn(s)},c.prototype.ushrn=function(s){return this.clone().iushrn(s)},c.prototype.testn=function(s){p("number"==typeof s&&s>=0);var h=s%26,v=(s-h)/26;return!(this.length<=v||!(this.words[v]&1<=0);var h=s%26,v=(s-h)/26;return p(0===this.negative,"imaskn works only with positive numbers"),this.length<=v?this:(0!==h&&v++,this.length=Math.min(v,this.length),0!==h&&(this.words[this.length-1]&=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},c.prototype.isubn=function(s){if(p("number"==typeof s),p(s<67108864),s<0)return this.iaddn(-s);if(0!==this.negative)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-($/67108864|0),this.words[d+v]=67108863&r}for(;d>26,this.words[d+v]=67108863&r;if(0===f)return this._strip();for(p(-1===f),f=0,d=0;d>26,this.words[d]=67108863&r;return this.negative=1,this._strip()},c.prototype._wordDiv=function(s,h){var v,y=this.clone(),d=s,r=0|d.words[d.length-1];0!=(v=26-this._countBits(r))&&(d=d.ushln(v),y.iushln(v),r=0|d.words[d.length-1]);var I,$=y.length-d.length;if("mod"!==h){(I=new c(null)).length=$+1,I.words=new Array(I.length);for(var j=0;j=0;ie--){var xe=67108864*(0|y.words[d.length+ie])+(0|y.words[d.length+ie-1]);for(xe=Math.min(xe/r|0,67108863),y._ishlnsubmul(d,xe,ie);0!==y.negative;)xe--,y.negative=0,y._ishlnsubmul(d,1,ie),y.isZero()||(y.negative^=1);I&&(I.words[ie]=xe)}return I&&I._strip(),y._strip(),"div"!==h&&0!==v&&y.iushrn(v),{div:I||null,mod:y}},c.prototype.divmod=function(s,h,v){return p(!s.isZero()),this.isZero()?{div:new c(0),mod:new c(0)}:0!==this.negative&&0===s.negative?(r=this.neg().divmod(s,h),"mod"!==h&&(y=r.div.neg()),"div"!==h&&(d=r.mod.neg(),v&&0!==d.negative&&d.iadd(s)),{div:y,mod:d}):0===this.negative&&0!==s.negative?(r=this.divmod(s.neg(),h),"mod"!==h&&(y=r.div.neg()),{div:y,mod:r.mod}):this.negative&s.negative?(r=this.neg().divmod(s.neg(),h),"div"!==h&&(d=r.mod.neg(),v&&0!==d.negative&&d.isub(s)),{div:r.div,mod:d}):s.length>this.length||this.cmp(s)<0?{div:new c(0),mod:this}:1===s.length?"div"===h?{div:this.divn(s.words[0]),mod:null}:"mod"===h?{div:null,mod:new c(this.modrn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new c(this.modrn(s.words[0]))}:this._wordDiv(s,h);var y,d,r},c.prototype.div=function(s){return this.divmod(s,"div",!1).div},c.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},c.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},c.prototype.divRound=function(s){var h=this.divmod(s);if(h.mod.isZero())return h.div;var v=0!==h.div.negative?h.mod.isub(s):h.mod,y=s.ushrn(1),d=s.andln(1),r=v.cmp(y);return r<0||1===d&&0===r?h.div:0!==h.div.negative?h.div.isubn(1):h.div.iaddn(1)},c.prototype.modrn=function(s){var h=s<0;h&&(s=-s),p(s<=67108863);for(var v=(1<<26)%s,y=0,d=this.length-1;d>=0;d--)y=(v*y+(0|this.words[d]))%s;return h?-y:y},c.prototype.modn=function(s){return this.modrn(s)},c.prototype.idivn=function(s){var h=s<0;h&&(s=-s),p(s<=67108863);for(var v=0,y=this.length-1;y>=0;y--){var d=(0|this.words[y])+67108864*v;this.words[y]=d/s|0,v=d%s}return this._strip(),h?this.ineg():this},c.prototype.divn=function(s){return this.clone().idivn(s)},c.prototype.egcd=function(s){p(0===s.negative),p(!s.isZero());var h=this,v=s.clone();h=0!==h.negative?h.umod(s):h.clone();for(var y=new c(1),d=new c(0),r=new c(0),f=new c(1),$=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++$;for(var I=v.clone(),j=h.clone();!h.isZero();){for(var J=0,ie=1;!(h.words[0]&ie)&&J<26;++J,ie<<=1);if(J>0)for(h.iushrn(J);J-- >0;)(y.isOdd()||d.isOdd())&&(y.iadd(I),d.isub(j)),y.iushrn(1),d.iushrn(1);for(var xe=0,De=1;!(v.words[0]&De)&&xe<26;++xe,De<<=1);if(xe>0)for(v.iushrn(xe);xe-- >0;)(r.isOdd()||f.isOdd())&&(r.iadd(I),f.isub(j)),r.iushrn(1),f.iushrn(1);h.cmp(v)>=0?(h.isub(v),y.isub(r),d.isub(f)):(v.isub(h),r.isub(y),f.isub(d))}return{a:r,b:f,gcd:v.iushln($)}},c.prototype._invmp=function(s){p(0===s.negative),p(!s.isZero());var J,h=this,v=s.clone();h=0!==h.negative?h.umod(s):h.clone();for(var y=new c(1),d=new c(0),r=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var f=0,$=1;!(h.words[0]&$)&&f<26;++f,$<<=1);if(f>0)for(h.iushrn(f);f-- >0;)y.isOdd()&&y.iadd(r),y.iushrn(1);for(var I=0,j=1;!(v.words[0]&j)&&I<26;++I,j<<=1);if(I>0)for(v.iushrn(I);I-- >0;)d.isOdd()&&d.iadd(r),d.iushrn(1);h.cmp(v)>=0?(h.isub(v),y.isub(d)):(v.isub(h),d.isub(y))}return(J=0===h.cmpn(1)?y:d).cmpn(0)<0&&J.iadd(s),J},c.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var h=this.clone(),v=s.clone();h.negative=0,v.negative=0;for(var y=0;h.isEven()&&v.isEven();y++)h.iushrn(1),v.iushrn(1);for(;;){for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var d=h.cmp(v);if(d<0){var r=h;h=v,v=r}else if(0===d||0===v.cmpn(1))break;h.isub(v)}return v.iushln(y)},c.prototype.invm=function(s){return this.egcd(s).a.umod(s)},c.prototype.isEven=function(){return!(1&this.words[0])},c.prototype.isOdd=function(){return!(1&~this.words[0])},c.prototype.andln=function(s){return this.words[0]&s},c.prototype.bincn=function(s){p("number"==typeof s);var h=s%26,v=(s-h)/26,y=1<>>26,this.words[r]=f&=67108863}return 0!==d&&(this.words[r]=d,this.length++),this},c.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},c.prototype.cmpn=function(s){var v,h=s<0;if(0!==this.negative&&!h)return-1;if(0===this.negative&&h)return 1;if(this._strip(),this.length>1)v=1;else{h&&(s=-s),p(s<=67108863,"Number is too big");var y=0|this.words[0];v=y===s?0:ys.length)return 1;if(this.length=0;v--){var y=0|this.words[v],d=0|s.words[v];if(y!==d){yd&&(h=1);break}}return h},c.prototype.gtn=function(s){return 1===this.cmpn(s)},c.prototype.gt=function(s){return 1===this.cmp(s)},c.prototype.gten=function(s){return this.cmpn(s)>=0},c.prototype.gte=function(s){return this.cmp(s)>=0},c.prototype.ltn=function(s){return-1===this.cmpn(s)},c.prototype.lt=function(s){return-1===this.cmp(s)},c.prototype.lten=function(s){return this.cmpn(s)<=0},c.prototype.lte=function(s){return this.cmp(s)<=0},c.prototype.eqn=function(s){return 0===this.cmpn(s)},c.prototype.eq=function(s){return 0===this.cmp(s)},c.red=function(s){return new n(s)},c.prototype.toRed=function(s){return p(!this.red,"Already a number in reduction context"),p(0===this.negative,"red works only with positives"),s.convertTo(this)._forceRed(s)},c.prototype.fromRed=function(){return p(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(s){return this.red=s,this},c.prototype.forceRed=function(s){return p(!this.red,"Already a number in reduction context"),this._forceRed(s)},c.prototype.redAdd=function(s){return p(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},c.prototype.redIAdd=function(s){return p(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},c.prototype.redSub=function(s){return p(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},c.prototype.redISub=function(s){return p(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},c.prototype.redShl=function(s){return p(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},c.prototype.redMul=function(s){return p(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},c.prototype.redIMul=function(s){return p(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},c.prototype.redSqr=function(){return p(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return p(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return p(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return p(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return p(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(s){return p(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var K={k256:null,p224:null,p192:null,p25519:null};function oe(l,s){this.name=l,this.p=new c(s,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function me(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function te(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function se(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function n(l){if("string"==typeof l){var s=c._prime(l);this.m=s.p,this.prime=s}else p(l.gtn(1),"modulus must be greater than 1"),this.m=l,this.prime=null}function o(l){n.call(this,l),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new c(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)}oe.prototype._tmp=function(){var s=new c(null);return s.words=new Array(Math.ceil(this.n/13)),s},oe.prototype.ireduce=function(s){var v,h=s;do{this.split(h,this.tmp),v=(h=(h=this.imulK(h)).iadd(this.tmp)).bitLength()}while(v>this.n);var y=v0?h.isub(this.p):void 0!==h.strip?h.strip():h._strip(),h},oe.prototype.split=function(s,h){s.iushrn(this.n,0,h)},oe.prototype.imulK=function(s){return s.imul(this.k)},O(me,oe),me.prototype.split=function(s,h){for(var v=4194303,y=Math.min(s.length,9),d=0;d>>22,r=f}s.words[d-10]=r>>>=22,s.length-=0===r&&s.length>10?10:9},me.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var h=0,v=0;v>>=26,s.words[v]=d,h=y}return 0!==h&&(s.words[s.length++]=h),s},c._prime=function(s){if(K[s])return K[s];var h;if("k256"===s)h=new me;else if("p224"===s)h=new te;else if("p192"===s)h=new se;else{if("p25519"!==s)throw new Error("Unknown prime "+s);h=new g}return K[s]=h,h},n.prototype._verify1=function(s){p(0===s.negative,"red works only with positives"),p(s.red,"red works only with red numbers")},n.prototype._verify2=function(s,h){p(!(s.negative|h.negative),"red works only with positives"),p(s.red&&s.red===h.red,"red works only with red numbers")},n.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):(B(s,s.umod(this.m)._forceRed(this)),s)},n.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},n.prototype.add=function(s,h){this._verify2(s,h);var v=s.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},n.prototype.iadd=function(s,h){this._verify2(s,h);var v=s.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},n.prototype.sub=function(s,h){this._verify2(s,h);var v=s.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},n.prototype.isub=function(s,h){this._verify2(s,h);var v=s.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},n.prototype.shl=function(s,h){return this._verify1(s),this.imod(s.ushln(h))},n.prototype.imul=function(s,h){return this._verify2(s,h),this.imod(s.imul(h))},n.prototype.mul=function(s,h){return this._verify2(s,h),this.imod(s.mul(h))},n.prototype.isqr=function(s){return this.imul(s,s.clone())},n.prototype.sqr=function(s){return this.mul(s,s)},n.prototype.sqrt=function(s){if(s.isZero())return s.clone();var h=this.m.andln(3);if(p(h%2==1),3===h){var v=this.m.add(new c(1)).iushrn(2);return this.pow(s,v)}for(var y=this.m.subn(1),d=0;!y.isZero()&&0===y.andln(1);)d++,y.iushrn(1);p(!y.isZero());var r=new c(1).toRed(this),f=r.redNeg(),$=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new c(2*I*I).toRed(this);0!==this.pow(I,$).cmp(f);)I.redIAdd(f);for(var j=this.pow(I,y),J=this.pow(s,y.addn(1).iushrn(1)),ie=this.pow(s,y),xe=d;0!==ie.cmp(r);){for(var De=ie,Q=0;0!==De.cmp(r);Q++)De=De.redSqr();p(Q=0;d--){for(var j=h.words[d],J=I-1;J>=0;J--){var ie=j>>J&1;r!==y[0]&&(r=this.sqr(r)),0!==ie||0!==f?(f<<=1,f|=ie,(4==++$||0===d&&0===J)&&(r=this.mul(r,y[f]),$=0,f=0)):$=0}I=26}return r},n.prototype.convertTo=function(s){var h=s.umod(this.m);return h===s?h.clone():h},n.prototype.convertFrom=function(s){var h=s.clone();return h.red=null,h},c.mont=function(s){return new o(s)},O(o,n),o.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},o.prototype.convertFrom=function(s){var h=this.imod(s.mul(this.rinv));return h.red=null,h},o.prototype.imul=function(s,h){if(s.isZero()||h.isZero())return s.words[0]=0,s.length=1,s;var v=s.imul(h),y=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=v.isub(y).iushrn(this.shift),r=d;return d.cmp(this.m)>=0?r=d.isub(this.m):d.cmpn(0)<0&&(r=d.iadd(this.m)),r._forceRed(this)},o.prototype.mul=function(s,h){if(s.isZero()||h.isZero())return new c(0)._forceRed(this);var v=s.mul(h),y=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=v.isub(y).iushrn(this.shift),r=d;return d.cmp(this.m)>=0?r=d.isub(this.m):d.cmpn(0)<0&&(r=d.iadd(this.m)),r._forceRed(this)},o.prototype.invm=function(s){return this.imod(s._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ce=E.nmd(Ce),this)},5294:(Ce,ee,E)=>{var a;function S(O){this.rand=O}if(Ce.exports=function(c){return a||(a=new S(null)),a.generate(c)},Ce.exports.Rand=S,S.prototype.generate=function(c){return this._rand(c)},S.prototype._rand=function(c){if(this.rand.getBytes)return this.rand.getBytes(c);for(var D=new Uint8Array(c),C=0;C{var a=E(7054).Buffer;function S(_){a.isBuffer(_)||(_=a.from(_));for(var F=_.length/4|0,B=new Array(F),m=0;m>>24]^w[M>>>16&255]^P[R>>>8&255]^k[255&U]^F[te++],K=A[M>>>24]^w[R>>>16&255]^P[U>>>8&255]^k[255&L]^F[te++],oe=A[R>>>24]^w[U>>>16&255]^P[L>>>8&255]^k[255&M]^F[te++],me=A[U>>>24]^w[L>>>16&255]^P[M>>>8&255]^k[255&R]^F[te++],L=V,M=K,R=oe,U=me;return V=(m[L>>>24]<<24|m[M>>>16&255]<<16|m[R>>>8&255]<<8|m[255&U])^F[te++],K=(m[M>>>24]<<24|m[R>>>16&255]<<16|m[U>>>8&255]<<8|m[255&L])^F[te++],oe=(m[R>>>24]<<24|m[U>>>16&255]<<16|m[L>>>8&255]<<8|m[255&M])^F[te++],me=(m[U>>>24]<<24|m[L>>>16&255]<<16|m[M>>>8&255]<<8|m[255&R])^F[te++],[V>>>=0,K>>>=0,oe>>>=0,me>>>=0]}var c=[0,1,2,4,8,16,32,64,128,27,54],D=function(){for(var _=new Array(256),F=0;F<256;F++)_[F]=F<128?F<<1:F<<1^283;for(var B=[],m=[],T=[[],[],[],[]],A=[[],[],[],[]],w=0,P=0,k=0;k<256;++k){var L=P^P<<1^P<<2^P<<3^P<<4;B[w]=L=L>>>8^255&L^99,m[L]=w;var M=_[w],R=_[M],U=_[R],V=257*_[L]^16843008*L;T[0][w]=V<<24|V>>>8,T[1][w]=V<<16|V>>>16,T[2][w]=V<<8|V>>>24,T[3][w]=V,A[0][L]=(V=16843009*U^65537*R^257*M^16843008*w)<<24|V>>>8,A[1][L]=V<<16|V>>>16,A[2][L]=V<<8|V>>>24,A[3][L]=V,0===w?w=P=1:(w=M^_[_[_[U^M]]],P^=_[_[P]])}return{SBOX:B,INV_SBOX:m,SUB_MIX:T,INV_SUB_MIX:A}}();function C(_){this._key=S(_),this._reset()}C.blockSize=16,C.keySize=32,C.prototype.blockSize=C.blockSize,C.prototype.keySize=C.keySize,C.prototype._reset=function(){for(var _=this._key,F=_.length,B=F+6,m=4*(B+1),T=[],A=0;A>>24)>>>24]<<24|D.SBOX[w>>>16&255]<<16|D.SBOX[w>>>8&255]<<8|D.SBOX[255&w],w^=c[A/F|0]<<24):F>6&&A%F==4&&(w=D.SBOX[w>>>24]<<24|D.SBOX[w>>>16&255]<<16|D.SBOX[w>>>8&255]<<8|D.SBOX[255&w]),T[A]=T[A-F]^w}for(var P=[],k=0;k>>24]]^D.INV_SUB_MIX[1][D.SBOX[M>>>16&255]]^D.INV_SUB_MIX[2][D.SBOX[M>>>8&255]]^D.INV_SUB_MIX[3][D.SBOX[255&M]]}this._nRounds=B,this._keySchedule=T,this._invKeySchedule=P},C.prototype.encryptBlockRaw=function(_){return O(_=S(_),this._keySchedule,D.SUB_MIX,D.SBOX,this._nRounds)},C.prototype.encryptBlock=function(_){var F=this.encryptBlockRaw(_),B=a.allocUnsafe(16);return B.writeUInt32BE(F[0],0),B.writeUInt32BE(F[1],4),B.writeUInt32BE(F[2],8),B.writeUInt32BE(F[3],12),B},C.prototype.decryptBlock=function(_){var F=(_=S(_))[1];_[1]=_[3],_[3]=F;var B=O(_,this._invKeySchedule,D.INV_SUB_MIX,D.INV_SBOX,this._nRounds),m=a.allocUnsafe(16);return m.writeUInt32BE(B[0],0),m.writeUInt32BE(B[3],4),m.writeUInt32BE(B[2],8),m.writeUInt32BE(B[1],12),m},C.prototype.scrub=function(){p(this._keySchedule),p(this._invKeySchedule),p(this._key)},Ce.exports.AES=C},9307:(Ce,ee,E)=>{var a=E(2375),S=E(7054).Buffer,p=E(3247),O=E(1993),c=E(5917),D=E(3546),C=E(5725);function B(m,T,A,w){p.call(this);var P=S.alloc(4,0);this._cipher=new a.AES(T);var k=this._cipher.encryptBlock(P);this._ghash=new c(k),A=function F(m,T,A){if(12===T.length)return m._finID=S.concat([T,S.from([0,0,0,1])]),S.concat([T,S.from([0,0,0,2])]);var w=new c(A),P=T.length,k=P%16;w.update(T),k&&w.update(S.alloc(k=16-k,0)),w.update(S.alloc(8,0));var L=8*P,M=S.alloc(8);M.writeUIntBE(L,0,8),w.update(M),m._finID=w.state;var R=S.from(m._finID);return C(R),R}(this,A,k),this._prev=S.from(A),this._cache=S.allocUnsafe(0),this._secCache=S.allocUnsafe(0),this._decrypt=w,this._alen=0,this._len=0,this._mode=m,this._authTag=null,this._called=!1}O(B,p),B.prototype._update=function(m){if(!this._called&&this._alen){var T=16-this._alen%16;T<16&&(T=S.alloc(T,0),this._ghash.update(T))}this._called=!0;var A=this._mode.encrypt(this,m);return this._ghash.update(this._decrypt?m:A),this._len+=m.length,A},B.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var m=D(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function _(m,T){var A=0;m.length!==T.length&&A++;for(var w=Math.min(m.length,T.length),P=0;P{var a=E(350),S=E(102),p=E(3219);ee.createCipher=ee.Cipher=a.createCipher,ee.createCipheriv=ee.Cipheriv=a.createCipheriv,ee.createDecipher=ee.Decipher=S.createDecipher,ee.createDecipheriv=ee.Decipheriv=S.createDecipheriv,ee.listCiphers=ee.getCiphers=function O(){return Object.keys(p)}},102:(Ce,ee,E)=>{var a=E(9307),S=E(7054).Buffer,p=E(503),O=E(1821),c=E(3247),D=E(2375),C=E(8211);function F(w,P,k){c.call(this),this._cache=new B,this._last=void 0,this._cipher=new D.AES(P),this._prev=S.from(k),this._mode=w,this._autopadding=!0}function B(){this.cache=S.allocUnsafe(0)}function T(w,P,k){var L=p[w.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if("string"==typeof k&&(k=S.from(k)),"GCM"!==L.mode&&k.length!==L.iv)throw new TypeError("invalid iv length "+k.length);if("string"==typeof P&&(P=S.from(P)),P.length!==L.key/8)throw new TypeError("invalid key length "+P.length);return"stream"===L.type?new O(L.module,P,k,!0):"auth"===L.type?new a(L.module,P,k,!0):new F(L.module,P,k)}E(1993)(F,c),F.prototype._update=function(w){this._cache.add(w);for(var P,k,L=[];P=this._cache.get(this._autopadding);)k=this._mode.decrypt(this,P),L.push(k);return S.concat(L)},F.prototype._final=function(){var w=this._cache.flush();if(this._autopadding)return function m(w){var P=w[15];if(P<1||P>16)throw new Error("unable to decrypt data");for(var k=-1;++k16)return P=this.cache.slice(0,16),this.cache=this.cache.slice(16),P}else if(this.cache.length>=16)return P=this.cache.slice(0,16),this.cache=this.cache.slice(16),P;return null},B.prototype.flush=function(){if(this.cache.length)return this.cache},ee.createDecipher=function A(w,P){var k=p[w.toLowerCase()];if(!k)throw new TypeError("invalid suite type");var L=C(P,!1,k.key,k.iv);return T(w,L.key,L.iv)},ee.createDecipheriv=T},350:(Ce,ee,E)=>{var a=E(503),S=E(9307),p=E(7054).Buffer,O=E(1821),c=E(3247),D=E(2375),C=E(8211);function F(w,P,k){c.call(this),this._cache=new m,this._cipher=new D.AES(P),this._prev=p.from(k),this._mode=w,this._autopadding=!0}E(1993)(F,c),F.prototype._update=function(w){this._cache.add(w);for(var P,k,L=[];P=this._cache.get();)k=this._mode.encrypt(this,P),L.push(k);return p.concat(L)};var B=p.alloc(16,16);function m(){this.cache=p.allocUnsafe(0)}function T(w,P,k){var L=a[w.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if("string"==typeof P&&(P=p.from(P)),P.length!==L.key/8)throw new TypeError("invalid key length "+P.length);if("string"==typeof k&&(k=p.from(k)),"GCM"!==L.mode&&k.length!==L.iv)throw new TypeError("invalid iv length "+k.length);return"stream"===L.type?new O(L.module,P,k):"auth"===L.type?new S(L.module,P,k):new F(L.module,P,k)}F.prototype._final=function(){var w=this._cache.flush();if(this._autopadding)return w=this._mode.encrypt(this,w),this._cipher.scrub(),w;if(!w.equals(B))throw this._cipher.scrub(),new Error("data not multiple of block length")},F.prototype.setAutoPadding=function(w){return this._autopadding=!!w,this},m.prototype.add=function(w){this.cache=p.concat([this.cache,w])},m.prototype.get=function(){if(this.cache.length>15){var w=this.cache.slice(0,16);return this.cache=this.cache.slice(16),w}return null},m.prototype.flush=function(){for(var w=16-this.cache.length,P=p.allocUnsafe(w),k=-1;++k{var a=E(7054).Buffer,S=a.alloc(16,0);function O(D){var C=a.allocUnsafe(16);return C.writeUInt32BE(D[0]>>>0,0),C.writeUInt32BE(D[1]>>>0,4),C.writeUInt32BE(D[2]>>>0,8),C.writeUInt32BE(D[3]>>>0,12),C}function c(D){this.h=D,this.state=a.alloc(16,0),this.cache=a.allocUnsafe(0)}c.prototype.ghash=function(D){for(var C=-1;++C0;_--)D[_]=D[_]>>>1|(1&D[_-1])<<31;D[0]=D[0]>>>1,B&&(D[0]=D[0]^225<<24)}this.state=O(C)},c.prototype.update=function(D){this.cache=a.concat([this.cache,D]);for(var C;this.cache.length>=16;)C=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(C)},c.prototype.final=function(D,C){return this.cache.length&&this.ghash(a.concat([this.cache,S],16)),this.ghash(O([0,D,0,C])),this.state},Ce.exports=c},5725:Ce=>{Ce.exports=function ee(E){for(var S,a=E.length;a--;){if(255!==(S=E.readUInt8(a))){S++,E.writeUInt8(S,a);break}E.writeUInt8(0,a)}}},4133:(Ce,ee,E)=>{var a=E(3546);ee.encrypt=function(S,p){var O=a(p,S._prev);return S._prev=S._cipher.encryptBlock(O),S._prev},ee.decrypt=function(S,p){var O=S._prev;S._prev=p;var c=S._cipher.decryptBlock(p);return a(c,O)}},7090:(Ce,ee,E)=>{var a=E(7054).Buffer,S=E(3546);function p(O,c,D){var C=c.length,_=S(c,O._cache);return O._cache=O._cache.slice(C),O._prev=a.concat([O._prev,D?c:_]),_}ee.encrypt=function(O,c,D){for(var _,C=a.allocUnsafe(0);c.length;){if(0===O._cache.length&&(O._cache=O._cipher.encryptBlock(O._prev),O._prev=a.allocUnsafe(0)),!(O._cache.length<=c.length)){C=a.concat([C,p(O,c,D)]);break}C=a.concat([C,p(O,c.slice(0,_=O._cache.length),D)]),c=c.slice(_)}return C}},1039:(Ce,ee,E)=>{var a=E(7054).Buffer;function S(O,c,D){for(var m,T,_=-1,B=0;++_<8;)B+=(128&(T=O._cipher.encryptBlock(O._prev)[0]^(m=c&1<<7-_?128:0)))>>_%8,O._prev=p(O._prev,D?m:T);return B}function p(O,c){var D=O.length,C=-1,_=a.allocUnsafe(O.length);for(O=a.concat([O,a.from([c])]);++C>7;return _}ee.encrypt=function(O,c,D){for(var C=c.length,_=a.allocUnsafe(C),F=-1;++F{var a=E(7054).Buffer;function S(p,O,c){var C=p._cipher.encryptBlock(p._prev)[0]^O;return p._prev=a.concat([p._prev.slice(1),a.from([c?O:C])]),C}ee.encrypt=function(p,O,c){for(var D=O.length,C=a.allocUnsafe(D),_=-1;++_{var a=E(3546),S=E(7054).Buffer,p=E(5725);function O(D){var C=D._cipher.encryptBlockRaw(D._prev);return p(D._prev),C}ee.encrypt=function(D,C){var _=Math.ceil(C.length/16),F=D._cache.length;D._cache=S.concat([D._cache,S.allocUnsafe(16*_)]);for(var B=0;B<_;B++){var m=O(D),T=F+16*B;D._cache.writeUInt32BE(m[0],T+0),D._cache.writeUInt32BE(m[1],T+4),D._cache.writeUInt32BE(m[2],T+8),D._cache.writeUInt32BE(m[3],T+12)}var A=D._cache.slice(0,C.length);return D._cache=D._cache.slice(C.length),a(C,A)}},7513:(Ce,ee)=>{ee.encrypt=function(E,a){return E._cipher.encryptBlock(a)},ee.decrypt=function(E,a){return E._cipher.decryptBlock(a)}},503:(Ce,ee,E)=>{var a={ECB:E(7513),CBC:E(4133),CFB:E(7090),CFB8:E(2576),CFB1:E(1039),OFB:E(6854),CTR:E(336),GCM:E(336)},S=E(3219);for(var p in S)S[p].module=a[S[p].mode];Ce.exports=S},6854:(Ce,ee,E)=>{var a=E(3546);function S(p){return p._prev=p._cipher.encryptBlock(p._prev),p._prev}ee.encrypt=function(p,O){for(;p._cache.length{var a=E(2375),S=E(7054).Buffer,p=E(3247);function c(D,C,_,F){p.call(this),this._cipher=new a.AES(C),this._prev=S.from(_),this._cache=S.allocUnsafe(0),this._secCache=S.allocUnsafe(0),this._decrypt=F,this._mode=D}E(1993)(c,p),c.prototype._update=function(D){return this._mode.encrypt(this,D,this._decrypt)},c.prototype._final=function(){this._cipher.scrub()},Ce.exports=c},8862:(Ce,ee,E)=>{var a=E(9799),S=E(3388),p=E(503),O=E(9571),c=E(8211);function _(m,T,A){if(m=m.toLowerCase(),p[m])return S.createCipheriv(m,T,A);if(O[m])return new a({key:T,iv:A,mode:m});throw new TypeError("invalid suite type")}function F(m,T,A){if(m=m.toLowerCase(),p[m])return S.createDecipheriv(m,T,A);if(O[m])return new a({key:T,iv:A,mode:m,decrypt:!0});throw new TypeError("invalid suite type")}ee.createCipher=ee.Cipher=function D(m,T){var A,w;if(m=m.toLowerCase(),p[m])A=p[m].key,w=p[m].iv;else{if(!O[m])throw new TypeError("invalid suite type");A=8*O[m].key,w=O[m].iv}var P=c(T,!1,A,w);return _(m,P.key,P.iv)},ee.createCipheriv=ee.Cipheriv=_,ee.createDecipher=ee.Decipher=function C(m,T){var A,w;if(m=m.toLowerCase(),p[m])A=p[m].key,w=p[m].iv;else{if(!O[m])throw new TypeError("invalid suite type");A=8*O[m].key,w=O[m].iv}var P=c(T,!1,A,w);return F(m,P.key,P.iv)},ee.createDecipheriv=ee.Decipheriv=F,ee.listCiphers=ee.getCiphers=function B(){return Object.keys(O).concat(S.getCiphers())}},9799:(Ce,ee,E)=>{var a=E(3247),S=E(1549),p=E(1993),O=E(7054).Buffer,c={"des-ede3-cbc":S.CBC.instantiate(S.EDE),"des-ede3":S.EDE,"des-ede-cbc":S.CBC.instantiate(S.EDE),"des-ede":S.EDE,"des-cbc":S.CBC.instantiate(S.DES),"des-ecb":S.DES};function D(C){a.call(this);var B,_=C.mode.toLowerCase(),F=c[_];B=C.decrypt?"decrypt":"encrypt";var m=C.key;O.isBuffer(m)||(m=O.from(m)),("des-ede"===_||"des-ede-cbc"===_)&&(m=O.concat([m,m.slice(0,8)]));var T=C.iv;O.isBuffer(T)||(T=O.from(T)),this._des=F.create({key:m,iv:T,type:B})}c.des=c["des-cbc"],c.des3=c["des-ede3-cbc"],Ce.exports=D,p(D,a),D.prototype._update=function(C){return O.from(this._des.update(C))},D.prototype._final=function(){return O.from(this._des.final())}},9571:(Ce,ee)=>{ee["des-ecb"]={key:8,iv:0},ee["des-cbc"]=ee.des={key:8,iv:8},ee["des-ede3-cbc"]=ee.des3={key:24,iv:8},ee["des-ede3"]={key:24,iv:0},ee["des-ede-cbc"]={key:16,iv:8},ee["des-ede"]={key:16,iv:0}},4105:(Ce,ee,E)=>{var a=E(917),S=E(3342);function O(D){var _,C=D.modulus.byteLength();do{_=new a(S(C))}while(_.cmp(D.modulus)>=0||!_.umod(D.prime1)||!_.umod(D.prime2));return _}function c(D,C){var _=function p(D){var C=O(D);return{blinder:C.toRed(a.mont(D.modulus)).redPow(new a(D.publicExponent)).fromRed(),unblinder:C.invm(D.modulus)}}(C),F=C.modulus.byteLength(),B=new a(D).mul(_.blinder).umod(C.modulus),m=B.toRed(a.mont(C.prime1)),T=B.toRed(a.mont(C.prime2)),A=C.coefficient,w=C.prime1,P=C.prime2,k=m.redPow(C.exponent1).fromRed(),L=T.redPow(C.exponent2).fromRed(),M=k.isub(L).imul(A).umod(w).imul(P);return L.iadd(M).imul(_.unblinder).umod(C.modulus).toArrayLike(Buffer,"be",F)}c.getr=O,Ce.exports=c},9560:(Ce,ee,E)=>{"use strict";Ce.exports=E(2951)},9143:(Ce,ee,E)=>{"use strict";var a=E(7054).Buffer,S=E(7211),p=E(5942),O=E(1993),c=E(3150),D=E(4754),C=E(2951);function _(T){p.Writable.call(this);var A=C[T];if(!A)throw new Error("Unknown message digest");this._hashType=A.hash,this._hash=S(A.hash),this._tag=A.id,this._signType=A.sign}function F(T){p.Writable.call(this);var A=C[T];if(!A)throw new Error("Unknown message digest");this._hash=S(A.hash),this._tag=A.id,this._signType=A.sign}function B(T){return new _(T)}function m(T){return new F(T)}Object.keys(C).forEach(function(T){C[T].id=a.from(C[T].id,"hex"),C[T.toLowerCase()]=C[T]}),O(_,p.Writable),_.prototype._write=function(A,w,P){this._hash.update(A),P()},_.prototype.update=function(A,w){return this._hash.update("string"==typeof A?a.from(A,w):A),this},_.prototype.sign=function(A,w){this.end();var P=this._hash.digest(),k=c(P,A,this._hashType,this._signType,this._tag);return w?k.toString(w):k},O(F,p.Writable),F.prototype._write=function(A,w,P){this._hash.update(A),P()},F.prototype.update=function(A,w){return this._hash.update("string"==typeof A?a.from(A,w):A),this},F.prototype.verify=function(A,w,P){var k="string"==typeof w?a.from(w,P):w;this.end();var L=this._hash.digest();return D(k,L,A,this._signType,this._tag)},Ce.exports={Sign:B,Verify:m,createSign:B,createVerify:m}},3150:(Ce,ee,E)=>{"use strict";var a=E(7054).Buffer,S=E(6432),p=E(4105),O=E(518).ec,c=E(917),D=E(5667),C=E(4589);function A(M,R,U,V){if((M=a.from(M.toArray())).length0&&U.ishrn(V),U}function k(M,R,U){var V,K;do{for(V=a.alloc(0);8*V.length{"use strict";var a=E(7054).Buffer,S=E(917),p=E(518).ec,O=E(5667),c=E(4589);function F(B,m){if(B.cmpn(0)<=0)throw new Error("invalid sig");if(B.cmp(m)>=0)throw new Error("invalid sig")}Ce.exports=function D(B,m,T,A,w){var P=O(T);if("ec"===P.type){if("ecdsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");return function C(B,m,T){var A=c[T.data.algorithm.curve.join(".")];if(!A)throw new Error("unknown curve "+T.data.algorithm.curve.join("."));return new p(A).verify(m,B,T.data.subjectPrivateKey.data)}(B,m,P)}if("dsa"===P.type){if("dsa"!==A)throw new Error("wrong public key type");return function _(B,m,T){var A=T.data.p,w=T.data.q,P=T.data.g,k=T.data.pub_key,L=O.signature.decode(B,"der"),M=L.s,R=L.r;F(M,w),F(R,w);var U=S.mont(A),V=M.invm(w);return 0===P.toRed(U).redPow(new S(m).mul(V).mod(w)).fromRed().mul(k.toRed(U).redPow(R.mul(V).mod(w)).fromRed()).mod(A).mod(w).cmp(R)}(B,m,P)}if("rsa"!==A&&"ecdsa/rsa"!==A)throw new Error("wrong public key type");m=a.concat([w,m]);for(var k=P.modulus.byteLength(),L=[1],M=0;m.length+L.length+2{Ce.exports=function(E,a){for(var S=Math.min(E.length,a.length),p=new Buffer(S),O=0;O{"use strict";var a=E(3981),S=E(2020),p="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;ee.Buffer=C,ee.SlowBuffer=function M(re){return+re!=re&&(re=0),C.alloc(+re)},ee.INSPECT_MAX_BYTES=50;var O=2147483647;function D(re){if(re>O)throw new RangeError('The value "'+re+'" is invalid for option "size"');var ne=new Uint8Array(re);return Object.setPrototypeOf(ne,C.prototype),ne}function C(re,ne,G){if("number"==typeof re){if("string"==typeof ne)throw new TypeError('The "string" argument must be of type string. Received type number');return m(re)}return _(re,ne,G)}function _(re,ne,G){if("string"==typeof re)return function T(re,ne){if(("string"!=typeof ne||""===ne)&&(ne="utf8"),!C.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);var G=0|R(re,ne),ge=D(G),xt=ge.write(re,ne);return xt!==G&&(ge=ge.slice(0,xt)),ge}(re,ne);if(ArrayBuffer.isView(re))return function w(re){if(pe(re,Uint8Array)){var ne=new Uint8Array(re);return P(ne.buffer,ne.byteOffset,ne.byteLength)}return A(re)}(re);if(null==re)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof re);if(pe(re,ArrayBuffer)||re&&pe(re.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(re,SharedArrayBuffer)||re&&pe(re.buffer,SharedArrayBuffer)))return P(re,ne,G);if("number"==typeof re)throw new TypeError('The "value" argument must not be of type number. Received type number');var ge=re.valueOf&&re.valueOf();if(null!=ge&&ge!==re)return C.from(ge,ne,G);var xt=function k(re){if(C.isBuffer(re)){var ne=0|L(re.length),G=D(ne);return 0===G.length||re.copy(G,0,0,ne),G}return void 0!==re.length?"number"!=typeof re.length||Te(re.length)?D(0):A(re):"Buffer"===re.type&&Array.isArray(re.data)?A(re.data):void 0}(re);if(xt)return xt;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof re[Symbol.toPrimitive])return C.from(re[Symbol.toPrimitive]("string"),ne,G);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof re)}function F(re){if("number"!=typeof re)throw new TypeError('"size" argument must be of type number');if(re<0)throw new RangeError('The value "'+re+'" is invalid for option "size"')}function m(re){return F(re),D(re<0?0:0|L(re))}function A(re){for(var ne=re.length<0?0:0|L(re.length),G=D(ne),ge=0;ge=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return 0|re}function R(re,ne){if(C.isBuffer(re))return re.length;if(ArrayBuffer.isView(re)||pe(re,ArrayBuffer))return re.byteLength;if("string"!=typeof re)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof re);var G=re.length,ge=arguments.length>2&&!0===arguments[2];if(!ge&&0===G)return 0;for(var xt=!1;;)switch(ne){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return De(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*G;case"hex":return G>>>1;case"base64":return tt(re).length;default:if(xt)return ge?-1:De(re).length;ne=(""+ne).toLowerCase(),xt=!0}}function U(re,ne,G){var ge=!1;if((void 0===ne||ne<0)&&(ne=0),ne>this.length||((void 0===G||G>this.length)&&(G=this.length),G<=0)||(G>>>=0)<=(ne>>>=0))return"";for(re||(re="utf8");;)switch(re){case"hex":return d(this,ne,G);case"utf8":case"utf-8":return l(this,ne,G);case"ascii":return v(this,ne,G);case"latin1":case"binary":return y(this,ne,G);case"base64":return o(this,ne,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r(this,ne,G);default:if(ge)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),ge=!0}}function V(re,ne,G){var ge=re[ne];re[ne]=re[G],re[G]=ge}function K(re,ne,G,ge,xt){if(0===re.length)return-1;if("string"==typeof G?(ge=G,G=0):G>2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),Te(G=+G)&&(G=xt?0:re.length-1),G<0&&(G=re.length+G),G>=re.length){if(xt)return-1;G=re.length-1}else if(G<0){if(!xt)return-1;G=0}if("string"==typeof ne&&(ne=C.from(ne,ge)),C.isBuffer(ne))return 0===ne.length?-1:oe(re,ne,G,ge,xt);if("number"==typeof ne)return ne&=255,"function"==typeof Uint8Array.prototype.indexOf?xt?Uint8Array.prototype.indexOf.call(re,ne,G):Uint8Array.prototype.lastIndexOf.call(re,ne,G):oe(re,[ne],G,ge,xt);throw new TypeError("val must be string, number or Buffer")}function oe(re,ne,G,ge,xt){var ft,Qe=1,rt=re.length,rn=ne.length;if(void 0!==ge&&("ucs2"===(ge=String(ge).toLowerCase())||"ucs-2"===ge||"utf16le"===ge||"utf-16le"===ge)){if(re.length<2||ne.length<2)return-1;Qe=2,rt/=2,rn/=2,G/=2}function mt(Cn,St){return 1===Qe?Cn[St]:Cn.readUInt16BE(St*Qe)}if(xt){var un=-1;for(ft=G;ft