s;)a&u&&(f=f.add(p)),p=p.double(),a>>=u;return f},precomputeWindow:function(e,a){for(var f=i(a),p=f.windows,g=f.windowSize,x=[],y=e,v=y,S=0;S>=O,C>x&&(C-=E,f+=u);var M=L,T=L+Math.abs(C)-1,b=k%2!=0,_=C<0;C===0?v=v.add(n(b,a[M])):y=y.add(n(_,a[T]))}return{p:y,f:v}},wNAFCached:function(e,a,f,p){var g=e._WINDOW_SIZE||1,x=a.get(e);return x||(x=this.precomputeWindow(e,g),g!==1&&a.set(e,p(x))),this.wNAF(g,x,f)}}},c.validateBasic=function(r){return(0,l.validateField)(r.Fp),(0,t.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze(m(m(m({},(0,l.nLength)(r.n,r.nBitLength)),r),{p:r.Fp.ORDER}))}},19751:(U,c,d)=>{var h=d(28847),w=h(d(90775)),m=h(d(74519));function l(g,x){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);x&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(g,S).enumerable})),y.push.apply(y,v)}return y}function t(g){for(var x=1;x=1<<8*x)throw new Error("bad I2OSP call: value=".concat(g," length=").concat(x));for(var y=Array.from({length:x}).fill(0),v=x-1;v>=0;v--)y[v]=255&g,g>>>=8;return new Uint8Array(y)}function n(g,x){for(var y=new Uint8Array(g.length),v=0;v255&&(x=v((0,u.concatBytes)((0,u.utf8ToBytes)("H2C-OVERSIZE-DST-"),x)));var S=v.outputLen,E=v.blockLen,O=Math.ceil(y/S);if(O>255)throw new Error("Invalid xmd length");var k=(0,u.concatBytes)(x,o(x.length,1)),L=o(0,E),C=o(y,2),M=new Array(O),T=v((0,u.concatBytes)(L,g,C,o(0,1),k));M[0]=v((0,u.concatBytes)(T,o(1,1),k));for(var b=1;b<=O;b++){var _=[n(T,M[b-1]),o(b+1,1),k];M[b]=v(u.concatBytes.apply(void 0,_))}return u.concatBytes.apply(void 0,M).slice(0,y)}function f(g,x,y,v,S){if(i(g),i(x),e(y),x.length>255){var E=Math.ceil(2*v/8);x=S.create({dkLen:E}).update((0,u.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(x).digest()}if(y>65535||x.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return S.create({dkLen:y}).update(g).update(o(y,2)).update(x).update(o(x.length,1)).digest()}function p(g,x,y){(0,u.validateObject)(y,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});var v=y.p,S=y.k,E=y.m,O=y.hash,k=y.expand,L=y.DST;i(g),e(x);var C,M=function(X){if(X instanceof Uint8Array)return X;if(typeof X=="string")return(0,u.utf8ToBytes)(X);throw new Error("DST must be Uint8Array or string")}(L),T=v.toString(2).length,b=Math.ceil((T+S)/8),_=x*E*b;if(k==="xmd")C=a(g,M,_,O);else if(k==="xof")C=f(g,M,_,S,O);else{if(k!=="_internal_pass")throw new Error('expand must be "xmd" or "xof"');C=g}for(var D=new Array(x),A=0;A{var h=d(28847)(d(3355));Object.defineProperty(c,"__esModule",{value:!0}),c.hashToPrivateScalar=c.FpSqrtEven=c.FpSqrtOdd=c.Field=c.nLength=c.FpIsSquare=c.FpDiv=c.FpInvertBatch=c.FpPow=c.validateField=c.isNegativeLE=c.FpSqrt=c.tonelliShanks=c.invert=c.pow2=c.pow=c.mod=void 0;var w=d(46928),m=BigInt(0),l=BigInt(1),t=BigInt(2),s=BigInt(3),u=BigInt(4),r=BigInt(5),o=BigInt(8);function n(v,S){var E=v%S;return E>=m?E:S+E}function i(v,S,E){if(E<=m||S 0");if(E===l)return m;for(var O=l;S>m;)S&l&&(O=O*v%E),v=v*v%E,S>>=l;return O}function e(v,S){if(v===m||S<=m)throw new Error("invert: expected positive integers, got n=".concat(v," mod=").concat(S));for(var E=n(v,S),O=S,k=m,L=l,C=l,M=m;E!==m;){var T=O/E,b=O%E,_=k-C*T,D=L-M*T;O=E,E=b,k=C,L=M,C=_,M=D}if(O!==l)throw new Error("invert: does not exist");return n(k,S)}function a(v){var S,E,O,k=(v-l)/t;for(S=v-l,E=0;S%t===m;S/=t,E++);for(O=t;Om;)O*=O,O%=E;return O},c.invert=e,c.tonelliShanks=a,c.FpSqrt=f,c.isNegativeLE=function(v,S){return(n(v,S)&l)===l};var p=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function g(v,S,E){if(E 0");if(E===m)return v.ONE;if(E===l)return S;for(var O=v.ONE,k=S;E>m;)E&l&&(O=v.mul(O,k)),k=v.sqr(k),E>>=l;return O}function x(v,S){var E=new Array(S.length),O=S.reduce(function(L,C,M){return v.is0(C)?L:(E[M]=L,v.mul(L,C))},v.ONE),k=v.inv(O);return S.reduceRight(function(L,C,M){return v.is0(C)?L:(E[M]=v.mul(L,E[M]),v.mul(L,C))},k),E}function y(v,S){var E=S!==void 0?S:v.toString(2).length;return{nBitLength:E,nByteLength:Math.ceil(E/8)}}c.validateField=function(v){var S=p.reduce(function(E,O){return E[O]="function",E},{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,w.validateObject)(v,S)},c.FpPow=g,c.FpInvertBatch=x,c.FpDiv=function(v,S,E){return v.mul(S,typeof E=="bigint"?e(E,v.ORDER):v.inv(E))},c.FpIsSquare=function(v){var S=(v.ORDER-l)/t;return function(E){var O=v.pow(E,S);return v.eql(O,v.ZERO)||v.eql(O,v.ONE)}},c.nLength=y,c.Field=function(v,S){var E=arguments.length>2&&arguments[2]!==void 0&&arguments[2],O=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(v<=m)throw new Error("Expected Fp ORDER > 0, got ".concat(v));var k=y(v,S),L=k.nBitLength,C=k.nByteLength;if(C>2048)throw new Error("Field lengths over 2048 bytes are not supported");var M=f(v),T=Object.freeze({ORDER:v,BITS:L,BYTES:C,MASK:(0,w.bitMask)(L),ZERO:m,ONE:l,create:function(b){return n(b,v)},isValid:function(b){if(typeof b!="bigint")throw new Error("Invalid field element: expected bigint, got ".concat((0,h.default)(b)));return m<=b&&b2&&arguments[2]!==void 0&&arguments[2],O=(v=(0,w.ensureBytes)("privateHash",v)).length,k=y(S).nByteLength+8;if(k<24||O1024)throw new Error("hashToPrivateScalar: expected ".concat(k,"-1024 bytes of input, got ").concat(O));return n(E?(0,w.bytesToNumberLE)(v):(0,w.bytesToNumberBE)(v),S-l)+l}},46928:(U,c,d)=>{var h=d(28847),w=h(d(74519)),m=h(d(3355));Object.defineProperty(c,"__esModule",{value:!0}),c.validateObject=c.createHmacDrbg=c.bitMask=c.bitSet=c.bitGet=c.bitLen=c.utf8ToBytes=c.equalBytes=c.concatBytes=c.ensureBytes=c.numberToVarBytesBE=c.numberToBytesLE=c.numberToBytesBE=c.bytesToNumberLE=c.bytesToNumberBE=c.hexToBytes=c.hexToNumber=c.numberToHexUnpadded=c.bytesToHex=void 0;var l=BigInt(0),t=BigInt(1),s=BigInt(2),u=function(y){return y instanceof Uint8Array},r=Array.from({length:256},function(y,v){return v.toString(16).padStart(2,"0")});function o(y){if(!u(y))throw new Error("Uint8Array expected");for(var v="",S=0;Sl;y>>=t,v+=1);return v},c.bitGet=function(y,v){return y>>BigInt(v)&t},c.bitSet=function(y,v,S){return y|(S?t:l)<0&&arguments[0]!==void 0?arguments[0]:p();O=C(g([0]),b),E=C(),b.length!==0&&(O=C(g([1]),b),E=C())},T=function(){if(k++>=1e3)throw new Error("drbg: tried 1000 values");for(var b=0,_=[];b2&&arguments[2]!==void 0?arguments[2]:{},E=function(b,_,D){var A=x[_];if(typeof A!="function")throw new Error('Invalid validator "'.concat(_,'", expected function'));var P=y[b];if(!(D&&P===void 0||A(P,y)))throw new Error("Invalid param ".concat(String(b),"=").concat(P," (").concat((0,m.default)(P),"), expected ").concat(_))},O=0,k=Object.entries(v);O{var h=d(28847),w=h(d(58985)),m=h(d(69721)),l=h(d(15163)),t=h(d(34650)),s=h(d(21949)),u=h(d(22940)),r=h(d(90775)),o=h(d(3355));function n(C,M){var T=Object.keys(C);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(C);M&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(C,_).enumerable})),T.push.apply(T,b)}return T}function i(C){for(var M=1;M"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var D,A=(0,s.default)(M);if(T){var P=(0,s.default)(this).constructor;D=Reflect.construct(A,arguments,P)}else D=A.apply(this,arguments);return(0,t.default)(this,D)});function _(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return(0,m.default)(this,_),b.call(this,D)}return(0,w.default)(_)}((0,u.default)(Error)),_parseInt:function(C){var M=c.DER.Err;if(C.length<2||C[0]!==2)throw new M("Invalid signature integer tag");var T=C[1],b=C.subarray(2,T+2);if(!T||b.length!==T)throw new M("Invalid signature integer: wrong length");if(128&b[0])throw new M("Invalid signature integer: negative");if(b[0]===0&&!(128&b[1]))throw new M("Invalid signature integer: unnecessary leading zero");return{d:g(b),l:C.subarray(T+2)}},toSig:function(C){var M=c.DER.Err,T=typeof C=="string"?x(C):C;if(!(T instanceof Uint8Array))throw new Error("ui8a expected");var b=T.length;if(b<2||T[0]!=48)throw new M("Invalid signature tag");if(T[1]!==b-2)throw new M("Invalid signature: incorrect length");var _=c.DER._parseInt(T.subarray(2)),D=_.d,A=_.l,P=c.DER._parseInt(A),I=P.d;if(P.l.length)throw new M("Invalid signature: left bytes after parsing");return{r:D,s:I}},hexFromSig:function(C){var M=function(G){return 8&Number.parseInt(G[0],16)?"00"+G:G},T=function(G){var J=G.toString(16);return 1&J.length?"0".concat(J):J},b=M(T(C.s)),_=M(T(C.r)),D=b.length/2,A=_.length/2,P=T(D),I=T(A);return"30".concat(T(A+D+4),"02").concat(I).concat(_,"02").concat(P).concat(b)}};var y=BigInt(0),v=BigInt(1),S=BigInt(2),E=BigInt(3),O=BigInt(4);function k(C){var M=function(V){var z=(0,p.validateBasic)(V);a.validateObject(z,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});var j=z.endo,B=z.Fp,N=z.a;if(j){if(!B.eql(N,B.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if((0,o.default)(j)!=="object"||typeof j.beta!="bigint"||typeof j.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze(i({},z))}(C),T=M.Fp,b=M.toBytes||function(V,z,j){var B=z.toAffine();return a.concatBytes(Uint8Array.from([4]),T.toBytes(B.x),T.toBytes(B.y))},_=M.fromBytes||function(V){var z=V.subarray(1);return{x:T.fromBytes(z.subarray(0,T.BYTES)),y:T.fromBytes(z.subarray(T.BYTES,2*T.BYTES))}};function D(V){var z=M.a,j=M.b,B=T.sqr(V),N=T.mul(B,V);return T.add(T.add(N,T.mul(V,z)),j)}if(!T.eql(T.sqr(M.Gy),D(M.Gx)))throw new Error("bad generator point: equation left != right");function A(V){return typeof V=="bigint"&&yy||Q>y;)K&v&&($=$.add(ee)),Q&v&&(W=W.add(ee)),ee=ee.double(),K>>=v,Q>>=v;return F&&($=$.negate()),q&&(W=W.negate()),W=new V(T.mul(W.px,B.beta),W.py,W.pz),$.add(W)}},{key:"multiply",value:function(z){P(z);var j,B,N=z,F=M.endo;if(F){var K=F.splitScalar(N),q=K.k1neg,Q=K.k1,$=K.k2neg,W=K.k2,ee=this.wNAF(Q),te=ee.p,Z=ee.f,re=this.wNAF(W),ne=re.p,ae=re.f;te=H.constTimeNegate(q,te),ne=H.constTimeNegate($,ne),ne=new V(T.mul(ne.px,F.beta),ne.py,ne.pz),j=te.add(ne),B=Z.add(ae)}else{var fe=this.wNAF(N);j=fe.p,B=fe.f}return V.normalizeZ([j,B])[0]}},{key:"multiplyAndAddUnsafe",value:function(z,j,B){var N=V.BASE,F=function(q,Q){return Q!==y&&Q!==v&&q.equals(N)?q.multiply(Q):q.multiplyUnsafe(Q)},K=F(this,j).add(F(z,B));return K.is0()?void 0:K}},{key:"toAffine",value:function(z){var j=this.px,B=this.py,N=this.pz,F=this.is0();z==null&&(z=F?T.ONE:T.inv(N));var K=T.mul(j,z),q=T.mul(B,z),Q=T.mul(N,z);if(F)return{x:T.ZERO,y:T.ZERO};if(!T.eql(Q,T.ONE))throw new Error("invZ was invalid");return{x:K,y:q}}},{key:"isTorsionFree",value:function(){var z=M.h,j=M.isTorsionFree;if(z===v)return!0;if(j)return j(V,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}},{key:"clearCofactor",value:function(){var z=M.h,j=M.clearCofactor;return z===v?this:j?j(V,this):this.multiplyUnsafe(M.h)}},{key:"toRawBytes",value:function(){var z=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this.assertValidity(),b(V,this,z)}},{key:"toHex",value:function(){var z=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return a.bytesToHex(this.toRawBytes(z))}}],[{key:"fromAffine",value:function(z){var j=z||{},B=j.x,N=j.y;if(!z||!T.isValid(B)||!T.isValid(N))throw new Error("invalid affine point");if(z instanceof V)throw new Error("projective point not allowed");var F=function(K){return T.eql(K,T.ZERO)};return F(B)&&F(N)?V.ZERO:new V(B,N,T.ONE)}},{key:"normalizeZ",value:function(z){var j=T.invertBatch(z.map(function(B){return B.pz}));return z.map(function(B,N){return B.toAffine(j[N])}).map(V.fromAffine)}},{key:"fromHex",value:function(z){var j=V.fromAffine(_((0,f.ensureBytes)("pointHex",z)));return j.assertValidity(),j}},{key:"fromPrivateKey",value:function(z){return V.BASE.multiply(I(z))}}]),V}();X.BASE=new X(M.Gx,M.Gy,T.ONE),X.ZERO=new X(T.ZERO,T.ONE,T.ZERO);var R=M.nBitLength,H=(0,p.wNAF)(X,M.endo?Math.ceil(R/2):R);return{CURVE:M,ProjectivePoint:X,normPrivateKeyToScalar:I,weierstrassEquation:D,isWithinCurveOrder:A}}function L(C,M){for(var T=C.ORDER,b=y,_=T-v;_%S===y;_/=S)b+=v;var D=b,A=S<v;ee--){var te=ee-S;te=S<D>>v}var B=function(Z,re,ne){return a.bytesToNumberBE(Z.slice(re,ne))},N=function(){function Z(re,ne,ae){(0,m.default)(this,Z),this.r=re,this.s=ne,this.recovery=ae,this.assertValidity()}return(0,w.default)(Z,[{key:"assertValidity",value:function(){if(!V(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!V(this.s))throw new Error("s must be 0 < s < CURVE.n")}},{key:"addRecoveryBit",value:function(re){return new Z(this.r,this.s,re)}},{key:"recoverPublicKey",value:function(re){var ne=this.r,ae=this.s,fe=this.recovery,ue=Q((0,f.ensureBytes)("msgHash",re));if(fe==null||![0,1,2,3].includes(fe))throw new Error("recovery id invalid");var le=fe===2||fe===3?ne+b.n:ne;if(le>=_.ORDER)throw new Error("recovery id 2 or 3 invalid");var he=1&fe?"03":"02",me=X.fromHex(he+z(le)),pe=G(le),xe=I(-ue*pe),be=I(ae*pe),ye=X.BASE.multiplyAndAddUnsafe(me,xe,be);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}},{key:"hasHighS",value:function(){return j(this.s)}},{key:"normalizeS",value:function(){return this.hasHighS()?new Z(this.r,I(-this.s),this.recovery):this}},{key:"toDERRawBytes",value:function(){return a.hexToBytes(this.toDERHex())}},{key:"toDERHex",value:function(){return c.DER.hexFromSig({r:this.r,s:this.s})}},{key:"toCompactRawBytes",value:function(){return a.hexToBytes(this.toCompactHex())}},{key:"toCompactHex",value:function(){return z(this.r)+z(this.s)}}],[{key:"fromCompact",value:function(re){var ne=b.nByteLength;return re=(0,f.ensureBytes)("compactSignature",re,2*ne),new Z(B(re,0,ne),B(re,ne,2*ne))}},{key:"fromDER",value:function(re){var ne=c.DER.toSig((0,f.ensureBytes)("DER",re));return new Z(ne.r,ne.s)}}]),Z}(),F={isValidPrivateKey:function(Z){try{return R(Z),!0}catch{return!1}},normPrivateKeyToScalar:R,randomPrivateKey:function(){var Z=b.randomBytes(_.BYTES+8),re=e.hashToPrivateScalar(Z,D);return a.numberToBytesBE(re,b.nByteLength)},precompute:function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8,re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.BASE;return re._setWindowSize(Z),re.multiply(BigInt(3)),re}};function K(Z){var re=Z instanceof Uint8Array,ne=typeof Z=="string",ae=(re||ne)&&Z.length;return re?ae===A||ae===P:ne?ae===2*A||ae===2*P:Z instanceof X}var q=b.bits2int||function(Z){var re=a.bytesToNumberBE(Z),ne=8*Z.length-b.nBitLength;return ne>0?re>>BigInt(ne):re},Q=b.bits2int_modN||function(Z){return I(q(Z))},$=a.bitMask(b.nBitLength);function W(Z){if(typeof Z!="bigint")throw new Error("bigint expected");if(!(y<=Z&&Z<$))throw new Error("bigint expected < 2^".concat(b.nBitLength));return a.numberToBytesBE(Z,b.nByteLength)}var ee={lowS:b.lowS,prehash:!1},te={lowS:b.lowS,prehash:!1};return X.BASE._setWindowSize(8),{CURVE:b,getPublicKey:function(Z){var re=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return X.fromPrivateKey(Z).toRawBytes(re)},getSharedSecret:function(Z,re){var ne=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(K(Z))throw new Error("first arg must be private key");if(!K(re))throw new Error("second arg must be public key");return X.fromHex(re).multiply(R(Z)).toRawBytes(ne)},sign:function(Z,re){var ne=function(le,he){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ee;if(["recovered","canonical"].some(function(Se){return Se in me}))throw new Error("sign() legacy options not supported");var pe=b.hash,xe=b.randomBytes,be=me.lowS,ye=me.prehash,Be=me.extraEntropy;be==null&&(be=!0),le=(0,f.ensureBytes)("msgHash",le),ye&&(le=(0,f.ensureBytes)("prehashed msgHash",pe(le)));var _e=Q(le),Ae=R(he),Ue=[W(Ae),W(_e)];if(Be!=null){var Pe=Be===!0?xe(_.BYTES):Be;Ue.push((0,f.ensureBytes)("extraEntropy",Pe,_.BYTES))}var ke=a.concatBytes.apply(a,Ue),Le=_e;return{seed:ke,k2sig:function(Se){var we=q(Se);if(V(we)){var Oe=G(we),Ee=X.BASE.multiply(we).toAffine(),De=I(Ee.x);if(De!==y){var Xe=I(Oe*I(Le+De*Ae));if(Xe!==y){var Re=(Ee.x===De?0:2)|Number(Ee.y&v),Ce=Xe;return be&&j(Xe)&&(Ce=function(Qe){return j(Qe)?I(-Qe):Qe}(Xe),Re^=1),new N(De,Ce,Re)}}}}}}(Z,re,arguments.length>2&&arguments[2]!==void 0?arguments[2]:ee),ae=ne.seed,fe=ne.k2sig,ue=b;return a.createHmacDrbg(ue.hash.outputLen,ue.nByteLength,ue.hmac)(ae,fe)},verify:function(Z,re,ne){var ae,fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:te,ue=Z;if(re=(0,f.ensureBytes)("msgHash",re),ne=(0,f.ensureBytes)("publicKey",ne),"strict"in fe)throw new Error("options.strict was renamed to lowS");var le,he=fe.lowS,me=fe.prehash,pe=void 0;try{if(typeof ue=="string"||ue instanceof Uint8Array)try{pe=N.fromDER(ue)}catch(Se){if(!(Se instanceof c.DER.Err))throw Se;pe=N.fromCompact(ue)}else{if((0,o.default)(ue)!=="object"||typeof ue.r!="bigint"||typeof ue.s!="bigint")throw new Error("PARSE");var xe=ue.r,be=ue.s;pe=new N(xe,be)}le=X.fromHex(ne)}catch(Se){if(Se.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(he&&pe.hasHighS())return!1;me&&(re=b.hash(re));var ye=pe,Be=ye.r,_e=ye.s,Ae=Q(re),Ue=G(_e),Pe=I(Ae*Ue),ke=I(Be*Ue),Le=(ae=X.BASE.multiplyAndAddUnsafe(le,Pe,ke))===null||ae===void 0?void 0:ae.toAffine();return!!Le&&I(Le.x)===Be},ProjectivePoint:X,Signature:N,utils:F}},c.SWUFpSqrtRatio=L,c.mapToCurveSimpleSWU=function(C,M){if(e.validateField(C),!C.isValid(M.A)||!C.isValid(M.B)||!C.isValid(M.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");var T=L(C,M.Z);if(!C.isOdd)throw new Error("Fp.isOdd is not implemented!");return function(b){var _,D,A,P,I,G,J,X;_=C.sqr(b),_=C.mul(_,M.Z),D=C.sqr(_),D=C.add(D,_),A=C.add(D,C.ONE),A=C.mul(A,M.B),P=C.cmov(M.Z,C.neg(D),!C.eql(D,C.ZERO)),P=C.mul(P,M.A),D=C.sqr(A),G=C.sqr(P),I=C.mul(G,M.A),D=C.add(D,I),D=C.mul(D,A),G=C.mul(G,P),I=C.mul(G,M.B),D=C.add(D,I),J=C.mul(_,A);var R=T(D,G),H=R.isValid,V=R.value;X=C.mul(_,b),X=C.mul(X,V),J=C.cmov(J,A,H),X=C.cmov(X,V,H);var z=C.isOdd(b)===C.isOdd(X);return X=C.cmov(C.neg(X),X,z),{x:J=C.div(J,P),y:X}}}},4158:(U,c,d)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.encodeToCurve=c.hashToCurve=c.schnorr=c.secp256k1=void 0;var h=d(61241),w=d(72434),m=d(3970),l=d(16573),t=d(46928),s=d(19751),u=d(96546),r=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),o=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),n=BigInt(1),i=BigInt(2),e=function(I,G){return(I+G/i)/G};function a(I){var G=r,J=BigInt(3),X=BigInt(6),R=BigInt(11),H=BigInt(22),V=BigInt(23),z=BigInt(44),j=BigInt(88),B=I*I*I%G,N=B*B*I%G,F=(0,m.pow2)(N,J,G)*N%G,K=(0,m.pow2)(F,J,G)*N%G,q=(0,m.pow2)(K,i,G)*B%G,Q=(0,m.pow2)(q,R,G)*q%G,$=(0,m.pow2)(Q,H,G)*Q%G,W=(0,m.pow2)($,z,G)*$%G,ee=(0,m.pow2)(W,j,G)*W%G,te=(0,m.pow2)(ee,z,G)*$%G,Z=(0,m.pow2)(te,J,G)*N%G,re=(0,m.pow2)(Z,V,G)*Q%G,ne=(0,m.pow2)(re,X,G)*B%G,ae=(0,m.pow2)(ne,i,G);if(!f.eql(f.sqr(ae),I))throw new Error("Cannot find square root");return ae}var f=(0,m.Field)(r,void 0,void 0,{sqrt:a});c.secp256k1=(0,u.createCurve)({a:BigInt(0),b:BigInt(7),Fp:f,n:o,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:function(I){var G=o,J=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),X=-n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),R=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),H=J,V=BigInt("0x100000000000000000000000000000000"),z=e(H*I,G),j=e(-X*I,G),B=(0,m.mod)(I-z*J-j*R,G),N=(0,m.mod)(-z*X-j*H,G),F=B>V,K=N>V;if(F&&(B=G-B),K&&(N=G-N),B>V||N>V)throw new Error("splitScalar: Endomorphism failed, k="+I);return{k1neg:F,k1:B,k2neg:K,k2:N}}}},h.sha256);var p=BigInt(0),g=function(I){return typeof I=="bigint"&&p1?X-1:0),H=1;H2&&arguments[2]!==void 0?arguments[2]:(0,w.randomBytes)(32),X=(0,t.ensureBytes)("message",I),R=M(G),H=R.bytes,V=R.scalar,z=(0,t.ensureBytes)("auxRand",J,32),j=E(V^(0,t.bytesToNumberBE)(v("BIP0340/aux",z))),B=v("BIP0340/nonce",j,H,X),N=k((0,t.bytesToNumberBE)(B));if(N===p)throw new Error("sign failed: k is zero");var F=M(N),K=F.bytes,q=F.scalar,Q=b(K,H,X),$=new Uint8Array(64);if($.set(K,0),$.set(E(k(q+Q*V)),32),!_($,X,H))throw new Error("sign: Invalid signature produced");return $},verify:_,utils:{randomPrivateKey:c.secp256k1.utils.randomPrivateKey,lift_x:T,pointToBytes:S,numberToBytesBE:t.numberToBytesBE,bytesToNumberBE:t.bytesToNumberBE,taggedHash:v,mod:m.mod}};var D=function(){return(0,s.isogenyMap)(f,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(function(I){return I.map(function(G){return BigInt(G)})}))}(),A=function(){return(0,l.mapToCurveSimpleSWU)(f,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:f.create(BigInt("-11"))})}(),P=function(){return(0,s.createHasher)(c.secp256k1.ProjectivePoint,function(I){var G=A(f.create(I[0])),J=G.x,X=G.y;return D(J,X)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:f.ORDER,m:1,k:128,expand:"xmd",hash:h.sha256})}();c.hashToCurve=P.hashToCurve,c.encodeToCurve=P.encodeToCurve},96822:(U,c)=>{function d(u){if(!Number.isSafeInteger(u)||u<0)throw new Error("Wrong positive integer: ".concat(u))}function h(u){if(typeof u!="boolean")throw new Error("Expected boolean, not ".concat(u))}function w(u){if(!(u instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n0&&!o.includes(u.length))throw new Error("Expected Uint8Array of length ".concat(o,", not of length=").concat(u.length))}function m(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");d(u.outputLen),d(u.blockLen)}function l(u){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(u.destroyed)throw new Error("Hash instance has been destroyed");if(r&&u.finished)throw new Error("Hash#digest() has already been called")}function t(u,r){w(u);var o=r.outputLen;if(u.length{var h=d(28847),w=h(d(93106)),m=h(d(69721)),l=h(d(58985)),t=h(d(15163)),s=h(d(34650)),u=h(d(21949));Object.defineProperty(c,"__esModule",{value:!0}),c.SHA2=void 0;var r=d(96822),o=d(72434),n=function(i){(0,t.default)(p,i);var e,a,f=(e=p,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,x=(0,u.default)(e);if(a){var y=(0,u.default)(this).constructor;g=Reflect.construct(x,arguments,y)}else g=x.apply(this,arguments);return(0,s.default)(this,g)});function p(g,x,y,v){var S;return(0,m.default)(this,p),(S=f.call(this)).blockLen=g,S.outputLen=x,S.padOffset=y,S.isLE=v,S.finished=!1,S.length=0,S.pos=0,S.destroyed=!1,S.buffer=new Uint8Array(g),S.view=(0,o.createView)(S.buffer),S}return(0,l.default)(p,[{key:"update",value:function(g){r.default.exists(this);for(var x=this.view,y=this.buffer,v=this.blockLen,S=(g=(0,o.toBytes)(g)).length,E=0;Ev-E&&(this.process(y,0),E=0);for(var O=E;O>P&I),J=Number(D&I),X=A?4:0,R=A?0:4;b.setUint32(_+X,G,A),b.setUint32(_+R,J,A)})(y,v-8,BigInt(8*this.length),S),this.process(y,0);var k=(0,o.createView)(g),L=this.outputLen;if(L%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var C=L/4,M=this.get();if(C>M.length)throw new Error("_sha2: outputLen bigger than state");for(var T=0;T{Object.defineProperty(c,"__esModule",{value:!0}),c.add=c.toBig=c.split=c.fromBig=void 0;var d=BigInt(Math.pow(2,32)-1),h=BigInt(32);function w(s){return arguments.length>1&&arguments[1]!==void 0&&arguments[1]?{h:Number(s&d),l:Number(s>>h&d)}:{h:0|Number(s>>h&d),l:0|Number(s&d)}}function m(s){for(var u=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=new Uint32Array(s.length),o=new Uint32Array(s.length),n=0;n>>0)+(o>>>0);return{h:s+r+(n/Math.pow(2,32)|0)|0,l:0|n}}c.fromBig=w,c.split=m,c.toBig=function(s,u){return BigInt(s>>>0)<>>0)},c.add=l;var t={fromBig:w,split:m,toBig:c.toBig,shrSH:function(s,u,r){return s>>>r},shrSL:function(s,u,r){return s<<32-r|u>>>r},rotrSH:function(s,u,r){return s>>>r|u<<32-r},rotrSL:function(s,u,r){return s<<32-r|u>>>r},rotrBH:function(s,u,r){return s<<64-r|u>>>r-32},rotrBL:function(s,u,r){return s>>>r-32|u<<64-r},rotr32H:function(s,u){return u},rotr32L:function(s,u){return s},rotlSH:function(s,u,r){return s<>>32-r},rotlSL:function(s,u,r){return u<>>32-r},rotlBH:function(s,u,r){return u<>>64-r},rotlBL:function(s,u,r){return s<>>64-r},add:l,add3L:function(s,u,r){return(s>>>0)+(u>>>0)+(r>>>0)},add3H:function(s,u,r,o){return u+r+o+(s/Math.pow(2,32)|0)|0},add4L:function(s,u,r,o){return(s>>>0)+(u>>>0)+(r>>>0)+(o>>>0)},add4H:function(s,u,r,o,n){return u+r+o+n+(s/Math.pow(2,32)|0)|0},add5H:function(s,u,r,o,n,i){return u+r+o+n+i+(s/Math.pow(2,32)|0)|0},add5L:function(s,u,r,o,n){return(s>>>0)+(u>>>0)+(r>>>0)+(o>>>0)+(n>>>0)}};c.default=t},39712:(U,c,d)=>{var h=d(28847)(d(3355));Object.defineProperty(c,"__esModule",{value:!0}),c.crypto=void 0,c.crypto=(typeof globalThis>"u"?"undefined":(0,h.default)(globalThis))==="object"&&"crypto"in globalThis?globalThis.crypto:void 0},45896:(U,c,d)=>{var h=d(28847),w=h(d(69721)),m=h(d(58985)),l=h(d(15163)),t=h(d(34650)),s=h(d(21949));Object.defineProperty(c,"__esModule",{value:!0}),c.hmac=c.HMAC=void 0;var u=d(96822),r=d(72434),o=function(n){(0,l.default)(f,n);var i,e,a=(i=f,e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var p,g=(0,s.default)(i);if(e){var x=(0,s.default)(this).constructor;p=Reflect.construct(g,arguments,x)}else p=g.apply(this,arguments);return(0,t.default)(this,p)});function f(p,g){var x;(0,w.default)(this,f),(x=a.call(this)).finished=!1,x.destroyed=!1,u.default.hash(p);var y=(0,r.toBytes)(g);if(x.iHash=p.create(),typeof x.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");x.blockLen=x.iHash.blockLen,x.outputLen=x.iHash.outputLen;var v=x.blockLen,S=new Uint8Array(v);S.set(y.length>v?p.create().update(y).digest():y);for(var E=0;E{var h=d(28847),w=h(d(69721)),m=h(d(58985)),l=h(d(15163)),t=h(d(34650)),s=h(d(21949));function u(g){var x=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var y,v=(0,s.default)(g);if(x){var S=(0,s.default)(this).constructor;y=Reflect.construct(v,arguments,S)}else y=v.apply(this,arguments);return(0,t.default)(this,y)}}Object.defineProperty(c,"__esModule",{value:!0}),c.sha224=c.sha256=void 0;var r=d(20330),o=d(72434),n=function(g,x,y){return g&x^g&y^x&y},i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),e=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64),f=function(g){(0,l.default)(y,g);var x=u(y);function y(){var v;return(0,w.default)(this,y),(v=x.call(this,64,32,8,!1)).A=0|e[0],v.B=0|e[1],v.C=0|e[2],v.D=0|e[3],v.E=0|e[4],v.F=0|e[5],v.G=0|e[6],v.H=0|e[7],v}return(0,m.default)(y,[{key:"get",value:function(){return[this.A,this.B,this.C,this.D,this.E,this.F,this.G,this.H]}},{key:"set",value:function(v,S,E,O,k,L,C,M){this.A=0|v,this.B=0|S,this.C=0|E,this.D=0|O,this.E=0|k,this.F=0|L,this.G=0|C,this.H=0|M}},{key:"process",value:function(v,S){for(var E=0;E<16;E++,S+=4)a[E]=v.getUint32(S,!1);for(var O=16;O<64;O++){var k=a[O-15],L=a[O-2],C=(0,o.rotr)(k,7)^(0,o.rotr)(k,18)^k>>>3,M=(0,o.rotr)(L,17)^(0,o.rotr)(L,19)^L>>>10;a[O]=M+a[O-7]+C+a[O-16]|0}var T,b=this.A,_=this.B,D=this.C,A=this.D,P=this.E,I=this.F,G=this.G,J=this.H;for(E=0;E<64;E++){var X=J+((0,o.rotr)(P,6)^(0,o.rotr)(P,11)^(0,o.rotr)(P,25))+((T=P)&I^~T&G)+i[E]+a[E]|0,R=((0,o.rotr)(b,2)^(0,o.rotr)(b,13)^(0,o.rotr)(b,22))+n(b,_,D)|0;J=G,G=I,I=P,P=A+X|0,A=D,D=_,_=b,b=X+R|0}b=b+this.A|0,_=_+this.B|0,D=D+this.C|0,A=A+this.D|0,P=P+this.E|0,I=I+this.F|0,G=G+this.G|0,J=J+this.H|0,this.set(b,_,D,A,P,I,G,J)}},{key:"roundClean",value:function(){a.fill(0)}},{key:"destroy",value:function(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}]),y}(r.SHA2),p=function(g){(0,l.default)(y,g);var x=u(y);function y(){var v;return(0,w.default)(this,y),(v=x.call(this)).A=-1056596264,v.B=914150663,v.C=812702999,v.D=-150054599,v.E=-4191439,v.F=1750603025,v.G=1694076839,v.H=-1090891868,v.outputLen=28,v}return(0,m.default)(y)}(f);c.sha256=(0,o.wrapConstructor)(function(){return new f}),c.sha224=(0,o.wrapConstructor)(function(){return new p})},64376:(U,c,d)=>{var h=d(28847),w=h(d(69721)),m=h(d(58985)),l=h(d(15163)),t=h(d(34650)),s=h(d(21949)),u=h(d(74519));Object.defineProperty(c,"__esModule",{value:!0}),c.shake256=c.shake128=c.keccak_512=c.keccak_384=c.keccak_256=c.keccak_224=c.sha3_512=c.sha3_384=c.sha3_256=c.sha3_224=c.Keccak=c.keccakP=void 0;for(var r=d(96822),o=d(64356),n=d(72434),i=[],e=[],a=[],f=BigInt(0),p=BigInt(1),g=BigInt(2),x=BigInt(7),y=BigInt(256),v=BigInt(113),S=0,E=p,O=1,k=0;S<24;S++){var L=[k,(2*O+3*k)%5];O=L[0],k=L[1],i.push(2*(5*k+O)),e.push((S+1)*(S+2)/2%64);for(var C=f,M=0;M<7;M++)(E=(E<>x)*v)%y)&g&&(C^=p<<(p<32?o.default.rotlBH(R,H,V):o.default.rotlSH(R,H,V)},P=function(R,H,V){return V>32?o.default.rotlBL(R,H,V):o.default.rotlSL(R,H,V)};function I(R){for(var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:24,V=new Uint32Array(10),z=24-H;z<24;z++){for(var j=0;j<10;j++)V[j]=R[j]^R[j+10]^R[j+20]^R[j+30]^R[j+40];for(var B=0;B<10;B+=2)for(var N=(B+8)%10,F=(B+2)%10,K=V[F],q=V[F+1],Q=A(K,q,1)^V[N],$=P(K,q,1)^V[N+1],W=0;W<50;W+=10)R[B+W]^=Q,R[B+W+1]^=$;for(var ee=R[2],te=R[3],Z=0;Z<24;Z++){var re=e[Z],ne=A(ee,te,re),ae=P(ee,te,re),fe=i[Z];ee=R[fe],te=R[fe+1],R[fe]=ne,R[fe+1]=ae}for(var ue=0;ue<50;ue+=10){for(var le=0;le<10;le++)V[le]=R[ue+le];for(var he=0;he<10;he++)R[ue+he]^=~V[(he+2)%10]&V[(he+4)%10]}R[0]^=_[z],R[1]^=D[z]}V.fill(0)}c.keccakP=I;var G=function(R){(0,l.default)(j,R);var H,V,z=(H=j,V=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var B,N=(0,s.default)(H);if(V){var F=(0,s.default)(this).constructor;B=Reflect.construct(N,arguments,F)}else B=N.apply(this,arguments);return(0,t.default)(this,B)});function j(B,N,F){var K,q=arguments.length>3&&arguments[3]!==void 0&&arguments[3],Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:24;if((0,w.default)(this,j),(K=z.call(this)).blockLen=B,K.suffix=N,K.outputLen=F,K.enableXOF=q,K.rounds=Q,K.pos=0,K.posOut=0,K.finished=!1,K.destroyed=!1,r.default.number(F),0>=K.blockLen||K.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");return K.state=new Uint8Array(200),K.state32=(0,n.u32)(K.state),K}return(0,m.default)(j,[{key:"keccak",value:function(){I(this.state32,this.rounds),this.posOut=0,this.pos=0}},{key:"update",value:function(B){r.default.exists(this);for(var N=this.blockLen,F=this.state,K=(B=(0,n.toBytes)(B)).length,q=0;q=F&&this.keccak();var Q=Math.min(F-this.posOut,q-K);B.set(N.subarray(this.posOut,this.posOut+Q),K),this.posOut+=Q,K+=Q}return B}},{key:"xofInto",value:function(B){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(B)}},{key:"xof",value:function(B){return r.default.number(B),this.xofInto(new Uint8Array(B))}},{key:"digestInto",value:function(B){if(r.default.output(B,this),this.finished)throw new Error("digest() was already called");return this.writeInto(B),this.destroy(),B}},{key:"digest",value:function(){return this.digestInto(new Uint8Array(this.outputLen))}},{key:"destroy",value:function(){this.destroyed=!0,this.state.fill(0)}},{key:"_cloneInto",value:function(B){var N=this.blockLen,F=this.suffix,K=this.outputLen,q=this.rounds,Q=this.enableXOF;return B||(B=new j(N,F,K,Q,q)),B.state32.set(this.state32),B.pos=this.pos,B.posOut=this.posOut,B.finished=this.finished,B.rounds=q,B.suffix=F,B.outputLen=K,B.enableXOF=Q,B.destroyed=this.destroyed,B}}]),j}(n.Hash);c.Keccak=G;var J=function(R,H,V){return(0,n.wrapConstructor)(function(){return new G(H,R,V)})};c.sha3_224=J(6,144,28),c.sha3_256=J(6,136,32),c.sha3_384=J(6,104,48),c.sha3_512=J(6,72,64),c.keccak_224=J(1,144,28),c.keccak_256=J(1,136,32),c.keccak_384=J(1,104,48),c.keccak_512=J(1,72,64);var X=function(R,H,V){return(0,n.wrapXOFConstructorWithOpts)(function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new G(H,R,z.dkLen===void 0?V:z.dkLen,!0)})};c.shake128=X(31,168,16),c.shake256=X(31,136,32)},72434:(U,c,d)=>{var h=d(28847),w=h(d(82247)),m=h(d(69721)),l=h(d(58985)),t=h(d(94571)),s=h(d(3355));Object.defineProperty(c,"__esModule",{value:!0}),c.randomBytes=c.wrapXOFConstructorWithOpts=c.wrapConstructorWithOpts=c.wrapConstructor=c.checkOpts=c.Hash=c.concatBytes=c.toBytes=c.utf8ToBytes=c.asyncLoop=c.nextTick=c.hexToBytes=c.bytesToHex=c.isLE=c.rotr=c.createView=c.u32=c.u8=void 0;var u=d(39712),r=function(p){return p instanceof Uint8Array};if(c.u8=function(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)},c.u32=function(p){return new Uint32Array(p.buffer,p.byteOffset,Math.floor(p.byteLength/4))},c.createView=function(p){return new DataView(p.buffer,p.byteOffset,p.byteLength)},c.rotr=function(p,g){return p<<32-g|p>>>g},c.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!c.isLE)throw new Error("Non little-endian hardware is not supported");var o=Array.from({length:256},function(p,g){return g.toString(16).padStart(2,"0")});c.bytesToHex=function(p){if(!r(p))throw new Error("Uint8Array expected");for(var g="",x=0;x=0&&E0&&arguments[0]!==void 0?arguments[0]:32;if(u.crypto&&typeof u.crypto.getRandomValues=="function")return u.crypto.getRandomValues(new Uint8Array(p));throw new Error("crypto.getRandomValues must be defined")}},53368:(U,c,d)=>{var h,w,m=d(28847)(d(3355));(w=typeof(h=function(){function l(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}function t(g,x){for(var y=0;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var y,v=u(g);if(x){var S=u(this).constructor;y=Reflect.construct(v,arguments,S)}else y=v.apply(this,arguments);return function(E,O){if(O&&((0,m.default)(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o(E)}(this,y)}}function i(){return i=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(g,x,y){var v=function(E,O){for(;!Object.prototype.hasOwnProperty.call(E,O)&&(E=u(E))!==null;);return E}(g,x);if(v){var S=Object.getOwnPropertyDescriptor(v,x);return S.get?S.get.call(arguments.length<3?g:y):S.value}},i.apply(this,arguments)}var e=function(){function g(){l(this,g),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return s(g,[{key:"addEventListener",value:function(x,y,v){x in this.listeners||(this.listeners[x]=[]),this.listeners[x].push({callback:y,options:v})}},{key:"removeEventListener",value:function(x,y){if(x in this.listeners){for(var v=this.listeners[x],S=0,E=v.length;S"u")(v=new Error("This operation was aborted")).name="AbortError";else try{v=new DOMException("signal is aborted without reason")}catch{(v=new Error("This operation was aborted")).name="AbortError"}this.signal.reason=v,this.signal.dispatchEvent(y)}},{key:"toString",value:function(){return"[object AbortController]"}}]),g}();function p(g){return g.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof g.Request=="function"&&!g.Request.prototype.hasOwnProperty("signal")||!g.AbortController}typeof Symbol<"u"&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",a.prototype[Symbol.toStringTag]="AbortSignal"),function(g){if(p(g))if(g.fetch){var x=function(S){typeof S=="function"&&(S={fetch:S});var E=S,O=E.fetch,k=E.Request,L=k===void 0?O.Request:k,C=E.AbortController,M=E.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,T=M!==void 0&&M;if(!p({fetch:O,Request:L,AbortController:C,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:T}))return{fetch:O,Request:b};var b=L;(b&&!b.prototype.hasOwnProperty("signal")||T)&&((b=function(D,A){var P;A&&A.signal&&(P=A.signal,delete A.signal);var I=new L(D,A);return P&&Object.defineProperty(I,"signal",{writable:!1,enumerable:!1,configurable:!0,value:P}),I}).prototype=L.prototype);var _=O;return{fetch:function(D,A){var P=b&&b.prototype.isPrototypeOf(D)?D.signal:A?A.signal:void 0;if(P){var I;try{I=new DOMException("Aborted","AbortError")}catch{(I=new Error("Aborted")).name="AbortError"}if(P.aborted)return Promise.reject(I);var G=new Promise(function(J,X){P.addEventListener("abort",function(){return X(I)},{once:!0})});return A&&A.signal&&delete A.signal,Promise.race([G,_(D,A)])}return _(D,A)},Request:b}}(g),y=x.fetch,v=x.Request;g.fetch=y,g.Request=v,Object.defineProperty(g,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:f}),Object.defineProperty(g,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:a})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}(typeof self<"u"?self:d.g)})=="function"?h.call(c,d,c,U):h)===void 0||(U.exports=w)},68357:(U,c,d)=>{var h=c;h.bignum=d(31734),h.define=d(41568).define,h.base=d(12412),h.constants=d(79387),h.decoders=d(61500),h.encoders=d(47506)},41568:(U,c,d)=>{var h=d(47506),w=d(61500),m=d(41736);function l(t,s){this.name=t,this.body=s,this.decoders={},this.encoders={}}c.define=function(t,s){return new l(t,s)},l.prototype._createNamed=function(t){var s=this.name;function u(r){this._initNamed(r,s)}return m(u,t),u.prototype._initNamed=function(r,o){t.call(this,r,o)},new u(this)},l.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(w[t])),this.decoders[t]},l.prototype.decode=function(t,s,u){return this._getDecoder(s).decode(t,u)},l.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(h[t])),this.encoders[t]},l.prototype.encode=function(t,s,u){return this._getEncoder(s).encode(t,u)}},90585:(U,c,d)=>{var h=d(28847)(d(3355)),w=d(41736),m=d(32719).b,l=d(11755).Buffer;function t(u,r){m.call(this,r),l.isBuffer(u)?(this.base=u,this.offset=0,this.length=u.length):this.error("Input not Buffer")}function s(u,r){if(Array.isArray(u))this.length=0,this.value=u.map(function(o){return s.isEncoderBuffer(o)||(o=new s(o,r)),this.length+=o.length,o},this);else if(typeof u=="number"){if(!(0<=u&&u<=255))return r.error("non-byte EncoderBuffer value");this.value=u,this.length=1}else if(typeof u=="string")this.value=u,this.length=l.byteLength(u);else{if(!l.isBuffer(u))return r.error("Unsupported type: "+(0,h.default)(u));this.value=u,this.length=u.length}}w(t,m),c.C=t,t.isDecoderBuffer=function(u){return u instanceof t||(0,h.default)(u)==="object"&&l.isBuffer(u.base)&&u.constructor.name==="DecoderBuffer"&&typeof u.offset=="number"&&typeof u.length=="number"&&typeof u.save=="function"&&typeof u.restore=="function"&&typeof u.isEmpty=="function"&&typeof u.readUInt8=="function"&&typeof u.skip=="function"&&typeof u.raw=="function"},t.prototype.save=function(){return{offset:this.offset,reporter:m.prototype.save.call(this)}},t.prototype.restore=function(u){var r=new t(this.base);return r.offset=u.offset,r.length=this.offset,this.offset=u.offset,m.prototype.restore.call(this,u.reporter),r},t.prototype.isEmpty=function(){return this.offset===this.length},t.prototype.readUInt8=function(u){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(u||"DecoderBuffer overrun")},t.prototype.skip=function(u,r){if(!(this.offset+u<=this.length))return this.error(r||"DecoderBuffer overrun");var o=new t(this.base);return o._reporterState=this._reporterState,o.offset=this.offset,o.length=this.offset+u,this.offset+=u,o},t.prototype.raw=function(u){return this.base.slice(u?u.offset:this.offset,this.length)},c.R=s,s.isEncoderBuffer=function(u){return u instanceof s||(0,h.default)(u)==="object"&&u.constructor.name==="EncoderBuffer"&&typeof u.length=="number"&&typeof u.join=="function"},s.prototype.join=function(u,r){return u||(u=l.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(o){o.join(u,r),r+=o.length}):(typeof this.value=="number"?u[r]=this.value:typeof this.value=="string"?u.write(this.value,r):l.isBuffer(this.value)&&this.value.copy(u,r),r+=this.length)),u}},12412:(U,c,d)=>{var h=c;h.Reporter=d(32719).b,h.DecoderBuffer=d(90585).C,h.EncoderBuffer=d(90585).R,h.Node=d(51371)},51371:(U,c,d)=>{var h=d(28847)(d(3355)),w=d(32719).b,m=d(90585).R,l=d(90585).C,t=d(94504),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function r(n,i,e){var a={};this._baseState=a,a.name=e,a.enc=n,a.parent=i||null,a.children=null,a.tag=null,a.args=null,a.reverseArgs=null,a.choice=null,a.optional=!1,a.any=!1,a.obj=!1,a.use=null,a.useDecoder=null,a.key=null,a.default=null,a.explicit=null,a.implicit=null,a.contains=null,a.parent||(a.children=[],this._wrap())}U.exports=r;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];r.prototype.clone=function(){var n=this._baseState,i={};o.forEach(function(a){i[a]=n[a]});var e=new this.constructor(i.parent);return e._baseState=i,e},r.prototype._wrap=function(){var n=this._baseState;u.forEach(function(i){this[i]=function(){var e=new this.constructor(this);return n.children.push(e),e[i].apply(e,arguments)}},this)},r.prototype._init=function(n){var i=this._baseState;t(i.parent===null),n.call(this),i.children=i.children.filter(function(e){return e._baseState.parent===this},this),t.equal(i.children.length,1,"Root node can have only one child")},r.prototype._useArgs=function(n){var i=this._baseState,e=n.filter(function(a){return a instanceof this.constructor},this);n=n.filter(function(a){return!(a instanceof this.constructor)},this),e.length!==0&&(t(i.children===null),i.children=e,e.forEach(function(a){a._baseState.parent=this},this)),n.length!==0&&(t(i.args===null),i.args=n,i.reverseArgs=n.map(function(a){if((0,h.default)(a)!=="object"||a.constructor!==Object)return a;var f={};return Object.keys(a).forEach(function(p){p==(0|p)&&(p|=0);var g=a[p];f[g]=p}),f}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(n){r.prototype[n]=function(){var i=this._baseState;throw new Error(n+" not implemented for encoding: "+i.enc)}}),s.forEach(function(n){r.prototype[n]=function(){var i=this._baseState,e=Array.prototype.slice.call(arguments);return t(i.tag===null),i.tag=n,this._useArgs(e),this}}),r.prototype.use=function(n){t(n);var i=this._baseState;return t(i.use===null),i.use=n,this},r.prototype.optional=function(){return this._baseState.optional=!0,this},r.prototype.def=function(n){var i=this._baseState;return t(i.default===null),i.default=n,i.optional=!0,this},r.prototype.explicit=function(n){var i=this._baseState;return t(i.explicit===null&&i.implicit===null),i.explicit=n,this},r.prototype.implicit=function(n){var i=this._baseState;return t(i.explicit===null&&i.implicit===null),i.implicit=n,this},r.prototype.obj=function(){var n=this._baseState,i=Array.prototype.slice.call(arguments);return n.obj=!0,i.length!==0&&this._useArgs(i),this},r.prototype.key=function(n){var i=this._baseState;return t(i.key===null),i.key=n,this},r.prototype.any=function(){return this._baseState.any=!0,this},r.prototype.choice=function(n){var i=this._baseState;return t(i.choice===null),i.choice=n,this._useArgs(Object.keys(n).map(function(e){return n[e]})),this},r.prototype.contains=function(n){var i=this._baseState;return t(i.use===null),i.contains=n,this},r.prototype._decode=function(n,i){var e=this._baseState;if(e.parent===null)return n.wrapResult(e.children[0]._decode(n,i));var a,f=e.default,p=!0,g=null;if(e.key!==null&&(g=n.enterKey(e.key)),e.optional){var x=null;if(e.explicit!==null?x=e.explicit:e.implicit!==null?x=e.implicit:e.tag!==null&&(x=e.tag),x!==null||e.any){if(p=this._peekTag(n,x,e.any),n.isError(p))return p}else{var y=n.save();try{e.choice===null?this._decodeGeneric(e.tag,n,i):this._decodeChoice(n,i),p=!0}catch{p=!1}n.restore(y)}}if(e.obj&&p&&(a=n.enterObject()),p){if(e.explicit!==null){var v=this._decodeTag(n,e.explicit);if(n.isError(v))return v;n=v}var S=n.offset;if(e.use===null&&e.choice===null){var E;e.any&&(E=n.save());var O=this._decodeTag(n,e.implicit!==null?e.implicit:e.tag,e.any);if(n.isError(O))return O;e.any?f=n.raw(E):n=O}if(i&&i.track&&e.tag!==null&&i.track(n.path(),S,n.length,"tagged"),i&&i.track&&e.tag!==null&&i.track(n.path(),n.offset,n.length,"content"),e.any||(f=e.choice===null?this._decodeGeneric(e.tag,n,i):this._decodeChoice(n,i)),n.isError(f))return f;if(e.any||e.choice!==null||e.children===null||e.children.forEach(function(L){L._decode(n,i)}),e.contains&&(e.tag==="octstr"||e.tag==="bitstr")){var k=new l(f);f=this._getUse(e.contains,n._reporterState.obj)._decode(k,i)}}return e.obj&&p&&(f=n.leaveObject(a)),e.key===null||f===null&&p!==!0?g!==null&&n.exitKey(g):n.leaveKey(g,e.key,f),f},r.prototype._decodeGeneric=function(n,i,e){var a=this._baseState;return n==="seq"||n==="set"?null:n==="seqof"||n==="setof"?this._decodeList(i,n,a.args[0],e):/str$/.test(n)?this._decodeStr(i,n,e):n==="objid"&&a.args?this._decodeObjid(i,a.args[0],a.args[1],e):n==="objid"?this._decodeObjid(i,null,null,e):n==="gentime"||n==="utctime"?this._decodeTime(i,n,e):n==="null_"?this._decodeNull(i,e):n==="bool"?this._decodeBool(i,e):n==="objDesc"?this._decodeStr(i,n,e):n==="int"||n==="enum"?this._decodeInt(i,a.args&&a.args[0],e):a.use!==null?this._getUse(a.use,i._reporterState.obj)._decode(i,e):i.error("unknown tag: "+n)},r.prototype._getUse=function(n,i){var e=this._baseState;return e.useDecoder=this._use(n,i),t(e.useDecoder._baseState.parent===null),e.useDecoder=e.useDecoder._baseState.children[0],e.implicit!==e.useDecoder._baseState.implicit&&(e.useDecoder=e.useDecoder.clone(),e.useDecoder._baseState.implicit=e.implicit),e.useDecoder},r.prototype._decodeChoice=function(n,i){var e=this._baseState,a=null,f=!1;return Object.keys(e.choice).some(function(p){var g=n.save(),x=e.choice[p];try{var y=x._decode(n,i);if(n.isError(y))return!1;a={type:p,value:y},f=!0}catch{return n.restore(g),!1}return!0},this),f?a:n.error("Choice not matched")},r.prototype._createEncoderBuffer=function(n){return new m(n,this.reporter)},r.prototype._encode=function(n,i,e){var a=this._baseState;if(a.default===null||a.default!==n){var f=this._encodeValue(n,i,e);if(f!==void 0&&!this._skipDefault(f,i,e))return f}},r.prototype._encodeValue=function(n,i,e){var a=this._baseState;if(a.parent===null)return a.children[0]._encode(n,i||new w);var f=null;if(this.reporter=i,a.optional&&n===void 0){if(a.default===null)return;n=a.default}var p=null,g=!1;if(a.any)f=this._createEncoderBuffer(n);else if(a.choice)f=this._encodeChoice(n,i);else if(a.contains)p=this._getUse(a.contains,e)._encode(n,i),g=!0;else if(a.children)p=a.children.map(function(S){if(S._baseState.tag==="null_")return S._encode(null,i,n);if(S._baseState.key===null)return i.error("Child should have a key");var E=i.enterKey(S._baseState.key);if((0,h.default)(n)!=="object")return i.error("Child expected, but input is not object");var O=S._encode(n[S._baseState.key],i,n);return i.leaveKey(E),O},this).filter(function(S){return S}),p=this._createEncoderBuffer(p);else if(a.tag==="seqof"||a.tag==="setof"){if(!a.args||a.args.length!==1)return i.error("Too many args for : "+a.tag);if(!Array.isArray(n))return i.error("seqof/setof, but data is not Array");var x=this.clone();x._baseState.implicit=null,p=this._createEncoderBuffer(n.map(function(S){var E=this._baseState;return this._getUse(E.args[0],n)._encode(S,i)},x))}else a.use!==null?f=this._getUse(a.use,e)._encode(n,i):(p=this._encodePrimitive(a.tag,n),g=!0);if(!a.any&&a.choice===null){var y=a.implicit!==null?a.implicit:a.tag,v=a.implicit===null?"universal":"context";y===null?a.use===null&&i.error("Tag could be omitted only for .use()"):a.use===null&&(f=this._encodeComposite(y,g,v,p))}return a.explicit!==null&&(f=this._encodeComposite(a.explicit,!1,"context",f)),f},r.prototype._encodeChoice=function(n,i){var e=this._baseState,a=e.choice[n.type];return a||t(!1,n.type+" not found in "+JSON.stringify(Object.keys(e.choice))),a._encode(n.value,i)},r.prototype._encodePrimitive=function(n,i){var e=this._baseState;if(/str$/.test(n))return this._encodeStr(i,n);if(n==="objid"&&e.args)return this._encodeObjid(i,e.reverseArgs[0],e.args[1]);if(n==="objid")return this._encodeObjid(i,null,null);if(n==="gentime"||n==="utctime")return this._encodeTime(i,n);if(n==="null_")return this._encodeNull();if(n==="int"||n==="enum")return this._encodeInt(i,e.args&&e.reverseArgs[0]);if(n==="bool")return this._encodeBool(i);if(n==="objDesc")return this._encodeStr(i,n);throw new Error("Unsupported tag: "+n)},r.prototype._isNumstr=function(n){return/^[0-9 ]*$/.test(n)},r.prototype._isPrintstr=function(n){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(n)}},32719:(U,c,d)=>{var h=d(41736);function w(l){this._reporterState={obj:null,path:[],options:l||{},errors:[]}}function m(l,t){this.path=l,this.rethrow(t)}c.b=w,w.prototype.isError=function(l){return l instanceof m},w.prototype.save=function(){var l=this._reporterState;return{obj:l.obj,pathLen:l.path.length}},w.prototype.restore=function(l){var t=this._reporterState;t.obj=l.obj,t.path=t.path.slice(0,l.pathLen)},w.prototype.enterKey=function(l){return this._reporterState.path.push(l)},w.prototype.exitKey=function(l){var t=this._reporterState;t.path=t.path.slice(0,l-1)},w.prototype.leaveKey=function(l,t,s){var u=this._reporterState;this.exitKey(l),u.obj!==null&&(u.obj[t]=s)},w.prototype.path=function(){return this._reporterState.path.join("/")},w.prototype.enterObject=function(){var l=this._reporterState,t=l.obj;return l.obj={},t},w.prototype.leaveObject=function(l){var t=this._reporterState,s=t.obj;return t.obj=l,s},w.prototype.error=function(l){var t,s=this._reporterState,u=l instanceof m;if(t=u?l:new m(s.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),l.message||l,l.stack),!s.options.partial)throw t;return u||s.errors.push(t),t},w.prototype.wrapResult=function(l){var t=this._reporterState;return t.options.partial?{result:this.isError(l)?null:l,errors:t.errors}:l},h(m,Error),m.prototype.rethrow=function(l){if(this.message=l+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,m),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},6520:(U,c)=>{function d(h){var w={};return Object.keys(h).forEach(function(m){(0|m)==m&&(m|=0);var l=h[m];w[l]=m}),w}c.tagClass={0:"universal",1:"application",2:"context",3:"private"},c.tagClassByName=d(c.tagClass),c.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},c.tagByName=d(c.tag)},79387:(U,c,d)=>{var h=c;h._reverse=function(w){var m={};return Object.keys(w).forEach(function(l){(0|l)==l&&(l|=0);var t=w[l];m[t]=l}),m},h.der=d(6520)},92387:(U,c,d)=>{var h=d(41736),w=d(31734),m=d(90585).C,l=d(51371),t=d(6520);function s(n){this.enc="der",this.name=n.name,this.entity=n,this.tree=new u,this.tree._init(n.body)}function u(n){l.call(this,"der",n)}function r(n,i){var e=n.readUInt8(i);if(n.isError(e))return e;var a=t.tagClass[e>>6],f=(32&e)==0;if((31&e)==31){var p=e;for(e=0;(128&p)==128;){if(p=n.readUInt8(i),n.isError(p))return p;e<<=7,e|=127&p}}else e&=31;return{cls:a,primitive:f,tag:e,tagStr:t.tag[e]}}function o(n,i,e){var a=n.readUInt8(e);if(n.isError(a))return a;if(!i&&a===128)return null;if(!(128&a))return a;var f=127&a;if(f>4)return n.error("length octect is too long");a=0;for(var p=0;p{var h=c;h.der=d(92387),h.pem=d(50529)},50529:(U,c,d)=>{var h=d(41736),w=d(11755).Buffer,m=d(92387);function l(t){m.call(this,t),this.enc="pem"}h(l,m),U.exports=l,l.prototype.decode=function(t,s){for(var u=t.toString().split(/[\r\n]+/g),r=s.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,i=-1,e=0;e{var h=d(41736),w=d(11755).Buffer,m=d(51371),l=d(6520);function t(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new s,this.tree._init(r.body)}function s(r){m.call(this,"der",r)}function u(r){return r<10?"0"+r:r}U.exports=t,t.prototype.encode=function(r,o){return this.tree._encode(r,o).join()},h(s,m),s.prototype._encodeComposite=function(r,o,n,i){var e=function(v,S,E,O){var k;if(v==="seqof"?v="seq":v==="setof"&&(v="set"),l.tagByName.hasOwnProperty(v))k=l.tagByName[v];else{if(typeof v!="number"||(0|v)!==v)return O.error("Unknown tag: "+v);k=v}return k>=31?O.error("Multi-octet tag encoding unsupported"):(S||(k|=32),k|=l.tagClassByName[E||"universal"]<<6)}(r,o,n,this.reporter);if(i.length<128){var a=w.alloc(2);return a[0]=e,a[1]=i.length,this._createEncoderBuffer([a,i])}for(var f=1,p=i.length;p>=256;p>>=8)f++;var g=w.alloc(2+f);g[0]=e,g[1]=128|f;for(var x=1+f,y=i.length;y>0;x--,y>>=8)g[x]=255&y;return this._createEncoderBuffer([g,i])},s.prototype._encodeStr=function(r,o){if(o==="bitstr")return this._createEncoderBuffer([0|r.unused,r.data]);if(o==="bmpstr"){for(var n=w.alloc(2*r.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}for(var a=0,f=0;f=128;p>>=7)a++}for(var g=w.alloc(a),x=g.length-1,y=r.length-1;y>=0;y--){var v=r[y];for(g[x--]=127&v;(v>>=7)>0;)g[x--]=128|127&v}return this._createEncoderBuffer(g)},s.prototype._encodeTime=function(r,o){var n,i=new Date(r);return o==="gentime"?n=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):o==="utctime"?n=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+o+" time is not supported yet"),this._encodeStr(n,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(r,o){if(typeof r=="string"){if(!o)return this.reporter.error("String int or enum given, but no values map");if(!o.hasOwnProperty(r))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(r));r=o[r]}if(typeof r!="number"&&!w.isBuffer(r)){var n=r.toArray();!r.sign&&128&n[0]&&n.unshift(0),r=w.from(n)}if(w.isBuffer(r)){var i=r.length;r.length===0&&i++;var e=w.alloc(i);return r.copy(e),r.length===0&&(e[0]=0),this._createEncoderBuffer(e)}if(r<128)return this._createEncoderBuffer(r);if(r<256)return this._createEncoderBuffer([0,r]);for(var a=1,f=r;f>=256;f>>=8)a++;for(var p=new Array(a),g=p.length-1;g>=0;g--)p[g]=255&r,r>>=8;return 128&p[0]&&p.unshift(0),this._createEncoderBuffer(w.from(p))},s.prototype._encodeBool=function(r){return this._createEncoderBuffer(r?255:0)},s.prototype._use=function(r,o){return typeof r=="function"&&(r=r(o)),r._getEncoder("der").tree},s.prototype._skipDefault=function(r,o,n){var i,e=this._baseState;if(e.default===null)return!1;var a=r.join();if(e.defaultBuffer===void 0&&(e.defaultBuffer=this._encodeValue(e.default,o,n).join()),a.length!==e.defaultBuffer.length)return!1;for(i=0;i{var h=c;h.der=d(11068),h.pem=d(38520)},38520:(U,c,d)=>{var h=d(41736),w=d(11068);function m(l){w.call(this,l),this.enc="pem"}h(m,w),U.exports=m,m.prototype.encode=function(l,t){for(var s=w.prototype.encode.call(this,l).toString("base64"),u=["-----BEGIN "+t.label+"-----"],r=0;r{var h=d(28847)(d(3355)),w=d(33103);function m(k,L){if(k===L)return 0;for(var C=k.length,M=L.length,T=0,b=Math.min(C,M);T=0;J--)if(X[J]!==R[J])return!1;for(J=X.length-1;J>=0;J--)if(!y(b[G=X[J]],_[G],D,A))return!1;return!0}(k,L,C,M))}return C?k===L:k==L}function v(k){return Object.prototype.toString.call(k)=="[object Arguments]"}function S(k,L){if(!k||!L)return!1;if(Object.prototype.toString.call(L)=="[object RegExp]")return L.test(k);try{if(k instanceof L)return!0}catch{}return!Error.isPrototypeOf(L)&&L.call({},k)===!0}function E(k,L,C,M){var T;if(typeof L!="function")throw new TypeError('"block" argument must be a function');typeof C=="string"&&(M=C,C=null),T=function(D){var A;try{D()}catch(P){A=P}return A}(L),M=(C&&C.name?" ("+C.name+").":".")+(M?" "+M:"."),k&&!T&&g(T,C,"Missing expected exception"+M);var b=typeof M=="string",_=!k&&T&&!C;if((!k&&t.isError(T)&&b&&S(T,C)||_)&&g(T,C,"Got unwanted exception"+M),k&&T&&C&&!S(T,C)||!k&&T)throw T}i.AssertionError=function(k){this.name="AssertionError",this.actual=k.actual,this.expected=k.expected,this.operator=k.operator,k.message?(this.message=k.message,this.generatedMessage=!1):(this.message=function(D){return f(p(D.actual),128)+" "+D.operator+" "+f(p(D.expected),128)}(this),this.generatedMessage=!0);var L=k.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,L);else{var C=new Error;if(C.stack){var M=C.stack,T=a(L),b=M.indexOf(`
+`+T);if(b>=0){var _=M.indexOf(`
+`,b+1);M=M.substring(_+1)}this.stack=M}}},t.inherits(i.AssertionError,Error),i.fail=g,i.ok=x,i.equal=function(k,L,C){k!=L&&g(k,L,C,"==",i.equal)},i.notEqual=function(k,L,C){k==L&&g(k,L,C,"!=",i.notEqual)},i.deepEqual=function(k,L,C){y(k,L,!1)||g(k,L,C,"deepEqual",i.deepEqual)},i.deepStrictEqual=function(k,L,C){y(k,L,!0)||g(k,L,C,"deepStrictEqual",i.deepStrictEqual)},i.notDeepEqual=function(k,L,C){y(k,L,!1)&&g(k,L,C,"notDeepEqual",i.notDeepEqual)},i.notDeepStrictEqual=function k(L,C,M){y(L,C,!0)&&g(L,C,M,"notDeepStrictEqual",k)},i.strictEqual=function(k,L,C){k!==L&&g(k,L,C,"===",i.strictEqual)},i.notStrictEqual=function(k,L,C){k===L&&g(k,L,C,"!==",i.notStrictEqual)},i.throws=function(k,L,C){E(!0,k,L,C)},i.doesNotThrow=function(k,L,C){E(!1,k,L,C)},i.ifError=function(k){if(k)throw k},i.strict=w(function k(L,C){L||g(L,!0,C,"==",k)},i,{equal:i.strictEqual,deepEqual:i.deepStrictEqual,notEqual:i.notStrictEqual,notDeepEqual:i.notDeepStrictEqual}),i.strict.strict=i.strict;var O=Object.keys||function(k){var L=[];for(var C in k)s.call(k,C)&&L.push(C);return L}},94074:U=>{typeof Object.create=="function"?U.exports=function(c,d){c.super_=d,c.prototype=Object.create(d.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})}:U.exports=function(c,d){c.super_=d;var h=function(){};h.prototype=d.prototype,c.prototype=new h,c.prototype.constructor=c}},86732:(U,c,d)=>{var h=d(28847)(d(3355));U.exports=function(w){return w&&(0,h.default)(w)==="object"&&typeof w.copy=="function"&&typeof w.fill=="function"&&typeof w.readUInt8=="function"}},69954:(U,c,d)=>{var h=d(19142),w=d(28847)(d(3355)),m=/%[sdj%]/g;c.format=function(T){if(!g(T)){for(var b=[],_=0;_=A)return G;switch(G){case"%s":return String(D[_++]);case"%d":return Number(D[_++]);case"%j":try{return JSON.stringify(D[_++])}catch{return"[Circular]"}default:return G}}),I=D[_];_=3&&(_.depth=arguments[2]),arguments.length>=4&&(_.colors=arguments[3]),a(b)?_.showHidden=b:b&&c._extend(_,b),x(_.showHidden)&&(_.showHidden=!1),x(_.depth)&&(_.depth=2),x(_.colors)&&(_.colors=!1),x(_.customInspect)&&(_.customInspect=!0),_.colors&&(_.stylize=u),o(_,T,_.depth)}function u(T,b){var _=s.styles[b];return _?"\x1B["+s.colors[_][0]+"m"+T+"\x1B["+s.colors[_][1]+"m":T}function r(T,b){return T}function o(T,b,_){if(T.customInspect&&b&&O(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var D=b.inspect(_,T);return g(D)||(D=o(T,D,_)),D}var A=function(V,z){if(x(z))return V.stylize("undefined","undefined");if(g(z)){var j="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return V.stylize(j,"string")}return p(z)?V.stylize(""+z,"number"):a(z)?V.stylize(""+z,"boolean"):f(z)?V.stylize("null","null"):void 0}(T,b);if(A)return A;var P=Object.keys(b),I=function(V){var z={};return V.forEach(function(j,B){z[j]=!0}),z}(P);if(T.showHidden&&(P=Object.getOwnPropertyNames(b)),E(b)&&(P.indexOf("message")>=0||P.indexOf("description")>=0))return n(b);if(P.length===0){if(O(b)){var G=b.name?": "+b.name:"";return T.stylize("[Function"+G+"]","special")}if(y(b))return T.stylize(RegExp.prototype.toString.call(b),"regexp");if(S(b))return T.stylize(Date.prototype.toString.call(b),"date");if(E(b))return n(b)}var J,X="",R=!1,H=["{","}"];return e(b)&&(R=!0,H=["[","]"]),O(b)&&(X=" [Function"+(b.name?": "+b.name:"")+"]"),y(b)&&(X=" "+RegExp.prototype.toString.call(b)),S(b)&&(X=" "+Date.prototype.toUTCString.call(b)),E(b)&&(X=" "+n(b)),P.length!==0||R&&b.length!=0?_<0?y(b)?T.stylize(RegExp.prototype.toString.call(b),"regexp"):T.stylize("[Object]","special"):(T.seen.push(b),J=R?function(V,z,j,B,N){for(var F=[],K=0,q=z.length;K60?j[0]+(z===""?"":z+`
+ `)+" "+V.join(`,
+ `)+" "+j[1]:j[0]+z+" "+V.join(", ")+" "+j[1]}(J,X,H)):H[0]+X+H[1]}function n(T){return"["+Error.prototype.toString.call(T)+"]"}function i(T,b,_,D,A,P){var I,G,J;if((J=Object.getOwnPropertyDescriptor(b,A)||{value:b[A]}).get?G=J.set?T.stylize("[Getter/Setter]","special"):T.stylize("[Getter]","special"):J.set&&(G=T.stylize("[Setter]","special")),M(D,A)||(I="["+A+"]"),G||(T.seen.indexOf(J.value)<0?(G=f(_)?o(T,J.value,null):o(T,J.value,_-1)).indexOf(`
+`)>-1&&(G=P?G.split(`
+`).map(function(X){return" "+X}).join(`
+`).substr(2):`
+`+G.split(`
+`).map(function(X){return" "+X}).join(`
+`)):G=T.stylize("[Circular]","special")),x(I)){if(P&&A.match(/^\d+$/))return G;(I=JSON.stringify(""+A)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(I=I.substr(1,I.length-2),I=T.stylize(I,"name")):(I=I.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),I=T.stylize(I,"string"))}return I+": "+G}function e(T){return Array.isArray(T)}function a(T){return typeof T=="boolean"}function f(T){return T===null}function p(T){return typeof T=="number"}function g(T){return typeof T=="string"}function x(T){return T===void 0}function y(T){return v(T)&&k(T)==="[object RegExp]"}function v(T){return(0,w.default)(T)==="object"&&T!==null}function S(T){return v(T)&&k(T)==="[object Date]"}function E(T){return v(T)&&(k(T)==="[object Error]"||T instanceof Error)}function O(T){return typeof T=="function"}function k(T){return Object.prototype.toString.call(T)}function L(T){return T<10?"0"+T.toString(10):T.toString(10)}c.debuglog=function(T){if(x(l)&&(l=h.env.NODE_DEBUG||""),T=T.toUpperCase(),!t[T])if(new RegExp("\\b"+T+"\\b","i").test(l)){var b=h.pid;t[T]=function(){var _=c.format.apply(c,arguments);console.error("%s %d: %s",T,b,_)}}else t[T]=function(){};return t[T]},c.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},c.isArray=e,c.isBoolean=a,c.isNull=f,c.isNullOrUndefined=function(T){return T==null},c.isNumber=p,c.isString=g,c.isSymbol=function(T){return(0,w.default)(T)==="symbol"},c.isUndefined=x,c.isRegExp=y,c.isObject=v,c.isDate=S,c.isError=E,c.isFunction=O,c.isPrimitive=function(T){return T===null||typeof T=="boolean"||typeof T=="number"||typeof T=="string"||(0,w.default)(T)==="symbol"||T===void 0},c.isBuffer=d(86732);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(T,b){return Object.prototype.hasOwnProperty.call(T,b)}c.log=function(){var T,b;console.log("%s - %s",(b=[L((T=new Date).getHours()),L(T.getMinutes()),L(T.getSeconds())].join(":"),[T.getDate(),C[T.getMonth()],b].join(" ")),c.format.apply(c,arguments))},c.inherits=d(94074),c._extend=function(T,b){if(!b||!v(b))return T;for(var _=Object.keys(b),D=_.length;D--;)T[_[D]]=b[_[D]];return T}},27548:(U,c,d)=>{var h=d(48850).Buffer;U.exports=function(w){if(w.length>=255)throw new TypeError("Alphabet too long");for(var m=new Uint8Array(256),l=0;l>>0,y=new Uint8Array(x);a[f];){var v=m[a.charCodeAt(f)];if(v===255)return;for(var S=0,E=x-1;(v!==0||S>>0,y[E]=v%256>>>0,v=v/256>>>0;if(v!==0)throw new Error("Non-zero carry");g=S,f++}for(var O=x-g;O!==x&&y[O]===0;)O++;var k=h.allocUnsafe(p+(x-O));k.fill(0,0,p);for(var L=p;O!==x;)k[L++]=y[O++];return k}return{encode:function(a){if((Array.isArray(a)||a instanceof Uint8Array)&&(a=h.from(a)),!h.isBuffer(a))throw new TypeError("Expected Buffer");if(a.length===0)return"";for(var f=0,p=0,g=0,x=a.length;g!==x&&a[g]===0;)g++,f++;for(var y=(x-g)*i+1>>>0,v=new Uint8Array(y);g!==x;){for(var S=a[g],E=0,O=y-1;(S!==0||E>>0,v[O]=S%r>>>0,S=S/r>>>0;if(S!==0)throw new Error("Non-zero carry");p=E,g++}for(var k=y-p;k!==y&&v[k]===0;)k++;for(var L=o.repeat(f);k{c.byteLength=function(r){var o=s(r),n=o[0],i=o[1];return 3*(n+i)/4-i},c.toByteArray=function(r){var o,n,i=s(r),e=i[0],a=i[1],f=new w(function(x,y,v){return 3*(y+v)/4-v}(0,e,a)),p=0,g=a>0?e-4:e;for(n=0;n>16&255,f[p++]=o>>8&255,f[p++]=255&o;return a===2&&(o=h[r.charCodeAt(n)]<<2|h[r.charCodeAt(n+1)]>>4,f[p++]=255&o),a===1&&(o=h[r.charCodeAt(n)]<<10|h[r.charCodeAt(n+1)]<<4|h[r.charCodeAt(n+2)]>>2,f[p++]=o>>8&255,f[p++]=255&o),f},c.fromByteArray=function(r){for(var o,n=r.length,i=n%3,e=[],a=16383,f=0,p=n-i;fp?p:f+a));return i===1?(o=r[n-1],e.push(d[o>>2]+d[o<<4&63]+"==")):i===2&&(o=(r[n-2]<<8)+r[n-1],e.push(d[o>>10]+d[o>>4&63]+d[o<<2&63]+"=")),e.join("")};for(var d=[],h=[],w=typeof Uint8Array<"u"?Uint8Array:Array,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,t=m.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var n=r.indexOf("=");return n===-1&&(n=o),[n,n===o?0:4-n%4]}function u(r,o,n){for(var i,e,a=[],f=o;f>18&63]+d[e>>12&63]+d[e>>6&63]+d[63&e]);return a.join("")}h[45]=62,h[95]=63},31734:(U,c,d)=>{U=d.nmd(U);var h=d(28847)(d(3355));(function(w,m){function l(b,_){if(!b)throw new Error(_||"Assertion failed")}function t(b,_){b.super_=_;var D=function(){};D.prototype=_.prototype,b.prototype=new D,b.prototype.constructor=b}function s(b,_,D){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&(_!=="le"&&_!=="be"||(D=_,_=10),this._init(b||0,_||10,D||"be"))}var u;(0,h.default)(w)==="object"?w.exports=s:(void 0).BN=s,s.BN=s,s.wordSize=26;try{u=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:d(29033).Buffer}catch{}function r(b,_){var D=b.charCodeAt(_);return D>=48&&D<=57?D-48:D>=65&&D<=70?D-55:D>=97&&D<=102?D-87:void l(!1,"Invalid character in "+b)}function o(b,_,D){var A=r(b,D);return D-1>=_&&(A|=r(b,D-1)<<4),A}function n(b,_,D,A){for(var P=0,I=0,G=Math.min(b.length,D),J=_;J=49?X-49+10:X>=17?X-17+10:X,l(X>=0&&I0?b:_},s.min=function(b,_){return b.cmp(_)<0?b:_},s.prototype._init=function(b,_,D){if(typeof b=="number")return this._initNumber(b,_,D);if((0,h.default)(b)==="object")return this._initArray(b,_,D);_==="hex"&&(_=16),l(_===(0|_)&&_>=2&&_<=36);var A=0;(b=b.toString().replace(/\s+/g,""))[0]==="-"&&(A++,this.negative=1),A=0;A-=3)I=b[A]|b[A-1]<<8|b[A-2]<<16,this.words[P]|=I<>>26-G&67108863,(G+=24)>=26&&(G-=26,P++);else if(D==="le")for(A=0,P=0;A>>26-G&67108863,(G+=24)>=26&&(G-=26,P++);return this._strip()},s.prototype._parseHex=function(b,_,D){this.length=Math.ceil((b.length-_)/6),this.words=new Array(this.length);for(var A=0;A=_;A-=2)P=o(b,_,A)<=18?(I-=18,G+=1,this.words[G]|=P>>>26):I+=8;else for(A=(b.length-_)%2==0?_+1:_;A=18?(I-=18,G+=1,this.words[G]|=P>>>26):I+=8;this._strip()},s.prototype._parseBase=function(b,_,D){this.words=[0],this.length=1;for(var A=0,P=1;P<=67108863;P*=_)A++;A--,P=P/_|0;for(var I=b.length-D,G=I%A,J=Math.min(I,I-G)+D,X=0,R=D;R1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=e}catch{s.prototype.inspect=e}else s.prototype.inspect=e;function e(){return(this.red?""}var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[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],p=[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 g(b,_,D){D.negative=_.negative^b.negative;var A=b.length+_.length|0;D.length=A,A=A-1|0;var P=0|b.words[0],I=0|_.words[0],G=P*I,J=67108863&G,X=G/67108864|0;D.words[0]=J;for(var R=1;R>>26,V=67108863&X,z=Math.min(R,_.length-1),j=Math.max(0,R-b.length+1);j<=z;j++){var B=R-j|0;H+=(G=(P=0|b.words[B])*(I=0|_.words[j])+V)/67108864|0,V=67108863&G}D.words[R]=0|V,X=0|H}return X!==0?D.words[R]=0|X:D.length--,D._strip()}s.prototype.toString=function(b,_){var D;if(_=0|_||1,(b=b||10)===16||b==="hex"){D="";for(var A=0,P=0,I=0;I>>24-A&16777215,(A+=2)>=26&&(A-=26,I--),D=P!==0||I!==this.length-1?a[6-J.length]+J+D:J+D}for(P!==0&&(D=P.toString(16)+D);D.length%_!=0;)D="0"+D;return this.negative!==0&&(D="-"+D),D}if(b===(0|b)&&b>=2&&b<=36){var X=f[b],R=p[b];D="";var H=this.clone();for(H.negative=0;!H.isZero();){var V=H.modrn(R).toString(b);D=(H=H.idivn(R)).isZero()?V+D:a[X-V.length]+V+D}for(this.isZero()&&(D="0"+D);D.length%_!=0;)D="0"+D;return this.negative!==0&&(D="-"+D),D}l(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=67108864*this.words[1]:this.length===3&&this.words[2]===1?b+=4503599627370496+67108864*this.words[1]:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},s.prototype.toJSON=function(){return this.toString(16,2)},u&&(s.prototype.toBuffer=function(b,_){return this.toArrayLike(u,b,_)}),s.prototype.toArray=function(b,_){return this.toArrayLike(Array,b,_)},s.prototype.toArrayLike=function(b,_,D){this._strip();var A=this.byteLength(),P=D||Math.max(1,A);l(A<=P,"byte array longer than desired length"),l(P>0,"Requested array length <= 0");var I=function(G,J){return G.allocUnsafe?G.allocUnsafe(J):new G(J)}(b,P);return this["_toArrayLike"+(_==="le"?"LE":"BE")](I,A),I},s.prototype._toArrayLikeLE=function(b,_){for(var D=0,A=0,P=0,I=0;P>8&255),D