>>=13,_[2*U+1]=8191&O,O>>>=13;for(U=2*w;U>=26,w+=p/67108864|0,w+=O>>>26,this.words[_]=67108863&O}return w!==0&&(this.words[_]=w,this.length++),this},a.prototype.muln=function(A){return this.clone().imuln(A)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(A){var w=function(U){for(var T=new Array(U.bitLength()),z=0;z>>X}return T}(A);if(w.length===0)return new a(1);for(var _=this,p=0;p=0);var w,_=A%26,p=(A-_)/26,O=67108863>>>26-_<<26-_;if(_!==0){var U=0;for(w=0;w>>26-_}U&&(this.words[w]=U,this.length++)}if(p!==0){for(w=this.length-1;w>=0;w--)this.words[w+p]=this.words[w];for(w=0;w=0),p=w?(w-w%26)/26:0;var O=A%26,U=Math.min((A-O)/26,this.length),T=67108863^67108863>>>O<U)for(this.length-=U,te=0;te=0&&(X!==0||te>=p);te--){var ne=0|this.words[te];this.words[te]=X<<26-O|ne>>>O,X=ne&T}return z&&X!==0&&(z.words[z.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(A,w,_){return P(this.negative===0),this.iushrn(A,w,_)},a.prototype.shln=function(A){return this.clone().ishln(A)},a.prototype.ushln=function(A){return this.clone().iushln(A)},a.prototype.shrn=function(A){return this.clone().ishrn(A)},a.prototype.ushrn=function(A){return this.clone().iushrn(A)},a.prototype.testn=function(A){P(typeof A=="number"&&A>=0);var w=A%26,_=(A-w)/26,p=1<=0);var w=A%26,_=(A-w)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(w!==0&&_++,this.length=Math.min(_,this.length),w!==0){var p=67108863^67108863>>>w<=67108864;w++)this.words[w]-=67108864,w===this.length-1?this.words[w+1]=1:this.words[w+1]++;return this.length=Math.max(this.length,w+1),this},a.prototype.isubn=function(A){if(P(typeof A=="number"),P(A<67108864),A<0)return this.iaddn(-A);if(this.negative!==0)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var w=0;w>26)-(z/67108864|0),this.words[p+_]=67108863&O}for(;p>26,this.words[p+_]=67108863&O;if(T===0)return this.strip();for(P(T===-1),T=0,p=0;p>26,this.words[p]=67108863&O;return this.negative=1,this.strip()},a.prototype._wordDiv=function(A,w){var _=(this.length,A.length),p=this.clone(),O=A,U=0|O.words[O.length-1];(_=26-this._countBits(U))!=0&&(O=O.ushln(_),p.iushln(_),U=0|O.words[O.length-1]);var T,z=p.length-O.length;if(w!=="mod"){(T=new a(null)).length=z+1,T.words=new Array(T.length);for(var te=0;te=0;ne--){var B=67108864*(0|p.words[O.length+ne])+(0|p.words[O.length+ne-1]);for(B=Math.min(B/U|0,67108863),p._ishlnsubmul(O,B,ne);p.negative!==0;)B--,p.negative=0,p._ishlnsubmul(O,1,ne),p.isZero()||(p.negative^=1);T&&(T.words[ne]=B)}return T&&T.strip(),p.strip(),w!=="div"&&_!==0&&p.iushrn(_),{div:T||null,mod:p}},a.prototype.divmod=function(A,w,_){return P(!A.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:this.negative!==0&&A.negative===0?(U=this.neg().divmod(A,w),w!=="mod"&&(p=U.div.neg()),w!=="div"&&(O=U.mod.neg(),_&&O.negative!==0&&O.iadd(A)),{div:p,mod:O}):this.negative===0&&A.negative!==0?(U=this.divmod(A.neg(),w),w!=="mod"&&(p=U.div.neg()),{div:p,mod:U.mod}):this.negative&A.negative?(U=this.neg().divmod(A.neg(),w),w!=="div"&&(O=U.mod.neg(),_&&O.negative!==0&&O.isub(A)),{div:U.div,mod:O}):A.length>this.length||this.cmp(A)<0?{div:new a(0),mod:this}:A.length===1?w==="div"?{div:this.divn(A.words[0]),mod:null}:w==="mod"?{div:null,mod:new a(this.modn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new a(this.modn(A.words[0]))}:this._wordDiv(A,w);var p,O,U},a.prototype.div=function(A){return this.divmod(A,"div",!1).div},a.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},a.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},a.prototype.divRound=function(A){var w=this.divmod(A);if(w.mod.isZero())return w.div;var _=w.div.negative!==0?w.mod.isub(A):w.mod,p=A.ushrn(1),O=A.andln(1),U=_.cmp(p);return U<0||O===1&&U===0?w.div:w.div.negative!==0?w.div.isubn(1):w.div.iaddn(1)},a.prototype.modn=function(A){P(A<=67108863);for(var w=67108864%A,_=0,p=this.length-1;p>=0;p--)_=(w*_+(0|this.words[p]))%A;return _},a.prototype.idivn=function(A){P(A<=67108863);for(var w=0,_=this.length-1;_>=0;_--){var p=(0|this.words[_])+67108864*w;this.words[_]=p/A|0,w=p%A}return this.strip()},a.prototype.divn=function(A){return this.clone().idivn(A)},a.prototype.egcd=function(A){P(A.negative===0),P(!A.isZero());var w=this,_=A.clone();w=w.negative!==0?w.umod(A):w.clone();for(var p=new a(1),O=new a(0),U=new a(0),T=new a(1),z=0;w.isEven()&&_.isEven();)w.iushrn(1),_.iushrn(1),++z;for(var te=_.clone(),X=w.clone();!w.isZero();){for(var ne=0,B=1;!(w.words[0]&B)&&ne<26;++ne,B<<=1);if(ne>0)for(w.iushrn(ne);ne-- >0;)(p.isOdd()||O.isOdd())&&(p.iadd(te),O.isub(X)),p.iushrn(1),O.iushrn(1);for(var Q=0,V=1;!(_.words[0]&V)&&Q<26;++Q,V<<=1);if(Q>0)for(_.iushrn(Q);Q-- >0;)(U.isOdd()||T.isOdd())&&(U.iadd(te),T.isub(X)),U.iushrn(1),T.iushrn(1);w.cmp(_)>=0?(w.isub(_),p.isub(U),O.isub(T)):(_.isub(w),U.isub(p),T.isub(O))}return{a:U,b:T,gcd:_.iushln(z)}},a.prototype._invmp=function(A){P(A.negative===0),P(!A.isZero());var w=this,_=A.clone();w=w.negative!==0?w.umod(A):w.clone();for(var p,O=new a(1),U=new a(0),T=_.clone();w.cmpn(1)>0&&_.cmpn(1)>0;){for(var z=0,te=1;!(w.words[0]&te)&&z<26;++z,te<<=1);if(z>0)for(w.iushrn(z);z-- >0;)O.isOdd()&&O.iadd(T),O.iushrn(1);for(var X=0,ne=1;!(_.words[0]&ne)&&X<26;++X,ne<<=1);if(X>0)for(_.iushrn(X);X-- >0;)U.isOdd()&&U.iadd(T),U.iushrn(1);w.cmp(_)>=0?(w.isub(_),O.isub(U)):(_.isub(w),U.isub(O))}return(p=w.cmpn(1)===0?O:U).cmpn(0)<0&&p.iadd(A),p},a.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var w=this.clone(),_=A.clone();w.negative=0,_.negative=0;for(var p=0;w.isEven()&&_.isEven();p++)w.iushrn(1),_.iushrn(1);for(;;){for(;w.isEven();)w.iushrn(1);for(;_.isEven();)_.iushrn(1);var O=w.cmp(_);if(O<0){var U=w;w=_,_=U}else if(O===0||_.cmpn(1)===0)break;w.isub(_)}return _.iushln(p)},a.prototype.invm=function(A){return this.egcd(A).a.umod(A)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(A){return this.words[0]&A},a.prototype.bincn=function(A){P(typeof A=="number");var w=A%26,_=(A-w)/26,p=1<>>26,T&=67108863,this.words[U]=T}return O!==0&&(this.words[U]=O,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(A){var w,_=A<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;if(this.strip(),this.length>1)w=1;else{_&&(A=-A),P(A<=67108863,"Number is too big");var p=0|this.words[0];w=p===A?0:pA.length)return 1;if(this.length=0;_--){var p=0|this.words[_],O=0|A.words[_];if(p!==O){pO&&(w=1);break}}return w},a.prototype.gtn=function(A){return this.cmpn(A)===1},a.prototype.gt=function(A){return this.cmp(A)===1},a.prototype.gten=function(A){return this.cmpn(A)>=0},a.prototype.gte=function(A){return this.cmp(A)>=0},a.prototype.ltn=function(A){return this.cmpn(A)===-1},a.prototype.lt=function(A){return this.cmp(A)===-1},a.prototype.lten=function(A){return this.cmpn(A)<=0},a.prototype.lte=function(A){return this.cmp(A)<=0},a.prototype.eqn=function(A){return this.cmpn(A)===0},a.prototype.eq=function(A){return this.cmp(A)===0},a.red=function(A){return new k(A)},a.prototype.toRed=function(A){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),A.convertTo(this)._forceRed(A)},a.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(A){return this.red=A,this},a.prototype.forceRed=function(A){return P(!this.red,"Already a number in reduction context"),this._forceRed(A)},a.prototype.redAdd=function(A){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},a.prototype.redIAdd=function(A){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},a.prototype.redSub=function(A){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},a.prototype.redISub=function(A){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},a.prototype.redShl=function(A){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},a.prototype.redMul=function(A){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},a.prototype.redIMul=function(A){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},a.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(A){return P(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var m={k256:null,p224:null,p192:null,p25519:null};function v(A,w){this.name=A,this.p=new a(w,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function C(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function l(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function R(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(A){if(typeof A=="string"){var w=a._prime(A);this.m=w.p,this.prime=w}else P(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}function N(A){k.call(this,A),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)}v.prototype._tmp=function(){var A=new a(null);return A.words=new Array(Math.ceil(this.n/13)),A},v.prototype.ireduce=function(A){var w,_=A;do this.split(_,this.tmp),w=(_=(_=this.imulK(_)).iadd(this.tmp)).bitLength();while(w>this.n);var p=w0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},v.prototype.split=function(A,w){A.iushrn(this.n,0,w)},v.prototype.imulK=function(A){return A.imul(this.k)},y(C,v),C.prototype.split=function(A,w){for(var _=4194303,p=Math.min(A.length,9),O=0;O>>22,U=T}U>>>=22,A.words[O-10]=U,U===0&&A.length>10?A.length-=10:A.length-=9},C.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var w=0,_=0;_>>=26,A.words[_]=O,w=p}return w!==0&&(A.words[A.length++]=w),A},a._prime=function(A){if(m[A])return m[A];var w;if(A==="k256")w=new C;else if(A==="p224")w=new l;else if(A==="p192")w=new I;else{if(A!=="p25519")throw new Error("Unknown prime "+A);w=new R}return m[A]=w,w},k.prototype._verify1=function(A){P(A.negative===0,"red works only with positives"),P(A.red,"red works only with red numbers")},k.prototype._verify2=function(A,w){P((A.negative|w.negative)==0,"red works only with positives"),P(A.red&&A.red===w.red,"red works only with red numbers")},k.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):A.umod(this.m)._forceRed(this)},k.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},k.prototype.add=function(A,w){this._verify2(A,w);var _=A.add(w);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},k.prototype.iadd=function(A,w){this._verify2(A,w);var _=A.iadd(w);return _.cmp(this.m)>=0&&_.isub(this.m),_},k.prototype.sub=function(A,w){this._verify2(A,w);var _=A.sub(w);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},k.prototype.isub=function(A,w){this._verify2(A,w);var _=A.isub(w);return _.cmpn(0)<0&&_.iadd(this.m),_},k.prototype.shl=function(A,w){return this._verify1(A),this.imod(A.ushln(w))},k.prototype.imul=function(A,w){return this._verify2(A,w),this.imod(A.imul(w))},k.prototype.mul=function(A,w){return this._verify2(A,w),this.imod(A.mul(w))},k.prototype.isqr=function(A){return this.imul(A,A.clone())},k.prototype.sqr=function(A){return this.mul(A,A)},k.prototype.sqrt=function(A){if(A.isZero())return A.clone();var w=this.m.andln(3);if(P(w%2==1),w===3){var _=this.m.add(new a(1)).iushrn(2);return this.pow(A,_)}for(var p=this.m.subn(1),O=0;!p.isZero()&&p.andln(1)===0;)O++,p.iushrn(1);P(!p.isZero());var U=new a(1).toRed(this),T=U.redNeg(),z=this.m.subn(1).iushrn(1),te=this.m.bitLength();for(te=new a(2*te*te).toRed(this);this.pow(te,z).cmp(T)!==0;)te.redIAdd(T);for(var X=this.pow(te,p),ne=this.pow(A,p.addn(1).iushrn(1)),B=this.pow(A,p),Q=O;B.cmp(U)!==0;){for(var V=B,ee=0;V.cmp(U)!==0;ee++)V=V.redSqr();P(ee=0;p--){for(var te=w.words[p],X=z-1;X>=0;X--){var ne=te>>X&1;O!==_[0]&&(O=this.sqr(O)),ne!==0||U!==0?(U<<=1,U|=ne,(++T==4||p===0&&X===0)&&(O=this.mul(O,_[U]),T=0,U=0)):T=0}z=26}return O},k.prototype.convertTo=function(A){var w=A.umod(this.m);return w===A?w.clone():w},k.prototype.convertFrom=function(A){var w=A.clone();return w.red=null,w},a.mont=function(A){return new N(A)},y(N,k),N.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},N.prototype.convertFrom=function(A){var w=this.imod(A.mul(this.rinv));return w.red=null,w},N.prototype.imul=function(A,w){if(A.isZero()||w.isZero())return A.words[0]=0,A.length=1,A;var _=A.imul(w),p=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(p).iushrn(this.shift),U=O;return O.cmp(this.m)>=0?U=O.isub(this.m):O.cmpn(0)<0&&(U=O.iadd(this.m)),U._forceRed(this)},N.prototype.mul=function(A,w){if(A.isZero()||w.isZero())return new a(0)._forceRed(this);var _=A.mul(w),p=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=_.isub(p).iushrn(this.shift),U=O;return O.cmp(this.m)>=0?U=O.isub(this.m):O.cmpn(0)<0&&(U=O.iadd(this.m)),U._forceRed(this)},N.prototype.invm=function(A){return this.imod(A._invmp(this.m).mul(this.r2))._forceRed(this)}})(J=b.nmd(J),this)},9931:(J,e,b)=>{var E;function M(y){this.rand=y}if(J.exports=function(y){return E||(E=new M(null)),E.generate(y)},J.exports.Rand=M,M.prototype.generate=function(y){return this._rand(y)},M.prototype._rand=function(y){if(this.rand.getBytes)return this.rand.getBytes(y);for(var a=new Uint8Array(y),t=0;t{var E=b(8162);J.exports=E("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},3310:(J,e,b)=>{var E=b(7191),M=b(9509).Buffer;J.exports=function(P){function y(a){var t=a.slice(0,-4),d=a.slice(-4),u=P(t);if(!(d[0]^u[0]|d[1]^u[1]|d[2]^u[2]|d[3]^u[3]))return t}return{encode:function(a){var t=P(a);return E.encode(M.concat([a,t],a.length+4))},decode:function(a){var t=y(E.decode(a));if(!t)throw new Error("Invalid checksum");return t},decodeUnsafe:function(a){var t=E.decodeUnsafe(a);if(t)return y(t)}}}},8334:(J,e,b)=>{var E=b(3482),M=b(3310);J.exports=M(function(P){var y=E("sha256").update(P).digest();return E("sha256").update(y).digest()})},8764:(J,e,b)=>{var E=b(5108);const M=b(9742),P=b(645),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=d,e.SlowBuffer=function(S){return+S!=S&&(S=0),d.alloc(+S)},e.INSPECT_MAX_BYTES=50;const a=2147483647;function t(S){if(S>a)throw new RangeError('The value "'+S+'" is invalid for option "size"');const x=new Uint8Array(S);return Object.setPrototypeOf(x,d.prototype),x}function d(S,x,j){if(typeof S=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return r(S)}return u(S,x,j)}function u(S,x,j){if(typeof S=="string")return function(F,re){if(typeof re=="string"&&re!==""||(re="utf8"),!d.isEncoding(re))throw new TypeError("Unknown encoding: "+re);const oe=0|f(F,re);let G=t(oe);const Z=G.write(F,re);return Z!==oe&&(G=G.slice(0,Z)),G}(S,x);if(ArrayBuffer.isView(S))return function(F){if(ce(F,Uint8Array)){const re=new Uint8Array(F);return o(re.buffer,re.byteOffset,re.byteLength)}return n(F)}(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(ce(S,ArrayBuffer)||S&&ce(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ce(S,SharedArrayBuffer)||S&&ce(S.buffer,SharedArrayBuffer)))return o(S,x,j);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=S.valueOf&&S.valueOf();if(D!=null&&D!==S)return d.from(D,x,j);const L=function(F){if(d.isBuffer(F)){const re=0|i(F.length),oe=t(re);return oe.length===0||F.copy(oe,0,0,re),oe}return F.length!==void 0?typeof F.length!="number"||he(F.length)?t(0):n(F):F.type==="Buffer"&&Array.isArray(F.data)?n(F.data):void 0}(S);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return d.from(S[Symbol.toPrimitive]("string"),x,j);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}function s(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function r(S){return s(S),t(S<0?0:0|i(S))}function n(S){const x=S.length<0?0:0|i(S.length),j=t(x);for(let D=0;D=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|S}function f(S,x){if(d.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||ce(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const j=S.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&j===0)return 0;let L=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":return ue(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*j;case"hex":return j>>>1;case"base64":return le(S).length;default:if(L)return D?-1:ue(S).length;x=(""+x).toLowerCase(),L=!0}}function c(S,x,j){let D=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((j===void 0||j>this.length)&&(j=this.length),j<=0)||(j>>>=0)<=(x>>>=0))return"";for(S||(S="utf8");;)switch(S){case"hex":return O(this,x,j);case"utf8":case"utf-8":return A(this,x,j);case"ascii":return _(this,x,j);case"latin1":case"binary":return p(this,x,j);case"base64":return N(this,x,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,x,j);default:if(D)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),D=!0}}function h(S,x,j){const D=S[x];S[x]=S[j],S[j]=D}function m(S,x,j,D,L){if(S.length===0)return-1;if(typeof j=="string"?(D=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),he(j=+j)&&(j=L?0:S.length-1),j<0&&(j=S.length+j),j>=S.length){if(L)return-1;j=S.length-1}else if(j<0){if(!L)return-1;j=0}if(typeof x=="string"&&(x=d.from(x,D)),d.isBuffer(x))return x.length===0?-1:v(S,x,j,D,L);if(typeof x=="number")return x&=255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(S,x,j):Uint8Array.prototype.lastIndexOf.call(S,x,j):v(S,[x],j,D,L);throw new TypeError("val must be string, number or Buffer")}function v(S,x,j,D,L){let F,re=1,oe=S.length,G=x.length;if(D!==void 0&&((D=String(D).toLowerCase())==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(S.length<2||x.length<2)return-1;re=2,oe/=2,G/=2,j/=2}function Z(H,$){return re===1?H[$]:H.readUInt16BE($*re)}if(L){let H=-1;for(F=j;Foe&&(j=oe-G),F=j;F>=0;F--){let H=!0;for(let $=0;$L&&(D=L):D=L;const F=x.length;let re;for(D>F/2&&(D=F/2),re=0;re>8,G=re%256,Z.push(G),Z.push(oe);return Z}(x,S.length-j),S,j,D)}function N(S,x,j){return x===0&&j===S.length?M.fromByteArray(S):M.fromByteArray(S.slice(x,j))}function A(S,x,j){j=Math.min(S.length,j);const D=[];let L=x;for(;L239?4:F>223?3:F>191?2:1;if(L+oe<=j){let G,Z,H,$;switch(oe){case 1:F<128&&(re=F);break;case 2:G=S[L+1],(192&G)==128&&($=(31&F)<<6|63&G,$>127&&(re=$));break;case 3:G=S[L+1],Z=S[L+2],(192&G)==128&&(192&Z)==128&&($=(15&F)<<12|(63&G)<<6|63&Z,$>2047&&($<55296||$>57343)&&(re=$));break;case 4:G=S[L+1],Z=S[L+2],H=S[L+3],(192&G)==128&&(192&Z)==128&&(192&H)==128&&($=(15&F)<<18|(63&G)<<12|(63&Z)<<6|63&H,$>65535&&$<1114112&&(re=$))}}re===null?(re=65533,oe=1):re>65535&&(re-=65536,D.push(re>>>10&1023|55296),re=56320|1023&re),D.push(re),L+=oe}return function(F){const re=F.length;if(re<=w)return String.fromCharCode.apply(String,F);let oe="",G=0;for(;GD.length?(d.isBuffer(F)||(F=d.from(F)),F.copy(D,L)):Uint8Array.prototype.set.call(D,F,L);else{if(!d.isBuffer(F))throw new TypeError('"list" argument must be an Array of Buffers');F.copy(D,L)}L+=F.length}return D},d.byteLength=f,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const S=this.length;if(S%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let x=0;xx&&(S+=" ... "),""},y&&(d.prototype[y]=d.prototype.inspect),d.prototype.compare=function(S,x,j,D,L){if(ce(S,Uint8Array)&&(S=d.from(S,S.offset,S.byteLength)),!d.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(x===void 0&&(x=0),j===void 0&&(j=S?S.length:0),D===void 0&&(D=0),L===void 0&&(L=this.length),x<0||j>S.length||D<0||L>this.length)throw new RangeError("out of range index");if(D>=L&&x>=j)return 0;if(D>=L)return-1;if(x>=j)return 1;if(this===S)return 0;let F=(L>>>=0)-(D>>>=0),re=(j>>>=0)-(x>>>=0);const oe=Math.min(F,re),G=this.slice(D,L),Z=S.slice(x,j);for(let H=0;H>>=0,isFinite(j)?(j>>>=0,D===void 0&&(D="utf8")):(D=j,j=void 0)}const L=this.length-x;if((j===void 0||j>L)&&(j=L),S.length>0&&(j<0||x<0)||x>this.length)throw new RangeError("Attempt to write outside buffer bounds");D||(D="utf8");let F=!1;for(;;)switch(D){case"hex":return C(this,S,x,j);case"utf8":case"utf-8":return l(this,S,x,j);case"ascii":case"latin1":case"binary":return I(this,S,x,j);case"base64":return R(this,S,x,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,S,x,j);default:if(F)throw new TypeError("Unknown encoding: "+D);D=(""+D).toLowerCase(),F=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const w=4096;function _(S,x,j){let D="";j=Math.min(S.length,j);for(let L=x;LD)&&(j=D);let L="";for(let F=x;Fj)throw new RangeError("Trying to access beyond buffer length")}function z(S,x,j,D,L,F){if(!d.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>L||xS.length)throw new RangeError("Index out of range")}function te(S,x,j,D,L){Y(x,D,L,S,j,7);let F=Number(x&BigInt(4294967295));S[j++]=F,F>>=8,S[j++]=F,F>>=8,S[j++]=F,F>>=8,S[j++]=F;let re=Number(x>>BigInt(32)&BigInt(4294967295));return S[j++]=re,re>>=8,S[j++]=re,re>>=8,S[j++]=re,re>>=8,S[j++]=re,j}function X(S,x,j,D,L){Y(x,D,L,S,j,7);let F=Number(x&BigInt(4294967295));S[j+7]=F,F>>=8,S[j+6]=F,F>>=8,S[j+5]=F,F>>=8,S[j+4]=F;let re=Number(x>>BigInt(32)&BigInt(4294967295));return S[j+3]=re,re>>=8,S[j+2]=re,re>>=8,S[j+1]=re,re>>=8,S[j]=re,j+8}function ne(S,x,j,D,L,F){if(j+D>S.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function B(S,x,j,D,L){return x=+x,j>>>=0,L||ne(S,0,j,4),P.write(S,x,j,D,23,4),j+4}function Q(S,x,j,D,L){return x=+x,j>>>=0,L||ne(S,0,j,8),P.write(S,x,j,D,52,8),j+8}d.prototype.slice=function(S,x){const j=this.length;(S=~~S)<0?(S+=j)<0&&(S=0):S>j&&(S=j),(x=x===void 0?j:~~x)<0?(x+=j)<0&&(x=0):x>j&&(x=j),x>>=0,x>>>=0,j||T(S,x,this.length);let D=this[S],L=1,F=0;for(;++F>>=0,x>>>=0,j||T(S,x,this.length);let D=this[S+--x],L=1;for(;x>0&&(L*=256);)D+=this[S+--x]*L;return D},d.prototype.readUint8=d.prototype.readUInt8=function(S,x){return S>>>=0,x||T(S,1,this.length),this[S]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(S,x){return S>>>=0,x||T(S,2,this.length),this[S]|this[S+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(S,x){return S>>>=0,x||T(S,2,this.length),this[S]<<8|this[S+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(S,x){return S>>>=0,x||T(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+16777216*this[S+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(S,x){return S>>>=0,x||T(S,4,this.length),16777216*this[S]+(this[S+1]<<16|this[S+2]<<8|this[S+3])},d.prototype.readBigUInt64LE=W(function(S){q(S>>>=0,"offset");const x=this[S],j=this[S+7];x!==void 0&&j!==void 0||ae(S,this.length-8);const D=x+256*this[++S]+65536*this[++S]+this[++S]*2**24,L=this[++S]+256*this[++S]+65536*this[++S]+j*2**24;return BigInt(D)+(BigInt(L)<>>=0,"offset");const x=this[S],j=this[S+7];x!==void 0&&j!==void 0||ae(S,this.length-8);const D=x*2**24+65536*this[++S]+256*this[++S]+this[++S],L=this[++S]*2**24+65536*this[++S]+256*this[++S]+j;return(BigInt(D)<>>=0,x>>>=0,j||T(S,x,this.length);let D=this[S],L=1,F=0;for(;++F=L&&(D-=Math.pow(2,8*x)),D},d.prototype.readIntBE=function(S,x,j){S>>>=0,x>>>=0,j||T(S,x,this.length);let D=x,L=1,F=this[S+--D];for(;D>0&&(L*=256);)F+=this[S+--D]*L;return L*=128,F>=L&&(F-=Math.pow(2,8*x)),F},d.prototype.readInt8=function(S,x){return S>>>=0,x||T(S,1,this.length),128&this[S]?-1*(255-this[S]+1):this[S]},d.prototype.readInt16LE=function(S,x){S>>>=0,x||T(S,2,this.length);const j=this[S]|this[S+1]<<8;return 32768&j?4294901760|j:j},d.prototype.readInt16BE=function(S,x){S>>>=0,x||T(S,2,this.length);const j=this[S+1]|this[S]<<8;return 32768&j?4294901760|j:j},d.prototype.readInt32LE=function(S,x){return S>>>=0,x||T(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},d.prototype.readInt32BE=function(S,x){return S>>>=0,x||T(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},d.prototype.readBigInt64LE=W(function(S){q(S>>>=0,"offset");const x=this[S],j=this[S+7];x!==void 0&&j!==void 0||ae(S,this.length-8);const D=this[S+4]+256*this[S+5]+65536*this[S+6]+(j<<24);return(BigInt(D)<>>=0,"offset");const x=this[S],j=this[S+7];x!==void 0&&j!==void 0||ae(S,this.length-8);const D=(x<<24)+65536*this[++S]+256*this[++S]+this[++S];return(BigInt(D)<>>=0,x||T(S,4,this.length),P.read(this,S,!0,23,4)},d.prototype.readFloatBE=function(S,x){return S>>>=0,x||T(S,4,this.length),P.read(this,S,!1,23,4)},d.prototype.readDoubleLE=function(S,x){return S>>>=0,x||T(S,8,this.length),P.read(this,S,!0,52,8)},d.prototype.readDoubleBE=function(S,x){return S>>>=0,x||T(S,8,this.length),P.read(this,S,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(S,x,j,D){S=+S,x>>>=0,j>>>=0,D||z(this,S,x,j,Math.pow(2,8*j)-1,0);let L=1,F=0;for(this[x]=255&S;++F>>=0,j>>>=0,D||z(this,S,x,j,Math.pow(2,8*j)-1,0);let L=j-1,F=1;for(this[x+L]=255&S;--L>=0&&(F*=256);)this[x+L]=S/F&255;return x+j},d.prototype.writeUint8=d.prototype.writeUInt8=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,1,255,0),this[x]=255&S,x+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,2,65535,0),this[x]=255&S,this[x+1]=S>>>8,x+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,2,65535,0),this[x]=S>>>8,this[x+1]=255&S,x+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,4,4294967295,0),this[x+3]=S>>>24,this[x+2]=S>>>16,this[x+1]=S>>>8,this[x]=255&S,x+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,4,4294967295,0),this[x]=S>>>24,this[x+1]=S>>>16,this[x+2]=S>>>8,this[x+3]=255&S,x+4},d.prototype.writeBigUInt64LE=W(function(S,x=0){return te(this,S,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=W(function(S,x=0){return X(this,S,x,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(S,x,j,D){if(S=+S,x>>>=0,!D){const oe=Math.pow(2,8*j-1);z(this,S,x,j,oe-1,-oe)}let L=0,F=1,re=0;for(this[x]=255&S;++L>0)-re&255;return x+j},d.prototype.writeIntBE=function(S,x,j,D){if(S=+S,x>>>=0,!D){const oe=Math.pow(2,8*j-1);z(this,S,x,j,oe-1,-oe)}let L=j-1,F=1,re=0;for(this[x+L]=255&S;--L>=0&&(F*=256);)S<0&&re===0&&this[x+L+1]!==0&&(re=1),this[x+L]=(S/F>>0)-re&255;return x+j},d.prototype.writeInt8=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,1,127,-128),S<0&&(S=255+S+1),this[x]=255&S,x+1},d.prototype.writeInt16LE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,2,32767,-32768),this[x]=255&S,this[x+1]=S>>>8,x+2},d.prototype.writeInt16BE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,2,32767,-32768),this[x]=S>>>8,this[x+1]=255&S,x+2},d.prototype.writeInt32LE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,4,2147483647,-2147483648),this[x]=255&S,this[x+1]=S>>>8,this[x+2]=S>>>16,this[x+3]=S>>>24,x+4},d.prototype.writeInt32BE=function(S,x,j){return S=+S,x>>>=0,j||z(this,S,x,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[x]=S>>>24,this[x+1]=S>>>16,this[x+2]=S>>>8,this[x+3]=255&S,x+4},d.prototype.writeBigInt64LE=W(function(S,x=0){return te(this,S,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=W(function(S,x=0){return X(this,S,x,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(S,x,j){return B(this,S,x,!0,j)},d.prototype.writeFloatBE=function(S,x,j){return B(this,S,x,!1,j)},d.prototype.writeDoubleLE=function(S,x,j){return Q(this,S,x,!0,j)},d.prototype.writeDoubleBE=function(S,x,j){return Q(this,S,x,!1,j)},d.prototype.copy=function(S,x,j,D){if(!d.isBuffer(S))throw new TypeError("argument should be a Buffer");if(j||(j=0),D||D===0||(D=this.length),x>=S.length&&(x=S.length),x||(x=0),D>0&&D=this.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("sourceEnd out of bounds");D>this.length&&(D=this.length),S.length-x>>=0,j=j===void 0?this.length:j>>>0,S||(S=0),typeof S=="number")for(L=x;L=D+4;j-=3)x=`_${S.slice(j-3,j)}${x}`;return`${S.slice(0,j)}${x}`}function Y(S,x,j,D,L,F){if(S>j||S3?x===0||x===BigInt(0)?`>= 0${re} and < 2${re} ** ${8*(F+1)}${re}`:`>= -(2${re} ** ${8*(F+1)-1}${re}) and < 2 ** ${8*(F+1)-1}${re}`:`>= ${x}${re} and <= ${j}${re}`,new V.ERR_OUT_OF_RANGE("value",oe,S)}(function(re,oe,G){q(oe,"offset"),re[oe]!==void 0&&re[oe+G]!==void 0||ae(oe,re.length-(G+1))})(D,L,F)}function q(S,x){if(typeof S!="number")throw new V.ERR_INVALID_ARG_TYPE(x,"number",S)}function ae(S,x,j){throw Math.floor(S)!==S?(q(S,j),new V.ERR_OUT_OF_RANGE(j||"offset","an integer",S)):x<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE(j||"offset",`>= ${j?1:0} and <= ${x}`,S)}ee("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ee("ERR_INVALID_ARG_TYPE",function(S,x){return`The "${S}" argument must be of type number. Received type ${typeof x}`},TypeError),ee("ERR_OUT_OF_RANGE",function(S,x,j){let D=`The value of "${S}" is out of range.`,L=j;return Number.isInteger(j)&&Math.abs(j)>4294967296?L=K(String(j)):typeof j=="bigint"&&(L=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(L=K(L)),L+="n"),D+=` It must be ${x}. Received ${L}`,D},RangeError);const de=/[^+/0-9A-Za-z-_]/g;function ue(S,x){let j;x=x||1/0;const D=S.length;let L=null;const F=[];for(let re=0;re55295&&j<57344){if(!L){if(j>56319){(x-=3)>-1&&F.push(239,191,189);continue}if(re+1===D){(x-=3)>-1&&F.push(239,191,189);continue}L=j;continue}if(j<56320){(x-=3)>-1&&F.push(239,191,189),L=j;continue}j=65536+(L-55296<<10|j-56320)}else L&&(x-=3)>-1&&F.push(239,191,189);if(L=null,j<128){if((x-=1)<0)break;F.push(j)}else if(j<2048){if((x-=2)<0)break;F.push(j>>6|192,63&j|128)}else if(j<65536){if((x-=3)<0)break;F.push(j>>12|224,j>>6&63|128,63&j|128)}else{if(!(j<1114112))throw new Error("Invalid code point");if((x-=4)<0)break;F.push(j>>18|240,j>>12&63|128,j>>6&63|128,63&j|128)}}return F}function le(S){return M.toByteArray(function(x){if((x=(x=x.split("=")[0]).trim().replace(de,"")).length<2)return"";for(;x.length%4!=0;)x+="=";return x}(S))}function ge(S,x,j,D){let L;for(L=0;L=x.length||L>=S.length);++L)x[L+j]=S[L];return L}function ce(S,x){return S instanceof x||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===x.name}function he(S){return S!=S}const be=function(){const S="0123456789abcdef",x=new Array(256);for(let j=0;j<16;++j){const D=16*j;for(let L=0;L<16;++L)x[D+L]=S[j]+S[L]}return x}();function W(S){return typeof BigInt>"u"?g:S}function g(){throw new Error("BigInt not supported")}},1924:(J,e,b)=>{var E=b(210),M=b(5559),P=M(E("String.prototype.indexOf"));J.exports=function(y,a){var t=E(y,!!a);return typeof t=="function"&&P(y,".prototype.")>-1?M(t):t}},5559:(J,e,b)=>{var E=b(8612),M=b(210),P=M("%Function.prototype.apply%"),y=M("%Function.prototype.call%"),a=M("%Reflect.apply%",!0)||E.call(y,P),t=M("%Object.getOwnPropertyDescriptor%",!0),d=M("%Object.defineProperty%",!0),u=M("%Math.max%");if(d)try{d({},"a",{value:1})}catch{d=null}J.exports=function(r){var n=a(E,y,arguments);return t&&d&&t(n,"length").configurable&&d(n,"length",{value:1+u(0,r.length-(arguments.length-1))}),n};var s=function(){return a(E,P,arguments)};d?d(J.exports,"apply",{value:s}):J.exports.apply=s},1027:(J,e,b)=>{var E=b(9509).Buffer,M=b(2830).Transform,P=b(2553).s;function y(a){M.call(this),this.hashMode=typeof a=="string",this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}b(5717)(y,M),y.prototype.update=function(a,t,d){typeof a=="string"&&(a=E.from(a,t));var u=this._update(a);return this.hashMode?this:(d&&(u=this._toString(u,d)),u)},y.prototype.setAutoPadding=function(){},y.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},y.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},y.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},y.prototype._transform=function(a,t,d){var u;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(s){u=s}finally{d(u)}},y.prototype._flush=function(a){var t;try{this.push(this.__final())}catch(d){t=d}a(t)},y.prototype._finalOrDigest=function(a){var t=this.__final()||E.alloc(0);return a&&(t=this._toString(t,a,!0)),t},y.prototype._toString=function(a,t,d){if(this._decoder||(this._decoder=new P(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var u=this._decoder.write(a);return d&&(u+=this._decoder.end()),u},J.exports=y},5108:(J,e,b)=>{var E=b(9539),M=b(9282);function P(){return new Date().getTime()}var y,a=Array.prototype.slice,t={};y=b.g!==void 0&&b.g.console?b.g.console:typeof window<"u"&&window.console?window.console:{};for(var d=[[function(){},"log"],[function(){y.log.apply(y,arguments)},"info"],[function(){y.log.apply(y,arguments)},"warn"],[function(){y.warn.apply(y,arguments)},"error"],[function(o){t[o]=P()},"time"],[function(o){var i=t[o];if(!i)throw new Error("No such label: "+o);delete t[o];var f=P()-i;y.log(o+": "+f+"ms")},"timeEnd"],[function(){var o=new Error;o.name="Trace",o.message=E.format.apply(null,arguments),y.error(o.stack)},"trace"],[function(o){y.log(E.inspect(o)+`
-`)},"dir"],[function(o){if(!o){var i=a.call(arguments,1);M.ok(!1,E.format.apply(null,i))}},"assert"]],u=0;u{var E=b(5717),M=b(2318),P=b(9785),y=b(9072),a=b(1027);function t(d){a.call(this,"digest"),this._hash=d}E(t,a),t.prototype._update=function(d){this._hash.update(d)},t.prototype._final=function(){return this._hash.digest()},J.exports=function(d){return(d=d.toLowerCase())==="md5"?new M:d==="rmd160"||d==="ripemd160"?new P:new t(y(d))}},8028:(J,e,b)=>{var E=b(2318);J.exports=function(M){return new E().update(M).digest()}},8355:(J,e,b)=>{var E=b(5717),M=b(1031),P=b(1027),y=b(9509).Buffer,a=b(8028),t=b(9785),d=b(9072),u=y.alloc(128);function s(r,n){P.call(this,"digest"),typeof n=="string"&&(n=y.from(n));var o=r==="sha512"||r==="sha384"?128:64;this._alg=r,this._key=n,n.length>o?n=(r==="rmd160"?new t:d(r)).update(n).digest():n.length{var E=b(5717),M=b(9509).Buffer,P=b(1027),y=M.alloc(128),a=64;function t(d,u){P.call(this,"digest"),typeof u=="string"&&(u=M.from(u)),this._alg=d,this._key=u,u.length>a?u=d(u):u.length-1};function u(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(k))throw new TypeError("Invalid character in header field name");return k.toLowerCase()}function s(k){return typeof k!="string"&&(k=String(k)),k}function r(k){var N={next:function(){var A=k.shift();return{done:A===void 0,value:A}}};return a.iterable&&(N[Symbol.iterator]=function(){return N}),N}function n(k){this.map={},k instanceof n?k.forEach(function(N,A){this.append(A,N)},this):Array.isArray(k)?k.forEach(function(N){this.append(N[0],N[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(N){this.append(N,k[N])},this)}function o(k){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}function i(k){return new Promise(function(N,A){k.onload=function(){N(k.result)},k.onerror=function(){A(k.error)}})}function f(k){var N=new FileReader,A=i(N);return N.readAsArrayBuffer(k),A}function c(k){if(k.slice)return k.slice(0);var N=new Uint8Array(k.byteLength);return N.set(new Uint8Array(k)),N.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(k){var N;this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:a.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:a.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():a.arrayBuffer&&a.blob&&(N=k)&&DataView.prototype.isPrototypeOf(N)?(this._bodyArrayBuffer=c(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||d(k))?this._bodyArrayBuffer=c(k):this._bodyText=k=Object.prototype.toString.call(k):this._bodyText="",this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var k=o(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?o(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var k,N,A,w=o(this);if(w)return w;if(this._bodyBlob)return k=this._bodyBlob,A=i(N=new FileReader),N.readAsText(k),A;if(this._bodyArrayBuffer)return Promise.resolve(function(_){for(var p=new Uint8Array(_),O=new Array(p.length),U=0;U-1?w:A),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(_)}function C(k){var N=new FormData;return k.trim().split("&").forEach(function(A){if(A){var w=A.split("="),_=w.shift().replace(/\+/g," "),p=w.join("=").replace(/\+/g," ");N.append(decodeURIComponent(_),decodeURIComponent(p))}}),N}function l(k,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new n(N.headers),this.url=N.url||"",this._initBody(k)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},h.call(v.prototype),h.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(this.headers),url:this.url})},l.error=function(){var k=new l(null,{status:0,statusText:""});return k.type="error",k};var I=[301,302,303,307,308];l.redirect=function(k,N){if(I.indexOf(N)===-1)throw new RangeError("Invalid status code");return new l(null,{status:N,headers:{location:k}})},y.DOMException=P.DOMException;try{new y.DOMException}catch{y.DOMException=function(N,A){this.message=N,this.name=A;var w=Error(N);this.stack=w.stack},y.DOMException.prototype=Object.create(Error.prototype),y.DOMException.prototype.constructor=y.DOMException}function R(k,N){return new Promise(function(A,w){var _=new v(k,N);if(_.signal&&_.signal.aborted)return w(new y.DOMException("Aborted","AbortError"));var p=new XMLHttpRequest;function O(){p.abort()}p.onload=function(){var U,T,z={status:p.status,statusText:p.statusText,headers:(U=p.getAllResponseHeaders()||"",T=new n,U.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(X){var ne=X.split(":"),B=ne.shift().trim();if(B){var Q=ne.join(":").trim();T.append(B,Q)}}),T)};z.url="responseURL"in p?p.responseURL:z.headers.get("X-Request-URL");var te="response"in p?p.response:p.responseText;A(new l(te,z))},p.onerror=function(){w(new TypeError("Network request failed"))},p.ontimeout=function(){w(new TypeError("Network request failed"))},p.onabort=function(){w(new y.DOMException("Aborted","AbortError"))},p.open(_.method,_.url,!0),_.credentials==="include"?p.withCredentials=!0:_.credentials==="omit"&&(p.withCredentials=!1),"responseType"in p&&a.blob&&(p.responseType="blob"),_.headers.forEach(function(U,T){p.setRequestHeader(T,U)}),_.signal&&(_.signal.addEventListener("abort",O),p.onreadystatechange=function(){p.readyState===4&&_.signal.removeEventListener("abort",O)}),p.send(_._bodyInit===void 0?null:_._bodyInit)})}R.polyfill=!0,P.fetch||(P.fetch=R,P.Headers=n,P.Request=v,P.Response=l),y.Headers=n,y.Request=v,y.Response=l,y.fetch=R,Object.defineProperty(y,"__esModule",{value:!0})})({})})(E),E.fetch.ponyfill=!0,delete E.fetch.polyfill;var M=E;(e=M.fetch).default=M.fetch,e.fetch=M.fetch,e.Headers=M.Headers,e.Request=M.Request,e.Response=M.Response,J.exports=e},4063:(J,e)=>{Object.defineProperty(e,"__esModule",{value:!0});let b=new Uint8Array(32);function E(ee){var K,Y=new Float64Array(16);if(ee)for(K=0;K>24&255,ee[K+1]=Y>>16&255,ee[K+2]=Y>>8&255,ee[K+3]=255&Y,ee[K+4]=q>>24&255,ee[K+5]=q>>16&255,ee[K+6]=q>>8&255,ee[K+7]=255&q}function n(ee,K,Y,q){return function(ae,de,ue,le,ge){var ce,he=0;for(ce=0;ce<32;ce++)he|=ae[de+ce]^ue[le+ce];return(1&he-1>>>8)-1}(ee,K,Y,q)}function o(ee,K){var Y;for(Y=0;Y<16;Y++)ee[Y]=0|K[Y]}function i(ee){var K,Y,q=1;for(K=0;K<16;K++)Y=ee[K]+q+65535,q=Math.floor(Y/65536),ee[K]=Y-65536*q;ee[0]+=q-1+37*(q-1)}function f(ee,K,Y){for(var q,ae=~(Y-1),de=0;de<16;de++)q=ae&(ee[de]^K[de]),ee[de]^=q,K[de]^=q}function c(ee,K){var Y,q,ae,de=E(),ue=E();for(Y=0;Y<16;Y++)ue[Y]=K[Y];for(i(ue),i(ue),i(ue),q=0;q<2;q++){for(de[0]=ue[0]-65517,Y=1;Y<15;Y++)de[Y]=ue[Y]-65535-(de[Y-1]>>16&1),de[Y-1]&=65535;de[15]=ue[15]-32767-(de[14]>>16&1),ae=de[15]>>16&1,de[14]&=65535,f(ue,de,1-ae)}for(Y=0;Y<16;Y++)ee[2*Y]=255&ue[Y],ee[2*Y+1]=ue[Y]>>8}function h(ee,K){var Y=new Uint8Array(32),q=new Uint8Array(32);return c(Y,ee),c(q,K),n(Y,0,q,0)}function m(ee){var K=new Uint8Array(32);return c(K,ee),1&K[0]}function v(ee,K){var Y;for(Y=0;Y<16;Y++)ee[Y]=K[2*Y]+(K[2*Y+1]<<8);ee[15]&=32767}function C(ee,K,Y){for(var q=0;q<16;q++)ee[q]=K[q]+Y[q]}function l(ee,K,Y){for(var q=0;q<16;q++)ee[q]=K[q]-Y[q]}function I(ee,K,Y){var q,ae,de=0,ue=0,le=0,ge=0,ce=0,he=0,be=0,W=0,g=0,S=0,x=0,j=0,D=0,L=0,F=0,re=0,oe=0,G=0,Z=0,H=0,$=0,ie=0,se=0,fe=0,pe=0,ve=0,me=0,_e=0,ye=0,Ee=0,Ae=0,Pe=Y[0],ke=Y[1],xe=Y[2],we=Y[3],Se=Y[4],Re=Y[5],Oe=Y[6],Me=Y[7],Te=Y[8],Ne=Y[9],Ce=Y[10],Be=Y[11],Ie=Y[12],je=Y[13],De=Y[14],Ue=Y[15];de+=(q=K[0])*Pe,ue+=q*ke,le+=q*xe,ge+=q*we,ce+=q*Se,he+=q*Re,be+=q*Oe,W+=q*Me,g+=q*Te,S+=q*Ne,x+=q*Ce,j+=q*Be,D+=q*Ie,L+=q*je,F+=q*De,re+=q*Ue,ue+=(q=K[1])*Pe,le+=q*ke,ge+=q*xe,ce+=q*we,he+=q*Se,be+=q*Re,W+=q*Oe,g+=q*Me,S+=q*Te,x+=q*Ne,j+=q*Ce,D+=q*Be,L+=q*Ie,F+=q*je,re+=q*De,oe+=q*Ue,le+=(q=K[2])*Pe,ge+=q*ke,ce+=q*xe,he+=q*we,be+=q*Se,W+=q*Re,g+=q*Oe,S+=q*Me,x+=q*Te,j+=q*Ne,D+=q*Ce,L+=q*Be,F+=q*Ie,re+=q*je,oe+=q*De,G+=q*Ue,ge+=(q=K[3])*Pe,ce+=q*ke,he+=q*xe,be+=q*we,W+=q*Se,g+=q*Re,S+=q*Oe,x+=q*Me,j+=q*Te,D+=q*Ne,L+=q*Ce,F+=q*Be,re+=q*Ie,oe+=q*je,G+=q*De,Z+=q*Ue,ce+=(q=K[4])*Pe,he+=q*ke,be+=q*xe,W+=q*we,g+=q*Se,S+=q*Re,x+=q*Oe,j+=q*Me,D+=q*Te,L+=q*Ne,F+=q*Ce,re+=q*Be,oe+=q*Ie,G+=q*je,Z+=q*De,H+=q*Ue,he+=(q=K[5])*Pe,be+=q*ke,W+=q*xe,g+=q*we,S+=q*Se,x+=q*Re,j+=q*Oe,D+=q*Me,L+=q*Te,F+=q*Ne,re+=q*Ce,oe+=q*Be,G+=q*Ie,Z+=q*je,H+=q*De,$+=q*Ue,be+=(q=K[6])*Pe,W+=q*ke,g+=q*xe,S+=q*we,x+=q*Se,j+=q*Re,D+=q*Oe,L+=q*Me,F+=q*Te,re+=q*Ne,oe+=q*Ce,G+=q*Be,Z+=q*Ie,H+=q*je,$+=q*De,ie+=q*Ue,W+=(q=K[7])*Pe,g+=q*ke,S+=q*xe,x+=q*we,j+=q*Se,D+=q*Re,L+=q*Oe,F+=q*Me,re+=q*Te,oe+=q*Ne,G+=q*Ce,Z+=q*Be,H+=q*Ie,$+=q*je,ie+=q*De,se+=q*Ue,g+=(q=K[8])*Pe,S+=q*ke,x+=q*xe,j+=q*we,D+=q*Se,L+=q*Re,F+=q*Oe,re+=q*Me,oe+=q*Te,G+=q*Ne,Z+=q*Ce,H+=q*Be,$+=q*Ie,ie+=q*je,se+=q*De,fe+=q*Ue,S+=(q=K[9])*Pe,x+=q*ke,j+=q*xe,D+=q*we,L+=q*Se,F+=q*Re,re+=q*Oe,oe+=q*Me,G+=q*Te,Z+=q*Ne,H+=q*Ce,$+=q*Be,ie+=q*Ie,se+=q*je,fe+=q*De,pe+=q*Ue,x+=(q=K[10])*Pe,j+=q*ke,D+=q*xe,L+=q*we,F+=q*Se,re+=q*Re,oe+=q*Oe,G+=q*Me,Z+=q*Te,H+=q*Ne,$+=q*Ce,ie+=q*Be,se+=q*Ie,fe+=q*je,pe+=q*De,ve+=q*Ue,j+=(q=K[11])*Pe,D+=q*ke,L+=q*xe,F+=q*we,re+=q*Se,oe+=q*Re,G+=q*Oe,Z+=q*Me,H+=q*Te,$+=q*Ne,ie+=q*Ce,se+=q*Be,fe+=q*Ie,pe+=q*je,ve+=q*De,me+=q*Ue,D+=(q=K[12])*Pe,L+=q*ke,F+=q*xe,re+=q*we,oe+=q*Se,G+=q*Re,Z+=q*Oe,H+=q*Me,$+=q*Te,ie+=q*Ne,se+=q*Ce,fe+=q*Be,pe+=q*Ie,ve+=q*je,me+=q*De,_e+=q*Ue,L+=(q=K[13])*Pe,F+=q*ke,re+=q*xe,oe+=q*we,G+=q*Se,Z+=q*Re,H+=q*Oe,$+=q*Me,ie+=q*Te,se+=q*Ne,fe+=q*Ce,pe+=q*Be,ve+=q*Ie,me+=q*je,_e+=q*De,ye+=q*Ue,F+=(q=K[14])*Pe,re+=q*ke,oe+=q*xe,G+=q*we,Z+=q*Se,H+=q*Re,$+=q*Oe,ie+=q*Me,se+=q*Te,fe+=q*Ne,pe+=q*Ce,ve+=q*Be,me+=q*Ie,_e+=q*je,ye+=q*De,Ee+=q*Ue,re+=(q=K[15])*Pe,ue+=38*(G+=q*xe),le+=38*(Z+=q*we),ge+=38*(H+=q*Se),ce+=38*($+=q*Re),he+=38*(ie+=q*Oe),be+=38*(se+=q*Me),W+=38*(fe+=q*Te),g+=38*(pe+=q*Ne),S+=38*(ve+=q*Ce),x+=38*(me+=q*Be),j+=38*(_e+=q*Ie),D+=38*(ye+=q*je),L+=38*(Ee+=q*De),F+=38*(Ae+=q*Ue),de=(q=(de+=38*(oe+=q*ke))+(ae=1)+65535)-65536*(ae=Math.floor(q/65536)),ue=(q=ue+ae+65535)-65536*(ae=Math.floor(q/65536)),le=(q=le+ae+65535)-65536*(ae=Math.floor(q/65536)),ge=(q=ge+ae+65535)-65536*(ae=Math.floor(q/65536)),ce=(q=ce+ae+65535)-65536*(ae=Math.floor(q/65536)),he=(q=he+ae+65535)-65536*(ae=Math.floor(q/65536)),be=(q=be+ae+65535)-65536*(ae=Math.floor(q/65536)),W=(q=W+ae+65535)-65536*(ae=Math.floor(q/65536)),g=(q=g+ae+65535)-65536*(ae=Math.floor(q/65536)),S=(q=S+ae+65535)-65536*(ae=Math.floor(q/65536)),x=(q=x+ae+65535)-65536*(ae=Math.floor(q/65536)),j=(q=j+ae+65535)-65536*(ae=Math.floor(q/65536)),D=(q=D+ae+65535)-65536*(ae=Math.floor(q/65536)),L=(q=L+ae+65535)-65536*(ae=Math.floor(q/65536)),F=(q=F+ae+65535)-65536*(ae=Math.floor(q/65536)),re=(q=re+ae+65535)-65536*(ae=Math.floor(q/65536)),de=(q=(de+=ae-1+37*(ae-1))+(ae=1)+65535)-65536*(ae=Math.floor(q/65536)),ue=(q=ue+ae+65535)-65536*(ae=Math.floor(q/65536)),le=(q=le+ae+65535)-65536*(ae=Math.floor(q/65536)),ge=(q=ge+ae+65535)-65536*(ae=Math.floor(q/65536)),ce=(q=ce+ae+65535)-65536*(ae=Math.floor(q/65536)),he=(q=he+ae+65535)-65536*(ae=Math.floor(q/65536)),be=(q=be+ae+65535)-65536*(ae=Math.floor(q/65536)),W=(q=W+ae+65535)-65536*(ae=Math.floor(q/65536)),g=(q=g+ae+65535)-65536*(ae=Math.floor(q/65536)),S=(q=S+ae+65535)-65536*(ae=Math.floor(q/65536)),x=(q=x+ae+65535)-65536*(ae=Math.floor(q/65536)),j=(q=j+ae+65535)-65536*(ae=Math.floor(q/65536)),D=(q=D+ae+65535)-65536*(ae=Math.floor(q/65536)),L=(q=L+ae+65535)-65536*(ae=Math.floor(q/65536)),F=(q=F+ae+65535)-65536*(ae=Math.floor(q/65536)),re=(q=re+ae+65535)-65536*(ae=Math.floor(q/65536)),de+=ae-1+37*(ae-1),ee[0]=de,ee[1]=ue,ee[2]=le,ee[3]=ge,ee[4]=ce,ee[5]=he,ee[6]=be,ee[7]=W,ee[8]=g,ee[9]=S,ee[10]=x,ee[11]=j,ee[12]=D,ee[13]=L,ee[14]=F,ee[15]=re}function R(ee,K){I(ee,K,K)}function k(ee,K){var Y,q=E();for(Y=0;Y<16;Y++)q[Y]=K[Y];for(Y=253;Y>=0;Y--)R(q,q),Y!==2&&Y!==4&&I(q,q,K);for(Y=0;Y<16;Y++)ee[Y]=q[Y]}function N(ee,K,Y){var q,ae,de=new Uint8Array(32),ue=new Float64Array(80),le=E(),ge=E(),ce=E(),he=E(),be=E(),W=E();for(ae=0;ae<31;ae++)de[ae]=K[ae];for(de[31]=127&K[31]|64,de[0]&=248,v(ue,Y),ae=0;ae<16;ae++)ge[ae]=ue[ae],he[ae]=le[ae]=ce[ae]=0;for(le[0]=he[0]=1,ae=254;ae>=0;--ae)f(le,ge,q=de[ae>>>3]>>>(7&ae)&1),f(ce,he,q),C(be,le,ce),l(le,le,ce),C(ce,ge,he),l(ge,ge,he),R(he,be),R(W,le),I(le,ce,le),I(ce,ge,be),C(be,le,ce),l(le,le,ce),R(ge,le),l(ce,he,W),I(le,ce,y),C(le,le,he),I(ce,ce,le),I(le,he,W),I(he,ge,ue),R(ge,be),f(le,ge,q),f(ce,he,q);for(ae=0;ae<16;ae++)ue[ae+16]=le[ae],ue[ae+32]=ce[ae],ue[ae+48]=ge[ae],ue[ae+64]=he[ae];var g=ue.subarray(32),S=ue.subarray(16);return k(g,g),I(S,S,g),c(ee,S),0}var A=[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 w(ee,K,Y,q){for(var ae,de,ue,le,ge,ce,he,be,W,g,S,x,j,D,L,F,re,oe,G,Z,H,$,ie,se,fe,pe,ve=new Int32Array(16),me=new Int32Array(16),_e=ee[0],ye=ee[1],Ee=ee[2],Ae=ee[3],Pe=ee[4],ke=ee[5],xe=ee[6],we=ee[7],Se=K[0],Re=K[1],Oe=K[2],Me=K[3],Te=K[4],Ne=K[5],Ce=K[6],Be=K[7],Ie=0;q>=128;){for(G=0;G<16;G++)Z=8*G+Ie,ve[G]=Y[Z+0]<<24|Y[Z+1]<<16|Y[Z+2]<<8|Y[Z+3],me[G]=Y[Z+4]<<24|Y[Z+5]<<16|Y[Z+6]<<8|Y[Z+7];for(G=0;G<80;G++)if(ae=_e,de=ye,ue=Ee,le=Ae,ge=Pe,ce=ke,he=xe,W=Se,g=Re,S=Oe,x=Me,j=Te,D=Ne,L=Ce,ie=65535&($=Be),se=$>>>16,fe=65535&(H=we),pe=H>>>16,ie+=65535&($=(Te>>>14|Pe<<18)^(Te>>>18|Pe<<14)^(Pe>>>9|Te<<23)),se+=$>>>16,fe+=65535&(H=(Pe>>>14|Te<<18)^(Pe>>>18|Te<<14)^(Te>>>9|Pe<<23)),pe+=H>>>16,ie+=65535&($=Te&Ne^~Te&Ce),se+=$>>>16,fe+=65535&(H=Pe&ke^~Pe&xe),pe+=H>>>16,H=A[2*G],ie+=65535&($=A[2*G+1]),se+=$>>>16,fe+=65535&H,pe+=H>>>16,H=ve[G%16],se+=($=me[G%16])>>>16,fe+=65535&H,pe+=H>>>16,fe+=(se+=(ie+=65535&$)>>>16)>>>16,ie=65535&($=oe=65535&ie|se<<16),se=$>>>16,fe=65535&(H=re=65535&fe|(pe+=fe>>>16)<<16),pe=H>>>16,ie+=65535&($=(Se>>>28|_e<<4)^(_e>>>2|Se<<30)^(_e>>>7|Se<<25)),se+=$>>>16,fe+=65535&(H=(_e>>>28|Se<<4)^(Se>>>2|_e<<30)^(Se>>>7|_e<<25)),pe+=H>>>16,se+=($=Se&Re^Se&Oe^Re&Oe)>>>16,fe+=65535&(H=_e&ye^_e&Ee^ye&Ee),pe+=H>>>16,be=65535&(fe+=(se+=(ie+=65535&$)>>>16)>>>16)|(pe+=fe>>>16)<<16,F=65535&ie|se<<16,ie=65535&($=x),se=$>>>16,fe=65535&(H=le),pe=H>>>16,se+=($=oe)>>>16,fe+=65535&(H=re),pe+=H>>>16,ye=ae,Ee=de,Ae=ue,Pe=le=65535&(fe+=(se+=(ie+=65535&$)>>>16)>>>16)|(pe+=fe>>>16)<<16,ke=ge,xe=ce,we=he,_e=be,Re=W,Oe=g,Me=S,Te=x=65535&ie|se<<16,Ne=j,Ce=D,Be=L,Se=F,G%16==15)for(Z=0;Z<16;Z++)H=ve[Z],ie=65535&($=me[Z]),se=$>>>16,fe=65535&H,pe=H>>>16,H=ve[(Z+9)%16],ie+=65535&($=me[(Z+9)%16]),se+=$>>>16,fe+=65535&H,pe+=H>>>16,re=ve[(Z+1)%16],ie+=65535&($=((oe=me[(Z+1)%16])>>>1|re<<31)^(oe>>>8|re<<24)^(oe>>>7|re<<25)),se+=$>>>16,fe+=65535&(H=(re>>>1|oe<<31)^(re>>>8|oe<<24)^re>>>7),pe+=H>>>16,re=ve[(Z+14)%16],se+=($=((oe=me[(Z+14)%16])>>>19|re<<13)^(re>>>29|oe<<3)^(oe>>>6|re<<26))>>>16,fe+=65535&(H=(re>>>19|oe<<13)^(oe>>>29|re<<3)^re>>>6),pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ve[Z]=65535&fe|pe<<16,me[Z]=65535&ie|se<<16;ie=65535&($=Se),se=$>>>16,fe=65535&(H=_e),pe=H>>>16,H=ee[0],se+=($=K[0])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[0]=_e=65535&fe|pe<<16,K[0]=Se=65535&ie|se<<16,ie=65535&($=Re),se=$>>>16,fe=65535&(H=ye),pe=H>>>16,H=ee[1],se+=($=K[1])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[1]=ye=65535&fe|pe<<16,K[1]=Re=65535&ie|se<<16,ie=65535&($=Oe),se=$>>>16,fe=65535&(H=Ee),pe=H>>>16,H=ee[2],se+=($=K[2])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[2]=Ee=65535&fe|pe<<16,K[2]=Oe=65535&ie|se<<16,ie=65535&($=Me),se=$>>>16,fe=65535&(H=Ae),pe=H>>>16,H=ee[3],se+=($=K[3])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[3]=Ae=65535&fe|pe<<16,K[3]=Me=65535&ie|se<<16,ie=65535&($=Te),se=$>>>16,fe=65535&(H=Pe),pe=H>>>16,H=ee[4],se+=($=K[4])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[4]=Pe=65535&fe|pe<<16,K[4]=Te=65535&ie|se<<16,ie=65535&($=Ne),se=$>>>16,fe=65535&(H=ke),pe=H>>>16,H=ee[5],se+=($=K[5])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[5]=ke=65535&fe|pe<<16,K[5]=Ne=65535&ie|se<<16,ie=65535&($=Ce),se=$>>>16,fe=65535&(H=xe),pe=H>>>16,H=ee[6],se+=($=K[6])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[6]=xe=65535&fe|pe<<16,K[6]=Ce=65535&ie|se<<16,ie=65535&($=Be),se=$>>>16,fe=65535&(H=we),pe=H>>>16,H=ee[7],se+=($=K[7])>>>16,fe+=65535&H,pe+=H>>>16,pe+=(fe+=(se+=(ie+=65535&$)>>>16)>>>16)>>>16,ee[7]=we=65535&fe|pe<<16,K[7]=Be=65535&ie|se<<16,Ie+=128,q-=128}return q}function _(ee,K,Y){var q,ae=new Int32Array(8),de=new Int32Array(8),ue=new Uint8Array(256),le=Y;for(ae[0]=1779033703,ae[1]=3144134277,ae[2]=1013904242,ae[3]=2773480762,ae[4]=1359893119,ae[5]=2600822924,ae[6]=528734635,ae[7]=1541459225,de[0]=4089235720,de[1]=2227873595,de[2]=4271175723,de[3]=1595750129,de[4]=2917565137,de[5]=725511199,de[6]=4215389547,de[7]=327033209,w(ae,de,K,Y),Y%=128,q=0;q=0;--ae)O(ee,K,q=Y[ae/8|0]>>(7&ae)&1),p(K,ee),p(ee,ee),O(ee,K,q)}function z(ee,K){var Y=[E(),E(),E(),E()];o(Y[0],d),o(Y[1],u),o(Y[2],P),I(Y[3],d,u),T(ee,Y,K)}var te=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function X(ee,K){var Y,q,ae,de;for(q=63;q>=32;--q){for(Y=0,ae=q-32,de=q-12;ae>8,K[ae]-=256*Y;K[ae]+=Y,K[q]=0}for(Y=0,ae=0;ae<32;ae++)K[ae]+=Y-(K[31]>>4)*te[ae],Y=K[ae]>>8,K[ae]&=255;for(ae=0;ae<32;ae++)K[ae]-=Y*te[ae];for(q=0;q<32;q++)K[q+1]+=K[q]>>8,ee[q]=255&K[q]}function ne(ee){var K,Y=new Float64Array(64);for(K=0;K<64;K++)Y[K]=ee[K];for(K=0;K<64;K++)ee[K]=0;X(ee,Y)}function B(ee,K,Y,q,ae){for(var de=new Uint8Array(64),ue=[E(),E(),E(),E()],le=0;le<32;le++)de[le]=q[le];de[0]&=248,de[31]&=127,de[31]|=64,z(ue,de),U(de.subarray(32),ue);var ge,ce=128&de[63];return ge=ae?function(he,be,W,g,S){var x,j,D=new Uint8Array(64),L=new Uint8Array(64),F=new Float64Array(64),re=[E(),E(),E(),E()];for(he[0]=254,x=1;x<32;x++)he[x]=255;for(x=0;x<32;x++)he[32+x]=g[x];for(x=0;x=0;$--)R(ie,ie),$!==1&&I(ie,ie,H);for($=0;$<16;$++)Z[$]=ie[$]}(j,j),I(j,j,L),I(j,j,F),I(j,j,F),I(S[0],j,F),R(D,S[0]),I(D,D,F),h(D,L)&&I(S[0],S[0],s),R(D,S[0]),I(D,D,F),h(D,L)?-1:(m(S[0])===x[31]>>7&&l(S[0],M,S[0]),I(S[3],S[0],S[1]),0)}(g,ge))return-1;for(ce=0;ce=0},e.generateKeyPair=function(ee){if(V(ee),ee.length!==32)throw new Error("wrong seed length");for(var K=new Uint8Array(32),Y=new Uint8Array(32),q=0;q<32;q++)K[q]=ee[q];return N(Y,K,b),K[0]&=248,K[31]&=127,K[31]|=64,Y[31]&=127,{public:Y,private:K}},e.default={}},4289:(J,e,b)=>{var E=b(2215),M=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",P=Object.prototype.toString,y=Array.prototype.concat,a=Object.defineProperty,t=b(1044)(),d=a&&t,u=function(r,n,o,i){if(n in r){if(i===!0){if(r[n]===o)return}else if(typeof(f=i)!="function"||P.call(f)!=="[object Function]"||!i())return}var f;d?a(r,n,{configurable:!0,enumerable:!1,value:o,writable:!0}):r[n]=o},s=function(r,n){var o=arguments.length>2?arguments[2]:{},i=E(n);M&&(i=y.call(i,Object.getOwnPropertySymbols(n)));for(var f=0;f{var E=e;E.version=b(8597).i8,E.utils=b(953),E.rand=b(9931),E.curve=b(8254),E.curves=b(5427),E.ec=b(7954),E.eddsa=b(5980)},4918:(J,e,b)=>{var E=b(3550),M=b(953),P=M.getNAF,y=M.getJSF,a=M.assert;function t(u,s){this.type=u,this.p=new E(s.p,16),this.red=s.prime?E.red(s.prime):E.mont(this.p),this.zero=new E(0).toRed(this.red),this.one=new E(1).toRed(this.red),this.two=new E(2).toRed(this.red),this.n=s.n&&new E(s.n,16),this.g=s.g&&this.pointFromJSON(s.g,s.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))}function d(u,s){this.curve=u,this.type=s,this.precomputed=null}J.exports=t,t.prototype.point=function(){throw new Error("Not implemented")},t.prototype.validate=function(){throw new Error("Not implemented")},t.prototype._fixedNafMul=function(u,s){a(u.precomputed);var r=u._getDoubles(),n=P(s,1,this._bitLength),o=(1<=i;h--)f=(f<<1)+n[h];c.push(f)}for(var m=this.jpoint(null,null,null),v=this.jpoint(null,null,null),C=o;C>0;C--){for(i=0;i=0;c--){for(var h=0;c>=0&&i[c]===0;c--)h++;if(c>=0&&h++,f=f.dblp(h),c<0)break;var m=i[c];a(m!==0),f=u.type==="affine"?m>0?f.mixedAdd(o[m-1>>1]):f.mixedAdd(o[-m-1>>1].neg()):m>0?f.add(o[m-1>>1]):f.add(o[-m-1>>1].neg())}return u.type==="affine"?f.toP():f},t.prototype._wnafMulAdd=function(u,s,r,n,o){var i,f,c,h=this._wnafT1,m=this._wnafT2,v=this._wnafT3,C=0;for(i=0;i=1;i-=2){var I=i-1,R=i;if(h[I]===1&&h[R]===1){var k=[s[I],null,null,s[R]];s[I].y.cmp(s[R].y)===0?(k[1]=s[I].add(s[R]),k[2]=s[I].toJ().mixedAdd(s[R].neg())):s[I].y.cmp(s[R].y.redNeg())===0?(k[1]=s[I].toJ().mixedAdd(s[R]),k[2]=s[I].add(s[R].neg())):(k[1]=s[I].toJ().mixedAdd(s[R]),k[2]=s[I].toJ().mixedAdd(s[R].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],A=y(r[I],r[R]);for(C=Math.max(A[0].length,C),v[I]=new Array(C),v[R]=new Array(C),f=0;f=0;i--){for(var U=0;i>=0;){var T=!0;for(f=0;f=0&&U++,p=p.dblp(U),i<0)break;for(f=0;f0?c=m[f][z-1>>1]:z<0&&(c=m[f][-z-1>>1].neg()),p=c.type==="affine"?p.mixedAdd(c):p.add(c))}}for(i=0;i=Math.ceil((u.bitLength()+1)/s.step)},d.prototype._getDoubles=function(u,s){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o{var E=b(953),M=b(3550),P=b(5717),y=b(4918),a=E.assert;function t(u){this.twisted=(0|u.a)!=1,this.mOneA=this.twisted&&(0|u.a)==-1,this.extended=this.mOneA,y.call(this,"edwards",u),this.a=new M(u.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new M(u.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new M(u.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|u.c)==1}function d(u,s,r,n,o){y.BasePoint.call(this,u,"projective"),s===null&&r===null&&n===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 M(s,16),this.y=new M(r,16),this.z=n?new M(n,16):this.curve.one,this.t=o&&new M(o,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()))))}P(t,y),J.exports=t,t.prototype._mulA=function(u){return this.mOneA?u.redNeg():this.a.redMul(u)},t.prototype._mulC=function(u){return this.oneC?u:this.c.redMul(u)},t.prototype.jpoint=function(u,s,r,n){return this.point(u,s,r,n)},t.prototype.pointFromX=function(u,s){(u=new M(u,16)).red||(u=u.toRed(this.red));var r=u.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),i=n.redMul(o.redInvm()),f=i.redSqrt();if(f.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var c=f.fromRed().isOdd();return(s&&!c||!s&&c)&&(f=f.redNeg()),this.point(u,f)},t.prototype.pointFromY=function(u,s){(u=new M(u,16)).red||(u=u.toRed(this.red));var r=u.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),i=n.redMul(o.redInvm());if(i.cmp(this.zero)===0){if(s)throw new Error("invalid point");return this.point(this.zero,u)}var f=i.redSqrt();if(f.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==s&&(f=f.redNeg()),this.point(f,u)},t.prototype.validate=function(u){if(u.isInfinity())return!0;u.normalize();var s=u.x.redSqr(),r=u.y.redSqr(),n=s.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(s).redMul(r)));return n.cmp(o)===0},P(d,y.BasePoint),t.prototype.pointFromJSON=function(u){return d.fromJSON(this,u)},t.prototype.point=function(u,s,r,n){return new d(this,u,s,r,n)},d.fromJSON=function(u,s){return new d(u,s[0],s[1],s[2])},d.prototype.inspect=function(){return this.isInfinity()?"":""},d.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},d.prototype._extDbl=function(){var u=this.x.redSqr(),s=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(u),o=this.x.redAdd(this.y).redSqr().redISub(u).redISub(s),i=n.redAdd(s),f=i.redSub(r),c=n.redSub(s),h=o.redMul(f),m=i.redMul(c),v=o.redMul(c),C=f.redMul(i);return this.curve.point(h,m,C,v)},d.prototype._projDbl=function(){var u,s,r,n,o,i,f=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),h=this.y.redSqr();if(this.curve.twisted){var m=(n=this.curve._mulA(c)).redAdd(h);this.zOne?(u=f.redSub(c).redSub(h).redMul(m.redSub(this.curve.two)),s=m.redMul(n.redSub(h)),r=m.redSqr().redSub(m).redSub(m)):(o=this.z.redSqr(),i=m.redSub(o).redISub(o),u=f.redSub(c).redISub(h).redMul(i),s=m.redMul(n.redSub(h)),r=m.redMul(i))}else n=c.redAdd(h),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),u=this.curve._mulC(f.redISub(n)).redMul(i),s=this.curve._mulC(n).redMul(c.redISub(h)),r=n.redMul(i);return this.curve.point(u,s,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(u){var s=this.y.redSub(this.x).redMul(u.y.redSub(u.x)),r=this.y.redAdd(this.x).redMul(u.y.redAdd(u.x)),n=this.t.redMul(this.curve.dd).redMul(u.t),o=this.z.redMul(u.z.redAdd(u.z)),i=r.redSub(s),f=o.redSub(n),c=o.redAdd(n),h=r.redAdd(s),m=i.redMul(f),v=c.redMul(h),C=i.redMul(h),l=f.redMul(c);return this.curve.point(m,v,l,C)},d.prototype._projAdd=function(u){var s,r,n=this.z.redMul(u.z),o=n.redSqr(),i=this.x.redMul(u.x),f=this.y.redMul(u.y),c=this.curve.d.redMul(i).redMul(f),h=o.redSub(c),m=o.redAdd(c),v=this.x.redAdd(this.y).redMul(u.x.redAdd(u.y)).redISub(i).redISub(f),C=n.redMul(h).redMul(v);return this.curve.twisted?(s=n.redMul(m).redMul(f.redSub(this.curve._mulA(i))),r=h.redMul(m)):(s=n.redMul(m).redMul(f.redSub(i)),r=this.curve._mulC(h).redMul(m)),this.curve.point(C,s,r)},d.prototype.add=function(u){return this.isInfinity()?u:u.isInfinity()?this:this.curve.extended?this._extAdd(u):this._projAdd(u)},d.prototype.mul=function(u){return this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve._wnafMul(this,u)},d.prototype.mulAdd=function(u,s,r){return this.curve._wnafMulAdd(1,[this,s],[u,r],2,!1)},d.prototype.jmulAdd=function(u,s,r){return this.curve._wnafMulAdd(1,[this,s],[u,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var u=this.z.redInvm();return this.x=this.x.redMul(u),this.y=this.y.redMul(u),this.t&&(this.t=this.t.redMul(u)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(u){return this===u||this.getX().cmp(u.getX())===0&&this.getY().cmp(u.getY())===0},d.prototype.eqXToP=function(u){var s=u.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(s)===0)return!0;for(var r=u.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(n),this.x.cmp(s)===0)return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},8254:(J,e,b)=>{var E=e;E.base=b(4918),E.short=b(6673),E.mont=b(2881),E.edwards=b(1138)},2881:(J,e,b)=>{var E=b(3550),M=b(5717),P=b(4918),y=b(953);function a(d){P.call(this,"mont",d),this.a=new E(d.a,16).toRed(this.red),this.b=new E(d.b,16).toRed(this.red),this.i4=new E(4).toRed(this.red).redInvm(),this.two=new E(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function t(d,u,s){P.BasePoint.call(this,d,"projective"),u===null&&s===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new E(u,16),this.z=new E(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}M(a,P),J.exports=a,a.prototype.validate=function(d){var u=d.normalize().x,s=u.redSqr(),r=s.redMul(u).redAdd(s.redMul(this.a)).redAdd(u);return r.redSqrt().redSqr().cmp(r)===0},M(t,P.BasePoint),a.prototype.decodePoint=function(d,u){return this.point(y.toArray(d,u),1)},a.prototype.point=function(d,u){return new t(this,d,u)},a.prototype.pointFromJSON=function(d){return t.fromJSON(this,d)},t.prototype.precompute=function(){},t.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},t.fromJSON=function(d,u){return new t(d,u[0],u[1]||d.one)},t.prototype.inspect=function(){return this.isInfinity()?"":""},t.prototype.isInfinity=function(){return this.z.cmpn(0)===0},t.prototype.dbl=function(){var d=this.x.redAdd(this.z).redSqr(),u=this.x.redSub(this.z).redSqr(),s=d.redSub(u),r=d.redMul(u),n=s.redMul(u.redAdd(this.curve.a24.redMul(s)));return this.curve.point(r,n)},t.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},t.prototype.diffAdd=function(d,u){var s=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=d.x.redAdd(d.z),o=d.x.redSub(d.z).redMul(s),i=n.redMul(r),f=u.z.redMul(o.redAdd(i).redSqr()),c=u.x.redMul(o.redISub(i).redSqr());return this.curve.point(f,c)},t.prototype.mul=function(d){for(var u=d.clone(),s=this,r=this.curve.point(null,null),n=[];u.cmpn(0)!==0;u.iushrn(1))n.push(u.andln(1));for(var o=n.length-1;o>=0;o--)n[o]===0?(s=s.diffAdd(r,this),r=r.dbl()):(r=s.diffAdd(r,this),s=s.dbl());return r},t.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},t.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},t.prototype.eq=function(d){return this.getX().cmp(d.getX())===0},t.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},t.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(J,e,b)=>{var E=b(953),M=b(3550),P=b(5717),y=b(4918),a=E.assert;function t(s){y.call(this,"short",s),this.a=new M(s.a,16).toRed(this.red),this.b=new M(s.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(s),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(s,r,n,o){y.BasePoint.call(this,s,"affine"),r===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new M(r,16),this.y=new M(n,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(s,r,n,o){y.BasePoint.call(this,s,"jacobian"),r===null&&n===null&&o===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new M(0)):(this.x=new M(r,16),this.y=new M(n,16),this.z=new M(o,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}P(t,y),J.exports=t,t.prototype._getEndomorphism=function(s){if(this.zeroA&&this.g&&this.n&&this.p.modn(3)===1){var r,n;if(s.beta)r=new M(s.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(s.lambda)n=new M(s.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))===0?n=i[0]:(n=i[1],a(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}return{beta:r,lambda:n,basis:s.basis?s.basis.map(function(f){return{a:new M(f.a,16),b:new M(f.b,16)}}):this._getEndoBasis(n)}}},t.prototype._getEndoRoots=function(s){var r=s===this.p?this.red:M.mont(s),n=new M(2).toRed(r).redInvm(),o=n.redNeg(),i=new M(3).toRed(r).redNeg().redSqrt().redMul(n);return[o.redAdd(i).fromRed(),o.redSub(i).fromRed()]},t.prototype._getEndoBasis=function(s){for(var r,n,o,i,f,c,h,m,v,C=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=s,I=this.n.clone(),R=new M(1),k=new M(0),N=new M(0),A=new M(1),w=0;l.cmpn(0)!==0;){var _=I.div(l);m=I.sub(_.mul(l)),v=N.sub(_.mul(R));var p=A.sub(_.mul(k));if(!o&&m.cmp(C)<0)r=h.neg(),n=R,o=m.neg(),i=v;else if(o&&++w==2)break;h=m,I=l,l=m,N=R,R=v,A=k,k=p}f=m.neg(),c=v;var O=o.sqr().add(i.sqr());return f.sqr().add(c.sqr()).cmp(O)>=0&&(f=r,c=n),o.negative&&(o=o.neg(),i=i.neg()),f.negative&&(f=f.neg(),c=c.neg()),[{a:o,b:i},{a:f,b:c}]},t.prototype._endoSplit=function(s){var r=this.endo.basis,n=r[0],o=r[1],i=o.b.mul(s).divRound(this.n),f=n.b.neg().mul(s).divRound(this.n),c=i.mul(n.a),h=f.mul(o.a),m=i.mul(n.b),v=f.mul(o.b);return{k1:s.sub(c).sub(h),k2:m.add(v).neg()}},t.prototype.pointFromX=function(s,r){(s=new M(s,16)).red||(s=s.toRed(this.red));var n=s.redSqr().redMul(s).redIAdd(s.redMul(this.a)).redIAdd(this.b),o=n.redSqrt();if(o.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var i=o.fromRed().isOdd();return(r&&!i||!r&&i)&&(o=o.redNeg()),this.point(s,o)},t.prototype.validate=function(s){if(s.inf)return!0;var r=s.x,n=s.y,o=this.a.redMul(r),i=r.redSqr().redMul(r).redIAdd(o).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0},t.prototype._endoWnafMulAdd=function(s,r,n){for(var o=this._endoWnafT1,i=this._endoWnafT2,f=0;f":""},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(s){if(this.inf)return s;if(s.inf)return this;if(this.eq(s))return this.dbl();if(this.neg().eq(s))return this.curve.point(null,null);if(this.x.cmp(s.x)===0)return this.curve.point(null,null);var r=this.y.redSub(s.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(s.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(s.x),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)},d.prototype.dbl=function(){if(this.inf)return this;var s=this.y.redAdd(this.y);if(s.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),o=s.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(o),f=i.redSqr().redISub(this.x.redAdd(this.x)),c=i.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,c)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(s){return s=new M(s,16),this.isInfinity()?this:this._hasDoubles(s)?this.curve._fixedNafMul(this,s):this.curve.endo?this.curve._endoWnafMulAdd([this],[s]):this.curve._wnafMul(this,s)},d.prototype.mulAdd=function(s,r,n){var o=[this,r],i=[s,n];return this.curve.endo?this.curve._endoWnafMulAdd(o,i):this.curve._wnafMulAdd(1,o,i,2)},d.prototype.jmulAdd=function(s,r,n){var o=[this,r],i=[s,n];return this.curve.endo?this.curve._endoWnafMulAdd(o,i,!0):this.curve._wnafMulAdd(1,o,i,2,!0)},d.prototype.eq=function(s){return this===s||this.inf===s.inf&&(this.inf||this.x.cmp(s.x)===0&&this.y.cmp(s.y)===0)},d.prototype.neg=function(s){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(s&&this.precomputed){var n=this.precomputed,o=function(i){return i.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(o)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(o)}}}return r},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},P(u,y.BasePoint),t.prototype.jpoint=function(s,r,n){return new u(this,s,r,n)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var s=this.z.redInvm(),r=s.redSqr(),n=this.x.redMul(r),o=this.y.redMul(r).redMul(s);return this.curve.point(n,o)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(s){if(this.isInfinity())return s;if(s.isInfinity())return this;var r=s.z.redSqr(),n=this.z.redSqr(),o=this.x.redMul(r),i=s.x.redMul(n),f=this.y.redMul(r.redMul(s.z)),c=s.y.redMul(n.redMul(this.z)),h=o.redSub(i),m=f.redSub(c);if(h.cmpn(0)===0)return m.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=h.redSqr(),C=v.redMul(h),l=o.redMul(v),I=m.redSqr().redIAdd(C).redISub(l).redISub(l),R=m.redMul(l.redISub(I)).redISub(f.redMul(C)),k=this.z.redMul(s.z).redMul(h);return this.curve.jpoint(I,R,k)},u.prototype.mixedAdd=function(s){if(this.isInfinity())return s.toJ();if(s.isInfinity())return this;var r=this.z.redSqr(),n=this.x,o=s.x.redMul(r),i=this.y,f=s.y.redMul(r).redMul(this.z),c=n.redSub(o),h=i.redSub(f);if(c.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=c.redSqr(),v=m.redMul(c),C=n.redMul(m),l=h.redSqr().redIAdd(v).redISub(C).redISub(C),I=h.redMul(C.redISub(l)).redISub(i.redMul(v)),R=this.z.redMul(c);return this.curve.jpoint(l,I,R)},u.prototype.dblp=function(s){if(s===0)return this;if(this.isInfinity())return this;if(!s)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},5427:(J,e,b)=>{var E,M=e,P=b(3715),y=b(8254),a=b(953).assert;function t(u){u.type==="short"?this.curve=new y.short(u):u.type==="edwards"?this.curve=new y.edwards(u):this.curve=new y.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(u,s){Object.defineProperty(M,u,{configurable:!0,enumerable:!0,get:function(){var r=new t(s);return Object.defineProperty(M,u,{configurable:!0,enumerable:!0,value:r}),r}})}M.PresetCurve=t,d("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:P.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("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:P.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("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:P.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("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:P.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"]}),d("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:P.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"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:P.sha256,gRed:!1,g:["9"]}),d("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:P.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{E=b(1037)}catch{E=void 0}d("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:P.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",E]})},7954:(J,e,b)=>{var E=b(3550),M=b(2156),P=b(953),y=b(5427),a=b(9931),t=P.assert,d=b(1251),u=b(611);function s(r){if(!(this instanceof s))return new s(r);typeof r=="string"&&(t(Object.prototype.hasOwnProperty.call(y,r),"Unknown curve "+r),r=y[r]),r instanceof y.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}J.exports=s,s.prototype.keyPair=function(r){return new d(this,r)},s.prototype.keyFromPrivate=function(r,n){return d.fromPrivate(this,r,n)},s.prototype.keyFromPublic=function(r,n){return d.fromPublic(this,r,n)},s.prototype.genKeyPair=function(r){r||(r={});for(var n=new M({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||a(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),i=this.n.sub(new E(2));;){var f=new E(n.generate(o));if(!(f.cmp(i)>0))return f.iaddn(1),this.keyFromPrivate(f)}},s.prototype._truncateToN=function(r,n){var o=8*r.byteLength()-this.n.bitLength();return o>0&&(r=r.ushrn(o)),!n&&r.cmp(this.n)>=0?r.sub(this.n):r},s.prototype.sign=function(r,n,o,i){typeof o=="object"&&(i=o,o=null),i||(i={}),n=this.keyFromPrivate(n,o),r=this._truncateToN(new E(r,16));for(var f=this.n.byteLength(),c=n.getPrivate().toArray("be",f),h=r.toArray("be",f),m=new M({hash:this.hash,entropy:c,nonce:h,pers:i.pers,persEnc:i.persEnc||"utf8"}),v=this.n.sub(new E(1)),C=0;;C++){var l=i.k?i.k(C):new E(m.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(v)>=0)){var I=this.g.mul(l);if(!I.isInfinity()){var R=I.getX(),k=R.umod(this.n);if(k.cmpn(0)!==0){var N=l.invm(this.n).mul(k.mul(n.getPrivate()).iadd(r));if((N=N.umod(this.n)).cmpn(0)!==0){var A=(I.getY().isOdd()?1:0)|(R.cmp(k)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),A^=1),new u({r:k,s:N,recoveryParam:A})}}}}}},s.prototype.verify=function(r,n,o,i){r=this._truncateToN(new E(r,16)),o=this.keyFromPublic(o,i);var f=(n=new u(n,"hex")).r,c=n.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var h,m=c.invm(this.n),v=m.mul(r).umod(this.n),C=m.mul(f).umod(this.n);return this.curve._maxwellTrick?!(h=this.g.jmulAdd(v,o.getPublic(),C)).isInfinity()&&h.eqXToP(f):!(h=this.g.mulAdd(v,o.getPublic(),C)).isInfinity()&&h.getX().umod(this.n).cmp(f)===0},s.prototype.recoverPubKey=function(r,n,o,i){t((3&o)===o,"The recovery param is more than two bits"),n=new u(n,i);var f=this.n,c=new E(r),h=n.r,m=n.s,v=1&o,C=o>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&C)throw new Error("Unable to find sencond key candinate");h=C?this.curve.pointFromX(h.add(this.curve.n),v):this.curve.pointFromX(h,v);var l=n.r.invm(f),I=f.sub(c).mul(l).umod(f),R=m.mul(l).umod(f);return this.g.mulAdd(I,h,R)},s.prototype.getKeyRecoveryParam=function(r,n,o,i){if((n=new u(n,i)).recoveryParam!==null)return n.recoveryParam;for(var f=0;f<4;f++){var c;try{c=this.recoverPubKey(r,n,f)}catch{continue}if(c.eq(o))return f}throw new Error("Unable to find valid recovery factor")}},1251:(J,e,b)=>{var E=b(3550),M=b(953).assert;function P(y,a){this.ec=y,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}J.exports=P,P.fromPublic=function(y,a,t){return a instanceof P?a:new P(y,{pub:a,pubEnc:t})},P.fromPrivate=function(y,a,t){return a instanceof P?a:new P(y,{priv:a,privEnc:t})},P.prototype.validate=function(){var y=this.getPublic();return y.isInfinity()?{result:!1,reason:"Invalid public key"}:y.validate()?y.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"}},P.prototype.getPublic=function(y,a){return typeof y=="string"&&(a=y,y=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,y):this.pub},P.prototype.getPrivate=function(y){return y==="hex"?this.priv.toString(16,2):this.priv},P.prototype._importPrivate=function(y,a){this.priv=new E(y,a||16),this.priv=this.priv.umod(this.ec.curve.n)},P.prototype._importPublic=function(y,a){if(y.x||y.y)return this.ec.curve.type==="mont"?M(y.x,"Need x coordinate"):this.ec.curve.type!=="short"&&this.ec.curve.type!=="edwards"||M(y.x&&y.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(y.x,y.y));this.pub=this.ec.curve.decodePoint(y,a)},P.prototype.derive=function(y){return y.validate()||M(y.validate(),"public point not validated"),y.mul(this.priv).getX()},P.prototype.sign=function(y,a,t){return this.ec.sign(y,this,a,t)},P.prototype.verify=function(y,a){return this.ec.verify(y,a,this)},P.prototype.inspect=function(){return"